diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/CHANGELOG.md b/sdk/resourcemanager/apimanagement/armapimanagement/CHANGELOG.md index d2139ad7cc6c..5d06015f9da0 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/CHANGELOG.md +++ b/sdk/resourcemanager/apimanagement/armapimanagement/CHANGELOG.md @@ -1,5 +1,165 @@ # Release History +## 2.0.0 (2023-08-25) +### Breaking Changes + +- Function `*ContentItemClient.CreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, string, *ContentItemClientCreateOrUpdateOptions)` to `(context.Context, string, string, string, string, ContentItemContract, *ContentItemClientCreateOrUpdateOptions)` +- Function `*ContentTypeClient.CreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, *ContentTypeClientCreateOrUpdateOptions)` to `(context.Context, string, string, string, ContentTypeContract, *ContentTypeClientCreateOrUpdateOptions)` + +### Features Added + +- New enum type `AsyncResolverStatus` with values `AsyncResolverStatusFailed`, `AsyncResolverStatusInProgress`, `AsyncResolverStatusStarted`, `AsyncResolverStatusSucceeded` +- New enum type `AuthorizationType` with values `AuthorizationTypeOAuth2` +- New enum type `NatGatewayState` with values `NatGatewayStateDisabled`, `NatGatewayStateEnabled` +- New enum type `OAuth2GrantType` with values `OAuth2GrantTypeAuthorizationCode`, `OAuth2GrantTypeClientCredentials` +- New enum type `PolicyFragmentContentFormat` with values `PolicyFragmentContentFormatRawxml`, `PolicyFragmentContentFormatXML` +- New enum type `PortalSettingsCspMode` with values `PortalSettingsCspModeDisabled`, `PortalSettingsCspModeEnabled`, `PortalSettingsCspModeReportOnly` +- New enum type `TranslateRequiredQueryParametersConduct` with values `TranslateRequiredQueryParametersConductQuery`, `TranslateRequiredQueryParametersConductTemplate` +- New function `NewAPIWikiClient(string, azcore.TokenCredential, *arm.ClientOptions) (*APIWikiClient, error)` +- New function `*APIWikiClient.CreateOrUpdate(context.Context, string, string, string, WikiContract, *APIWikiClientCreateOrUpdateOptions) (APIWikiClientCreateOrUpdateResponse, error)` +- New function `*APIWikiClient.Delete(context.Context, string, string, string, string, *APIWikiClientDeleteOptions) (APIWikiClientDeleteResponse, error)` +- New function `*APIWikiClient.Get(context.Context, string, string, string, *APIWikiClientGetOptions) (APIWikiClientGetResponse, error)` +- New function `*APIWikiClient.GetEntityTag(context.Context, string, string, string, *APIWikiClientGetEntityTagOptions) (APIWikiClientGetEntityTagResponse, error)` +- New function `*APIWikiClient.Update(context.Context, string, string, string, string, WikiUpdateContract, *APIWikiClientUpdateOptions) (APIWikiClientUpdateResponse, error)` +- New function `NewAPIWikisClient(string, azcore.TokenCredential, *arm.ClientOptions) (*APIWikisClient, error)` +- New function `*APIWikisClient.NewListPager(string, string, string, *APIWikisClientListOptions) *runtime.Pager[APIWikisClientListResponse]` +- New function `NewAuthorizationAccessPolicyClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AuthorizationAccessPolicyClient, error)` +- New function `*AuthorizationAccessPolicyClient.CreateOrUpdate(context.Context, string, string, string, string, string, AuthorizationAccessPolicyContract, *AuthorizationAccessPolicyClientCreateOrUpdateOptions) (AuthorizationAccessPolicyClientCreateOrUpdateResponse, error)` +- New function `*AuthorizationAccessPolicyClient.Delete(context.Context, string, string, string, string, string, string, *AuthorizationAccessPolicyClientDeleteOptions) (AuthorizationAccessPolicyClientDeleteResponse, error)` +- New function `*AuthorizationAccessPolicyClient.Get(context.Context, string, string, string, string, string, *AuthorizationAccessPolicyClientGetOptions) (AuthorizationAccessPolicyClientGetResponse, error)` +- New function `*AuthorizationAccessPolicyClient.NewListByAuthorizationPager(string, string, string, string, *AuthorizationAccessPolicyClientListByAuthorizationOptions) *runtime.Pager[AuthorizationAccessPolicyClientListByAuthorizationResponse]` +- New function `NewAuthorizationClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AuthorizationClient, error)` +- New function `*AuthorizationClient.ConfirmConsentCode(context.Context, string, string, string, string, AuthorizationConfirmConsentCodeRequestContract, *AuthorizationClientConfirmConsentCodeOptions) (AuthorizationClientConfirmConsentCodeResponse, error)` +- New function `*AuthorizationClient.CreateOrUpdate(context.Context, string, string, string, string, AuthorizationContract, *AuthorizationClientCreateOrUpdateOptions) (AuthorizationClientCreateOrUpdateResponse, error)` +- New function `*AuthorizationClient.Delete(context.Context, string, string, string, string, string, *AuthorizationClientDeleteOptions) (AuthorizationClientDeleteResponse, error)` +- New function `*AuthorizationClient.Get(context.Context, string, string, string, string, *AuthorizationClientGetOptions) (AuthorizationClientGetResponse, error)` +- New function `*AuthorizationClient.NewListByAuthorizationProviderPager(string, string, string, *AuthorizationClientListByAuthorizationProviderOptions) *runtime.Pager[AuthorizationClientListByAuthorizationProviderResponse]` +- New function `NewAuthorizationLoginLinksClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AuthorizationLoginLinksClient, error)` +- New function `*AuthorizationLoginLinksClient.Post(context.Context, string, string, string, string, AuthorizationLoginRequestContract, *AuthorizationLoginLinksClientPostOptions) (AuthorizationLoginLinksClientPostResponse, error)` +- New function `NewAuthorizationProviderClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AuthorizationProviderClient, error)` +- New function `*AuthorizationProviderClient.CreateOrUpdate(context.Context, string, string, string, AuthorizationProviderContract, *AuthorizationProviderClientCreateOrUpdateOptions) (AuthorizationProviderClientCreateOrUpdateResponse, error)` +- New function `*AuthorizationProviderClient.Delete(context.Context, string, string, string, string, *AuthorizationProviderClientDeleteOptions) (AuthorizationProviderClientDeleteResponse, error)` +- New function `*AuthorizationProviderClient.Get(context.Context, string, string, string, *AuthorizationProviderClientGetOptions) (AuthorizationProviderClientGetResponse, error)` +- New function `*AuthorizationProviderClient.NewListByServicePager(string, string, *AuthorizationProviderClientListByServiceOptions) *runtime.Pager[AuthorizationProviderClientListByServiceResponse]` +- New function `*ClientFactory.NewAPIWikiClient() *APIWikiClient` +- New function `*ClientFactory.NewAPIWikisClient() *APIWikisClient` +- New function `*ClientFactory.NewAuthorizationAccessPolicyClient() *AuthorizationAccessPolicyClient` +- New function `*ClientFactory.NewAuthorizationClient() *AuthorizationClient` +- New function `*ClientFactory.NewAuthorizationLoginLinksClient() *AuthorizationLoginLinksClient` +- New function `*ClientFactory.NewAuthorizationProviderClient() *AuthorizationProviderClient` +- New function `*ClientFactory.NewDocumentationClient() *DocumentationClient` +- New function `*ClientFactory.NewGraphQLAPIResolverClient() *GraphQLAPIResolverClient` +- New function `*ClientFactory.NewGraphQLAPIResolverPolicyClient() *GraphQLAPIResolverPolicyClient` +- New function `*ClientFactory.NewPolicyFragmentClient() *PolicyFragmentClient` +- New function `*ClientFactory.NewPortalConfigClient() *PortalConfigClient` +- New function `*ClientFactory.NewProductWikiClient() *ProductWikiClient` +- New function `*ClientFactory.NewProductWikisClient() *ProductWikisClient` +- New function `NewDocumentationClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DocumentationClient, error)` +- New function `*DocumentationClient.CreateOrUpdate(context.Context, string, string, string, DocumentationContract, *DocumentationClientCreateOrUpdateOptions) (DocumentationClientCreateOrUpdateResponse, error)` +- New function `*DocumentationClient.Delete(context.Context, string, string, string, string, *DocumentationClientDeleteOptions) (DocumentationClientDeleteResponse, error)` +- New function `*DocumentationClient.Get(context.Context, string, string, string, *DocumentationClientGetOptions) (DocumentationClientGetResponse, error)` +- New function `*DocumentationClient.GetEntityTag(context.Context, string, string, string, *DocumentationClientGetEntityTagOptions) (DocumentationClientGetEntityTagResponse, error)` +- New function `*DocumentationClient.NewListByServicePager(string, string, *DocumentationClientListByServiceOptions) *runtime.Pager[DocumentationClientListByServiceResponse]` +- New function `*DocumentationClient.Update(context.Context, string, string, string, string, DocumentationUpdateContract, *DocumentationClientUpdateOptions) (DocumentationClientUpdateResponse, error)` +- New function `NewGraphQLAPIResolverClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GraphQLAPIResolverClient, error)` +- New function `*GraphQLAPIResolverClient.CreateOrUpdate(context.Context, string, string, string, string, ResolverContract, *GraphQLAPIResolverClientCreateOrUpdateOptions) (GraphQLAPIResolverClientCreateOrUpdateResponse, error)` +- New function `*GraphQLAPIResolverClient.Delete(context.Context, string, string, string, string, string, *GraphQLAPIResolverClientDeleteOptions) (GraphQLAPIResolverClientDeleteResponse, error)` +- New function `*GraphQLAPIResolverClient.Get(context.Context, string, string, string, string, *GraphQLAPIResolverClientGetOptions) (GraphQLAPIResolverClientGetResponse, error)` +- New function `*GraphQLAPIResolverClient.GetEntityTag(context.Context, string, string, string, string, *GraphQLAPIResolverClientGetEntityTagOptions) (GraphQLAPIResolverClientGetEntityTagResponse, error)` +- New function `*GraphQLAPIResolverClient.NewListByAPIPager(string, string, string, *GraphQLAPIResolverClientListByAPIOptions) *runtime.Pager[GraphQLAPIResolverClientListByAPIResponse]` +- New function `*GraphQLAPIResolverClient.Update(context.Context, string, string, string, string, string, ResolverUpdateContract, *GraphQLAPIResolverClientUpdateOptions) (GraphQLAPIResolverClientUpdateResponse, error)` +- New function `NewGraphQLAPIResolverPolicyClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GraphQLAPIResolverPolicyClient, error)` +- New function `*GraphQLAPIResolverPolicyClient.CreateOrUpdate(context.Context, string, string, string, string, PolicyIDName, PolicyContract, *GraphQLAPIResolverPolicyClientCreateOrUpdateOptions) (GraphQLAPIResolverPolicyClientCreateOrUpdateResponse, error)` +- New function `*GraphQLAPIResolverPolicyClient.Delete(context.Context, string, string, string, string, PolicyIDName, string, *GraphQLAPIResolverPolicyClientDeleteOptions) (GraphQLAPIResolverPolicyClientDeleteResponse, error)` +- New function `*GraphQLAPIResolverPolicyClient.Get(context.Context, string, string, string, string, PolicyIDName, *GraphQLAPIResolverPolicyClientGetOptions) (GraphQLAPIResolverPolicyClientGetResponse, error)` +- New function `*GraphQLAPIResolverPolicyClient.GetEntityTag(context.Context, string, string, string, string, PolicyIDName, *GraphQLAPIResolverPolicyClientGetEntityTagOptions) (GraphQLAPIResolverPolicyClientGetEntityTagResponse, error)` +- New function `*GraphQLAPIResolverPolicyClient.NewListByResolverPager(string, string, string, string, *GraphQLAPIResolverPolicyClientListByResolverOptions) *runtime.Pager[GraphQLAPIResolverPolicyClientListByResolverResponse]` +- New function `NewPolicyFragmentClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PolicyFragmentClient, error)` +- New function `*PolicyFragmentClient.BeginCreateOrUpdate(context.Context, string, string, string, PolicyFragmentContract, *PolicyFragmentClientBeginCreateOrUpdateOptions) (*runtime.Poller[PolicyFragmentClientCreateOrUpdateResponse], error)` +- New function `*PolicyFragmentClient.Delete(context.Context, string, string, string, string, *PolicyFragmentClientDeleteOptions) (PolicyFragmentClientDeleteResponse, error)` +- New function `*PolicyFragmentClient.Get(context.Context, string, string, string, *PolicyFragmentClientGetOptions) (PolicyFragmentClientGetResponse, error)` +- New function `*PolicyFragmentClient.GetEntityTag(context.Context, string, string, string, *PolicyFragmentClientGetEntityTagOptions) (PolicyFragmentClientGetEntityTagResponse, error)` +- New function `*PolicyFragmentClient.ListByService(context.Context, string, string, *PolicyFragmentClientListByServiceOptions) (PolicyFragmentClientListByServiceResponse, error)` +- New function `*PolicyFragmentClient.ListReferences(context.Context, string, string, string, *PolicyFragmentClientListReferencesOptions) (PolicyFragmentClientListReferencesResponse, error)` +- New function `NewPortalConfigClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PortalConfigClient, error)` +- New function `*PortalConfigClient.CreateOrUpdate(context.Context, string, string, string, string, PortalConfigContract, *PortalConfigClientCreateOrUpdateOptions) (PortalConfigClientCreateOrUpdateResponse, error)` +- New function `*PortalConfigClient.Get(context.Context, string, string, string, *PortalConfigClientGetOptions) (PortalConfigClientGetResponse, error)` +- New function `*PortalConfigClient.GetEntityTag(context.Context, string, string, string, *PortalConfigClientGetEntityTagOptions) (PortalConfigClientGetEntityTagResponse, error)` +- New function `*PortalConfigClient.ListByService(context.Context, string, string, *PortalConfigClientListByServiceOptions) (PortalConfigClientListByServiceResponse, error)` +- New function `*PortalConfigClient.Update(context.Context, string, string, string, string, PortalConfigContract, *PortalConfigClientUpdateOptions) (PortalConfigClientUpdateResponse, error)` +- New function `NewProductWikiClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ProductWikiClient, error)` +- New function `*ProductWikiClient.CreateOrUpdate(context.Context, string, string, string, WikiContract, *ProductWikiClientCreateOrUpdateOptions) (ProductWikiClientCreateOrUpdateResponse, error)` +- New function `*ProductWikiClient.Delete(context.Context, string, string, string, string, *ProductWikiClientDeleteOptions) (ProductWikiClientDeleteResponse, error)` +- New function `*ProductWikiClient.Get(context.Context, string, string, string, *ProductWikiClientGetOptions) (ProductWikiClientGetResponse, error)` +- New function `*ProductWikiClient.GetEntityTag(context.Context, string, string, string, *ProductWikiClientGetEntityTagOptions) (ProductWikiClientGetEntityTagResponse, error)` +- New function `*ProductWikiClient.Update(context.Context, string, string, string, string, WikiUpdateContract, *ProductWikiClientUpdateOptions) (ProductWikiClientUpdateResponse, error)` +- New function `NewProductWikisClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ProductWikisClient, error)` +- New function `*ProductWikisClient.NewListPager(string, string, string, *ProductWikisClientListOptions) *runtime.Pager[ProductWikisClientListResponse]` +- New function `*ServiceClient.BeginMigrateToStv2(context.Context, string, string, *ServiceClientBeginMigrateToStv2Options) (*runtime.Poller[ServiceClientMigrateToStv2Response], error)` +- New struct `AuthorizationAccessPolicyCollection` +- New struct `AuthorizationAccessPolicyContract` +- New struct `AuthorizationAccessPolicyContractProperties` +- New struct `AuthorizationCollection` +- New struct `AuthorizationConfirmConsentCodeRequestContract` +- New struct `AuthorizationContract` +- New struct `AuthorizationContractProperties` +- New struct `AuthorizationError` +- New struct `AuthorizationLoginRequestContract` +- New struct `AuthorizationLoginResponseContract` +- New struct `AuthorizationProviderCollection` +- New struct `AuthorizationProviderContract` +- New struct `AuthorizationProviderContractProperties` +- New struct `AuthorizationProviderOAuth2GrantTypes` +- New struct `AuthorizationProviderOAuth2Settings` +- New struct `DocumentationCollection` +- New struct `DocumentationContract` +- New struct `DocumentationContractProperties` +- New struct `DocumentationUpdateContract` +- New struct `PolicyFragmentCollection` +- New struct `PolicyFragmentContract` +- New struct `PolicyFragmentContractProperties` +- New struct `PortalConfigCollection` +- New struct `PortalConfigContract` +- New struct `PortalConfigCorsProperties` +- New struct `PortalConfigCspProperties` +- New struct `PortalConfigDelegationProperties` +- New struct `PortalConfigProperties` +- New struct `PortalConfigPropertiesSignin` +- New struct `PortalConfigPropertiesSignup` +- New struct `PortalConfigTermsOfServiceProperties` +- New struct `ProxyResource` +- New struct `ResolverCollection` +- New struct `ResolverContract` +- New struct `ResolverEntityBaseContract` +- New struct `ResolverResultContract` +- New struct `ResolverResultContractProperties` +- New struct `ResolverResultLogItemContract` +- New struct `ResolverUpdateContract` +- New struct `ResolverUpdateContractProperties` +- New struct `ResourceCollection` +- New struct `ResourceCollectionValueItem` +- New struct `WikiCollection` +- New struct `WikiContract` +- New struct `WikiContractProperties` +- New struct `WikiDocumentationContract` +- New struct `WikiUpdateContract` +- New field `TranslateRequiredQueryParametersConduct` in struct `APICreateOrUpdateProperties` +- New field `NatGatewayState`, `OutboundPublicIPAddresses` in struct `AdditionalLocation` +- New field `OAuth2AuthenticationSettings`, `OpenidAuthenticationSettings` in struct `AuthenticationSettingsContract` +- New field `UseInAPIDocumentation`, `UseInTestConsole` in struct `AuthorizationServerContractProperties` +- New field `UseInAPIDocumentation`, `UseInTestConsole` in struct `AuthorizationServerUpdateContractProperties` +- New field `Metrics` in struct `DiagnosticContractProperties` +- New field `ClientLibrary` in struct `IdentityProviderBaseParameters` +- New field `ClientLibrary` in struct `IdentityProviderContractProperties` +- New field `ClientLibrary` in struct `IdentityProviderCreateContractProperties` +- New field `ClientLibrary` in struct `IdentityProviderUpdateProperties` +- New field `UseInAPIDocumentation`, `UseInTestConsole` in struct `OpenidConnectProviderContractProperties` +- New field `UseInAPIDocumentation`, `UseInTestConsole` in struct `OpenidConnectProviderUpdateContractProperties` +- New field `NatGatewayState`, `OutboundPublicIPAddresses` in struct `ServiceBaseProperties` +- New field `NatGatewayState`, `OutboundPublicIPAddresses` in struct `ServiceProperties` +- New field `NatGatewayState`, `OutboundPublicIPAddresses` in struct `ServiceUpdateProperties` + + ## 1.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/api_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/api_client.go index e085c2781709..18e215dd7dcc 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/api_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/api_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type APIClient struct { } // NewAPIClient creates a new instance of APIClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAPIClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIClient, error) { @@ -49,8 +47,8 @@ func NewAPIClient(subscriptionID string, credential azcore.TokenCredential, opti // BeginCreateOrUpdate - Creates new or updates existing specified API of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -62,9 +60,10 @@ func (client *APIClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupN if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[APIClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[APIClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[APIClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,20 +72,22 @@ func (client *APIClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupN // CreateOrUpdate - Creates new or updates existing specified API of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *APIClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, parameters APICreateOrUpdateParameter, options *APIClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,20 +114,23 @@ func (client *APIClient) createOrUpdateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Delete - Deletes the specified API of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -134,16 +138,18 @@ func (client *APIClient) createOrUpdateCreateRequest(ctx context.Context, resour // it should be * for unconditional update. // - options - APIClientDeleteOptions contains the optional parameters for the APIClient.Delete method. func (client *APIClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, ifMatch string, options *APIClientDeleteOptions) (APIClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, ifMatch, options) if err != nil { return APIClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return APIClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return APIClientDeleteResponse{}, err } return APIClientDeleteResponse{}, nil } @@ -175,7 +181,7 @@ func (client *APIClient) deleteCreateRequest(ctx context.Context, resourceGroupN if options != nil && options.DeleteRevisions != nil { reqQP.Set("deleteRevisions", strconv.FormatBool(*options.DeleteRevisions)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -185,25 +191,28 @@ func (client *APIClient) deleteCreateRequest(ctx context.Context, resourceGroupN // Get - Gets the details of the API specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. // - options - APIClientGetOptions contains the optional parameters for the APIClient.Get method. func (client *APIClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIClientGetOptions) (APIClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, options) if err != nil { return APIClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -230,7 +239,7 @@ func (client *APIClient) getCreateRequest(ctx context.Context, resourceGroupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,25 +259,28 @@ func (client *APIClient) getHandleResponse(resp *http.Response) (APIClientGetRes // GetEntityTag - Gets the entity state (Etag) version of the API specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. // - options - APIClientGetEntityTagOptions contains the optional parameters for the APIClient.GetEntityTag method. func (client *APIClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIClientGetEntityTagOptions) (APIClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, options) if err != nil { return APIClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -295,7 +307,7 @@ func (client *APIClient) getEntityTagCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -313,8 +325,8 @@ func (client *APIClient) getEntityTagHandleResponse(resp *http.Response) (APICli // NewListByServicePager - Lists all APIs of the API Management service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - APIClientListByServiceOptions contains the optional parameters for the APIClient.NewListByServicePager method. func (client *APIClient) NewListByServicePager(resourceGroupName string, serviceName string, options *APIClientListByServiceOptions) *runtime.Pager[APIClientListByServiceResponse] { @@ -380,7 +392,7 @@ func (client *APIClient) listByServiceCreateRequest(ctx context.Context, resourc if options != nil && options.ExpandAPIVersionSet != nil { reqQP.Set("expandApiVersionSet", strconv.FormatBool(*options.ExpandAPIVersionSet)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -397,8 +409,8 @@ func (client *APIClient) listByServiceHandleResponse(resp *http.Response) (APICl // NewListByTagsPager - Lists a collection of apis associated with tags. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - APIClientListByTagsOptions contains the optional parameters for the APIClient.NewListByTagsPager method. func (client *APIClient) NewListByTagsPager(resourceGroupName string, serviceName string, options *APIClientListByTagsOptions) *runtime.Pager[APIClientListByTagsResponse] { @@ -461,7 +473,7 @@ func (client *APIClient) listByTagsCreateRequest(ctx context.Context, resourceGr if options != nil && options.IncludeNotTaggedApis != nil { reqQP.Set("includeNotTaggedApis", strconv.FormatBool(*options.IncludeNotTaggedApis)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -479,8 +491,8 @@ func (client *APIClient) listByTagsHandleResponse(resp *http.Response) (APIClien // Update - Updates the specified API of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -489,18 +501,21 @@ func (client *APIClient) listByTagsHandleResponse(resp *http.Response) (APIClien // - parameters - API Update Contract parameters. // - options - APIClientUpdateOptions contains the optional parameters for the APIClient.Update method. func (client *APIClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, ifMatch string, parameters APIUpdateContract, options *APIClientUpdateOptions) (APIClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, apiID, ifMatch, parameters, options) if err != nil { return APIClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -527,11 +542,14 @@ func (client *APIClient) updateCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/api_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/api_client_example_test.go index 43bc9d98dd64..b424ced45e4f 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/api_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/api_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApis.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApis.json func ExampleAPIClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -112,7 +112,7 @@ func ExampleAPIClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadApi.json func ExampleAPIClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -129,7 +129,7 @@ func ExampleAPIClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiContract.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiContract.json func ExampleAPIClient_Get_apiManagementGetApiContract() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -154,6 +154,21 @@ func ExampleAPIClient_Get_apiManagementGetApiContract() { // Properties: &armapimanagement.APIContractProperties{ // APIType: to.Ptr(armapimanagement.APITypeSoap), // APIRevision: to.Ptr("1"), + // AuthenticationSettings: &armapimanagement.AuthenticationSettingsContract{ + // OAuth2: &armapimanagement.OAuth2AuthenticationSettingsContract{ + // AuthorizationServerID: to.Ptr("authorizationServerId2283"), + // Scope: to.Ptr("oauth2scope2580"), + // }, + // OAuth2AuthenticationSettings: []*armapimanagement.OAuth2AuthenticationSettingsContract{ + // { + // AuthorizationServerID: to.Ptr("authorizationServerId2283"), + // Scope: to.Ptr("oauth2scope2580"), + // }, + // { + // AuthorizationServerID: to.Ptr("authorizationServerId2284"), + // Scope: to.Ptr("oauth2scope2581"), + // }}, + // }, // IsCurrent: to.Ptr(true), // IsOnline: to.Ptr(true), // SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{ @@ -169,7 +184,7 @@ func ExampleAPIClient_Get_apiManagementGetApiContract() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiRevision.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiRevision.json func ExampleAPIClient_Get_apiManagementGetApiRevisionContract() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -194,6 +209,21 @@ func ExampleAPIClient_Get_apiManagementGetApiRevisionContract() { // Properties: &armapimanagement.APIContractProperties{ // APIRevision: to.Ptr("3"), // APIRevisionDescription: to.Ptr("fixed bug in contract"), + // AuthenticationSettings: &armapimanagement.AuthenticationSettingsContract{ + // OAuth2: &armapimanagement.OAuth2AuthenticationSettingsContract{ + // AuthorizationServerID: to.Ptr("authorizationServerId2283"), + // Scope: to.Ptr("oauth2scope2580"), + // }, + // OAuth2AuthenticationSettings: []*armapimanagement.OAuth2AuthenticationSettingsContract{ + // { + // AuthorizationServerID: to.Ptr("authorizationServerId2283"), + // Scope: to.Ptr("oauth2scope2580"), + // }, + // { + // AuthorizationServerID: to.Ptr("authorizationServerId2284"), + // Scope: to.Ptr("oauth2scope2581"), + // }}, + // }, // SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{ // Header: to.Ptr("Ocp-Apim-Subscription-Key"), // Query: to.Ptr("subscription-key"), @@ -207,7 +237,7 @@ func ExampleAPIClient_Get_apiManagementGetApiRevisionContract() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApi.json func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApi() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -261,6 +291,11 @@ func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApi() { // AuthorizationServerID: to.Ptr("authorizationServerId2283"), // Scope: to.Ptr("oauth2scope2580"), // }, + // OAuth2AuthenticationSettings: []*armapimanagement.OAuth2AuthenticationSettingsContract{ + // { + // AuthorizationServerID: to.Ptr("authorizationServerId2283"), + // Scope: to.Ptr("oauth2scope2580"), + // }}, // }, // IsCurrent: to.Ptr(true), // IsOnline: to.Ptr(true), @@ -278,7 +313,7 @@ func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApi() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiClone.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiClone.json func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiClone() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -336,7 +371,7 @@ func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiClone() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiNewVersionUsingExistingApi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiNewVersionUsingExistingApi.json func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiNewVersionUsingExistingApi() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -403,7 +438,7 @@ func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiNewVersionUsingE // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiRevisionFromExistingApi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiRevisionFromExistingApi.json func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiRevisionFromExistingApi() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -453,7 +488,7 @@ func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiRevisionFromExis // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiUsingImportOverrideServiceUrl.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiUsingImportOverrideServiceUrl.json func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiUsingImportOverrideServiceUrl() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -503,7 +538,7 @@ func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiUsingImportOverr // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiUsingOai3Import.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiUsingOai3Import.json func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiUsingOai3Import() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -551,7 +586,56 @@ func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiUsingOai3Import( // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiUsingSwaggerImport.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiUsingOai3ImportWithTranslateRequiredQueryParametersConduct.json +func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiUsingOai3ImportWithTranslateRequiredQueryParametersConduct() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAPIClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "petstore", armapimanagement.APICreateOrUpdateParameter{ + Properties: &armapimanagement.APICreateOrUpdateProperties{ + Path: to.Ptr("petstore"), + Format: to.Ptr(armapimanagement.ContentFormatOpenapiLink), + TranslateRequiredQueryParametersConduct: to.Ptr(armapimanagement.TranslateRequiredQueryParametersConductTemplate), + Value: to.Ptr("https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml"), + }, + }, &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.APIContract = armapimanagement.APIContract{ + // Name: to.Ptr("petstoreapi"), + // Type: to.Ptr("Microsoft.ApiManagement/service/apis"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/petstoreapi"), + // Properties: &armapimanagement.APIContractProperties{ + // APIRevision: to.Ptr("1"), + // IsCurrent: to.Ptr(true), + // SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{ + // Header: to.Ptr("Ocp-Apim-Subscription-Key"), + // Query: to.Ptr("subscription-key"), + // }, + // Path: to.Ptr("petstore"), + // DisplayName: to.Ptr("Swagger Petstore"), + // Protocols: []*armapimanagement.Protocol{ + // to.Ptr(armapimanagement.ProtocolHTTPS)}, + // ServiceURL: to.Ptr("http://petstore.swagger.io/v1"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiUsingSwaggerImport.json func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiUsingSwaggerImport() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -600,7 +684,7 @@ func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiUsingSwaggerImpo // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiUsingWadlImport.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiUsingWadlImport.json func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiUsingWadlImport() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -649,7 +733,182 @@ func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiUsingWadlImport( // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiWithOpenIdConnect.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiWithMultipleAuthServers.json +func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiWithMultipleAuthServers() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAPIClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "tempgroup", armapimanagement.APICreateOrUpdateParameter{ + Properties: &armapimanagement.APICreateOrUpdateProperties{ + Description: to.Ptr("apidescription5200"), + AuthenticationSettings: &armapimanagement.AuthenticationSettingsContract{ + OAuth2AuthenticationSettings: []*armapimanagement.OAuth2AuthenticationSettingsContract{ + { + AuthorizationServerID: to.Ptr("authorizationServerId2283"), + Scope: to.Ptr("oauth2scope2580"), + }, + { + AuthorizationServerID: to.Ptr("authorizationServerId2284"), + Scope: to.Ptr("oauth2scope2581"), + }}, + }, + SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{ + Header: to.Ptr("header4520"), + Query: to.Ptr("query3037"), + }, + Path: to.Ptr("newapiPath"), + DisplayName: to.Ptr("apiname1463"), + Protocols: []*armapimanagement.Protocol{ + to.Ptr(armapimanagement.ProtocolHTTPS), + to.Ptr(armapimanagement.ProtocolHTTP)}, + ServiceURL: to.Ptr("http://newechoapi.cloudapp.net/api"), + }, + }, &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.APIContract = armapimanagement.APIContract{ + // Name: to.Ptr("apiid9419"), + // Type: to.Ptr("Microsoft.ApiManagement/service/apis"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/apiid9419"), + // Properties: &armapimanagement.APIContractProperties{ + // Description: to.Ptr("apidescription5200"), + // APIRevision: to.Ptr("1"), + // AuthenticationSettings: &armapimanagement.AuthenticationSettingsContract{ + // OAuth2: &armapimanagement.OAuth2AuthenticationSettingsContract{ + // AuthorizationServerID: to.Ptr("authorizationServerId2283"), + // Scope: to.Ptr("oauth2scope2580"), + // }, + // OAuth2AuthenticationSettings: []*armapimanagement.OAuth2AuthenticationSettingsContract{ + // { + // AuthorizationServerID: to.Ptr("authorizationServerId2283"), + // Scope: to.Ptr("oauth2scope2580"), + // }, + // { + // AuthorizationServerID: to.Ptr("authorizationServerId2284"), + // Scope: to.Ptr("oauth2scope2581"), + // }}, + // }, + // IsCurrent: to.Ptr(true), + // IsOnline: to.Ptr(true), + // SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{ + // Header: to.Ptr("header4520"), + // Query: to.Ptr("query3037"), + // }, + // Path: to.Ptr("newapiPath"), + // DisplayName: to.Ptr("apiname1463"), + // Protocols: []*armapimanagement.Protocol{ + // to.Ptr(armapimanagement.ProtocolHTTP), + // to.Ptr(armapimanagement.ProtocolHTTPS)}, + // ServiceURL: to.Ptr("http://newechoapi.cloudapp.net/api"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiWithMultipleOpenIdConnectProviders.json +func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiWithMultipleOpenIdConnectProviders() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewAPIClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "tempgroup", armapimanagement.APICreateOrUpdateParameter{ + Properties: &armapimanagement.APICreateOrUpdateProperties{ + Description: to.Ptr("apidescription5200"), + AuthenticationSettings: &armapimanagement.AuthenticationSettingsContract{ + OpenidAuthenticationSettings: []*armapimanagement.OpenIDAuthenticationSettingsContract{ + { + BearerTokenSendingMethods: []*armapimanagement.BearerTokenSendingMethods{ + to.Ptr(armapimanagement.BearerTokenSendingMethodsAuthorizationHeader)}, + OpenidProviderID: to.Ptr("openidProviderId2283"), + }, + { + BearerTokenSendingMethods: []*armapimanagement.BearerTokenSendingMethods{ + to.Ptr(armapimanagement.BearerTokenSendingMethodsAuthorizationHeader)}, + OpenidProviderID: to.Ptr("openidProviderId2284"), + }}, + }, + SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{ + Header: to.Ptr("header4520"), + Query: to.Ptr("query3037"), + }, + Path: to.Ptr("newapiPath"), + DisplayName: to.Ptr("apiname1463"), + Protocols: []*armapimanagement.Protocol{ + to.Ptr(armapimanagement.ProtocolHTTPS), + to.Ptr(armapimanagement.ProtocolHTTP)}, + ServiceURL: to.Ptr("http://newechoapi.cloudapp.net/api"), + }, + }, &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.APIContract = armapimanagement.APIContract{ + // Name: to.Ptr("apiid9419"), + // Type: to.Ptr("Microsoft.ApiManagement/service/apis"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/apiid9419"), + // Properties: &armapimanagement.APIContractProperties{ + // Description: to.Ptr("apidescription5200"), + // APIRevision: to.Ptr("1"), + // AuthenticationSettings: &armapimanagement.AuthenticationSettingsContract{ + // Openid: &armapimanagement.OpenIDAuthenticationSettingsContract{ + // BearerTokenSendingMethods: []*armapimanagement.BearerTokenSendingMethods{ + // to.Ptr(armapimanagement.BearerTokenSendingMethodsAuthorizationHeader)}, + // OpenidProviderID: to.Ptr("openidProviderId2283"), + // }, + // OpenidAuthenticationSettings: []*armapimanagement.OpenIDAuthenticationSettingsContract{ + // { + // BearerTokenSendingMethods: []*armapimanagement.BearerTokenSendingMethods{ + // to.Ptr(armapimanagement.BearerTokenSendingMethodsAuthorizationHeader)}, + // OpenidProviderID: to.Ptr("openidProviderId2283"), + // }, + // { + // BearerTokenSendingMethods: []*armapimanagement.BearerTokenSendingMethods{ + // to.Ptr(armapimanagement.BearerTokenSendingMethodsAuthorizationHeader)}, + // OpenidProviderID: to.Ptr("openidProviderId2284"), + // }}, + // }, + // IsCurrent: to.Ptr(true), + // IsOnline: to.Ptr(true), + // SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{ + // Header: to.Ptr("header4520"), + // Query: to.Ptr("query3037"), + // }, + // Path: to.Ptr("newapiPath"), + // DisplayName: to.Ptr("apiname1463"), + // Protocols: []*armapimanagement.Protocol{ + // to.Ptr(armapimanagement.ProtocolHTTP), + // to.Ptr(armapimanagement.ProtocolHTTPS)}, + // ServiceURL: to.Ptr("http://newechoapi.cloudapp.net/api"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiWithOpenIdConnect.json func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiWithOpenIdConnect() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -719,7 +978,7 @@ func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateApiWithOpenIdConnec // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGraphQLApi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateGraphQLApi.json func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateGraphQlApi() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -772,7 +1031,7 @@ func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateGraphQlApi() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateSoapPassThroughApiUsingWsdlImport.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateSoapPassThroughApiUsingWsdlImport.json func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateSoapPassThroughApiUsingWsdlImport() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -826,7 +1085,7 @@ func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateSoapPassThroughApiU // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateSoapToRestApiUsingWsdlImport.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateSoapToRestApiUsingWsdlImport.json func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateSoapToRestApiUsingWsdlImport() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -878,7 +1137,7 @@ func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateSoapToRestApiUsingW // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateWebsocketApi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateWebsocketApi.json func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateWebSocketApi() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -931,7 +1190,7 @@ func ExampleAPIClient_BeginCreateOrUpdate_apiManagementCreateWebSocketApi() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateApi.json func ExampleAPIClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -976,7 +1235,7 @@ func ExampleAPIClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteApi.json func ExampleAPIClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -993,7 +1252,7 @@ func ExampleAPIClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApisByTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApisByTags.json func ExampleAPIClient_NewListByTagsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apidiagnostic_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apidiagnostic_client.go index 0d5ec13489a5..d39f09cd9a45 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apidiagnostic_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apidiagnostic_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type APIDiagnosticClient struct { } // NewAPIDiagnosticClient creates a new instance of APIDiagnosticClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAPIDiagnosticClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIDiagnosticClient, error) { @@ -49,8 +47,8 @@ func NewAPIDiagnosticClient(subscriptionID string, credential azcore.TokenCreden // CreateOrUpdate - Creates a new Diagnostic for an API or updates an existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. @@ -58,18 +56,21 @@ func NewAPIDiagnosticClient(subscriptionID string, credential azcore.TokenCreden // - options - APIDiagnosticClientCreateOrUpdateOptions contains the optional parameters for the APIDiagnosticClient.CreateOrUpdate // method. func (client *APIDiagnosticClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, diagnosticID string, parameters DiagnosticContract, options *APIDiagnosticClientCreateOrUpdateOptions) (APIDiagnosticClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, diagnosticID, parameters, options) if err != nil { return APIDiagnosticClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIDiagnosticClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return APIDiagnosticClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return APIDiagnosticClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -100,13 +101,16 @@ func (client *APIDiagnosticClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -124,8 +128,8 @@ func (client *APIDiagnosticClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Deletes the specified Diagnostic from an API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. @@ -133,16 +137,18 @@ func (client *APIDiagnosticClient) createOrUpdateHandleResponse(resp *http.Respo // it should be * for unconditional update. // - options - APIDiagnosticClientDeleteOptions contains the optional parameters for the APIDiagnosticClient.Delete method. func (client *APIDiagnosticClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, diagnosticID string, ifMatch string, options *APIDiagnosticClientDeleteOptions) (APIDiagnosticClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, diagnosticID, ifMatch, options) if err != nil { return APIDiagnosticClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIDiagnosticClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return APIDiagnosticClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return APIDiagnosticClientDeleteResponse{}, err } return APIDiagnosticClientDeleteResponse{}, nil } @@ -175,7 +181,7 @@ func (client *APIDiagnosticClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -185,25 +191,28 @@ func (client *APIDiagnosticClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets the details of the Diagnostic for an API specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. // - options - APIDiagnosticClientGetOptions contains the optional parameters for the APIDiagnosticClient.Get method. func (client *APIDiagnosticClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, diagnosticID string, options *APIDiagnosticClientGetOptions) (APIDiagnosticClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, diagnosticID, options) if err != nil { return APIDiagnosticClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIDiagnosticClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIDiagnosticClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIDiagnosticClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -234,7 +243,7 @@ func (client *APIDiagnosticClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,26 +263,29 @@ func (client *APIDiagnosticClient) getHandleResponse(resp *http.Response) (APIDi // GetEntityTag - Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. // - options - APIDiagnosticClientGetEntityTagOptions contains the optional parameters for the APIDiagnosticClient.GetEntityTag // method. func (client *APIDiagnosticClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, diagnosticID string, options *APIDiagnosticClientGetEntityTagOptions) (APIDiagnosticClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, diagnosticID, options) if err != nil { return APIDiagnosticClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIDiagnosticClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIDiagnosticClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIDiagnosticClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -304,7 +316,7 @@ func (client *APIDiagnosticClient) getEntityTagCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -322,8 +334,8 @@ func (client *APIDiagnosticClient) getEntityTagHandleResponse(resp *http.Respons // NewListByServicePager - Lists all diagnostics of an API. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - options - APIDiagnosticClientListByServiceOptions contains the optional parameters for the APIDiagnosticClient.NewListByServicePager @@ -389,7 +401,7 @@ func (client *APIDiagnosticClient) listByServiceCreateRequest(ctx context.Contex if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -407,8 +419,8 @@ func (client *APIDiagnosticClient) listByServiceHandleResponse(resp *http.Respon // Update - Updates the details of the Diagnostic for an API specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. @@ -417,18 +429,21 @@ func (client *APIDiagnosticClient) listByServiceHandleResponse(resp *http.Respon // - parameters - Diagnostic Update parameters. // - options - APIDiagnosticClientUpdateOptions contains the optional parameters for the APIDiagnosticClient.Update method. func (client *APIDiagnosticClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, diagnosticID string, ifMatch string, parameters DiagnosticContract, options *APIDiagnosticClientUpdateOptions) (APIDiagnosticClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, apiID, diagnosticID, ifMatch, parameters, options) if err != nil { return APIDiagnosticClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIDiagnosticClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIDiagnosticClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIDiagnosticClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -459,11 +474,14 @@ func (client *APIDiagnosticClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apidiagnostic_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apidiagnostic_client_example_test.go index fde0cd88710b..9740b5dfbebf 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apidiagnostic_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apidiagnostic_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiDiagnostics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApiDiagnostics.json func ExampleAPIDiagnosticClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -97,7 +97,7 @@ func ExampleAPIDiagnosticClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiDiagnostic.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadApiDiagnostic.json func ExampleAPIDiagnosticClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -114,7 +114,7 @@ func ExampleAPIDiagnosticClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiDiagnostic.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiDiagnostic.json func ExampleAPIDiagnosticClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -181,7 +181,7 @@ func ExampleAPIDiagnosticClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiDiagnostic.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiDiagnostic.json func ExampleAPIDiagnosticClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -287,7 +287,7 @@ func ExampleAPIDiagnosticClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiDiagnostic.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateApiDiagnostic.json func ExampleAPIDiagnosticClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -395,7 +395,7 @@ func ExampleAPIDiagnosticClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiDiagnostic.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteApiDiagnostic.json func ExampleAPIDiagnosticClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apiexport_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiexport_client.go index 3f2a24f78aad..d099f1a016e3 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apiexport_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiexport_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type APIExportClient struct { } // NewAPIExportClient creates a new instance of APIExportClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAPIExportClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIExportClient, error) { @@ -49,8 +47,8 @@ func NewAPIExportClient(subscriptionID string, credential azcore.TokenCredential // valid for 5 minutes. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -58,18 +56,21 @@ func NewAPIExportClient(subscriptionID string, credential azcore.TokenCredential // - export - Query parameter required to export the API details. // - options - APIExportClientGetOptions contains the optional parameters for the APIExportClient.Get method. func (client *APIExportClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, formatParam ExportFormat, export ExportAPI, options *APIExportClientGetOptions) (APIExportClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, formatParam, export, options) if err != nil { return APIExportClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIExportClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIExportClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIExportClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -98,7 +99,7 @@ func (client *APIExportClient) getCreateRequest(ctx context.Context, resourceGro reqQP := req.Raw().URL.Query() reqQP.Set("format", string(formatParam)) reqQP.Set("export", string(export)) - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apiexport_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiexport_client_example_test.go index 0e0ce6f76c01..4924e660be77 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apiexport_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiexport_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi2dot0.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiExportInOpenApi2dot0.json func ExampleAPIExportClient_Get_apiManagementGetApiExportInOpenApi2Dot0() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -44,7 +44,7 @@ func ExampleAPIExportClient_Get_apiManagementGetApiExportInOpenApi2Dot0() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi3dot0.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiExportInOpenApi3dot0.json func ExampleAPIExportClient_Get_apiManagementGetApiExportInOpenApi3Dot0() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleAPIExportClient_Get_apiManagementGetApiExportInOpenApi3Dot0() { // ExportResultFormat: to.Ptr(armapimanagement.ExportResultFormatOpenAPI), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/aid9676"), // Value: &armapimanagement.APIExportResultValue{ - // Link: to.Ptr("https: //apimgmtstkjpszxxxxxxx.blob.core.windows.net/api-export/Swagger Petstore.yaml?sv=2015-07-08&sr=b&sig=qqtR1y5iTbz5P7USBduqB5vriIU4gmiGqe0lKVV8j9k%3D&se=2019-04-10T22:40:57Z&sp=r"), + // Link: to.Ptr("https: //apimgmtstkjpszxxxxxxx.blob.core.windows.net/api-export/Swagger Petstore.yaml?storage-sas-signature"), // }, // } } diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apiissue_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiissue_client.go index 030895e29b77..0fcf7e092609 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apiissue_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiissue_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type APIIssueClient struct { } // NewAPIIssueClient creates a new instance of APIIssueClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAPIIssueClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIIssueClient, error) { @@ -49,26 +47,29 @@ func NewAPIIssueClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates a new Issue for an API or updates an existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - issueID - Issue identifier. Must be unique in the current API Management service instance. // - parameters - Create parameters. // - options - APIIssueClientCreateOrUpdateOptions contains the optional parameters for the APIIssueClient.CreateOrUpdate method. func (client *APIIssueClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, parameters IssueContract, options *APIIssueClientCreateOrUpdateOptions) (APIIssueClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, parameters, options) if err != nil { return APIIssueClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIIssueClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return APIIssueClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return APIIssueClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -99,13 +100,16 @@ func (client *APIIssueClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -123,8 +127,8 @@ func (client *APIIssueClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Deletes the specified Issue from an API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - issueID - Issue identifier. Must be unique in the current API Management service instance. @@ -132,16 +136,18 @@ func (client *APIIssueClient) createOrUpdateHandleResponse(resp *http.Response) // it should be * for unconditional update. // - options - APIIssueClientDeleteOptions contains the optional parameters for the APIIssueClient.Delete method. func (client *APIIssueClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, ifMatch string, options *APIIssueClientDeleteOptions) (APIIssueClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, ifMatch, options) if err != nil { return APIIssueClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIIssueClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return APIIssueClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return APIIssueClientDeleteResponse{}, err } return APIIssueClientDeleteResponse{}, nil } @@ -174,7 +180,7 @@ func (client *APIIssueClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -184,25 +190,28 @@ func (client *APIIssueClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets the details of the Issue for an API specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - issueID - Issue identifier. Must be unique in the current API Management service instance. // - options - APIIssueClientGetOptions contains the optional parameters for the APIIssueClient.Get method. func (client *APIIssueClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, options *APIIssueClientGetOptions) (APIIssueClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, options) if err != nil { return APIIssueClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIIssueClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIIssueClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIIssueClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -236,7 +245,7 @@ func (client *APIIssueClient) getCreateRequest(ctx context.Context, resourceGrou if options != nil && options.ExpandCommentsAttachments != nil { reqQP.Set("expandCommentsAttachments", strconv.FormatBool(*options.ExpandCommentsAttachments)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,25 +265,28 @@ func (client *APIIssueClient) getHandleResponse(resp *http.Response) (APIIssueCl // GetEntityTag - Gets the entity state (Etag) version of the Issue for an API specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - issueID - Issue identifier. Must be unique in the current API Management service instance. // - options - APIIssueClientGetEntityTagOptions contains the optional parameters for the APIIssueClient.GetEntityTag method. func (client *APIIssueClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, options *APIIssueClientGetEntityTagOptions) (APIIssueClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, options) if err != nil { return APIIssueClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIIssueClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIIssueClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIIssueClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -305,7 +317,7 @@ func (client *APIIssueClient) getEntityTagCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,8 +335,8 @@ func (client *APIIssueClient) getEntityTagHandleResponse(resp *http.Response) (A // NewListByServicePager - Lists all issues associated with the specified API. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - options - APIIssueClientListByServiceOptions contains the optional parameters for the APIIssueClient.NewListByServicePager @@ -393,7 +405,7 @@ func (client *APIIssueClient) listByServiceCreateRequest(ctx context.Context, re if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -411,8 +423,8 @@ func (client *APIIssueClient) listByServiceHandleResponse(resp *http.Response) ( // Update - Updates an existing issue for an API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - issueID - Issue identifier. Must be unique in the current API Management service instance. @@ -421,18 +433,21 @@ func (client *APIIssueClient) listByServiceHandleResponse(resp *http.Response) ( // - parameters - Update parameters. // - options - APIIssueClientUpdateOptions contains the optional parameters for the APIIssueClient.Update method. func (client *APIIssueClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, ifMatch string, parameters IssueUpdateContract, options *APIIssueClientUpdateOptions) (APIIssueClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, ifMatch, parameters, options) if err != nil { return APIIssueClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIIssueClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIIssueClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIIssueClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -463,11 +478,14 @@ func (client *APIIssueClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apiissue_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiissue_client_example_test.go index e45b7b0787de..3964490a2fb7 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apiissue_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiissue_client_example_test.go @@ -17,10 +17,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiIssues.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApiIssues.json func ExampleAPIIssueClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleAPIIssueClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiIssue.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadApiIssue.json func ExampleAPIIssueClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -83,7 +83,7 @@ func ExampleAPIIssueClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiIssue.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiIssue.json func ExampleAPIIssueClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -116,7 +116,7 @@ func ExampleAPIIssueClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiIssue.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiIssue.json func ExampleAPIIssueClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -156,7 +156,7 @@ func ExampleAPIIssueClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiIssue.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateApiIssue.json func ExampleAPIIssueClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -193,7 +193,7 @@ func ExampleAPIIssueClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiIssue.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteApiIssue.json func ExampleAPIIssueClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apiissueattachment_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiissueattachment_client.go index 8f865ad9990e..a77fe0f7756e 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apiissueattachment_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiissueattachment_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type APIIssueAttachmentClient struct { } // NewAPIIssueAttachmentClient creates a new instance of APIIssueAttachmentClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAPIIssueAttachmentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIIssueAttachmentClient, error) { @@ -49,8 +47,8 @@ func NewAPIIssueAttachmentClient(subscriptionID string, credential azcore.TokenC // CreateOrUpdate - Creates a new Attachment for the Issue in an API or updates an existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - issueID - Issue identifier. Must be unique in the current API Management service instance. @@ -59,18 +57,21 @@ func NewAPIIssueAttachmentClient(subscriptionID string, credential azcore.TokenC // - options - APIIssueAttachmentClientCreateOrUpdateOptions contains the optional parameters for the APIIssueAttachmentClient.CreateOrUpdate // method. func (client *APIIssueAttachmentClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, attachmentID string, parameters IssueAttachmentContract, options *APIIssueAttachmentClientCreateOrUpdateOptions) (APIIssueAttachmentClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, attachmentID, parameters, options) if err != nil { return APIIssueAttachmentClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIIssueAttachmentClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return APIIssueAttachmentClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return APIIssueAttachmentClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -105,13 +106,16 @@ func (client *APIIssueAttachmentClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -129,8 +133,8 @@ func (client *APIIssueAttachmentClient) createOrUpdateHandleResponse(resp *http. // Delete - Deletes the specified comment from an Issue. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - issueID - Issue identifier. Must be unique in the current API Management service instance. @@ -140,16 +144,18 @@ func (client *APIIssueAttachmentClient) createOrUpdateHandleResponse(resp *http. // - options - APIIssueAttachmentClientDeleteOptions contains the optional parameters for the APIIssueAttachmentClient.Delete // method. func (client *APIIssueAttachmentClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, attachmentID string, ifMatch string, options *APIIssueAttachmentClientDeleteOptions) (APIIssueAttachmentClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, attachmentID, ifMatch, options) if err != nil { return APIIssueAttachmentClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIIssueAttachmentClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return APIIssueAttachmentClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return APIIssueAttachmentClientDeleteResponse{}, err } return APIIssueAttachmentClientDeleteResponse{}, nil } @@ -186,7 +192,7 @@ func (client *APIIssueAttachmentClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -196,26 +202,29 @@ func (client *APIIssueAttachmentClient) deleteCreateRequest(ctx context.Context, // Get - Gets the details of the issue Attachment for an API specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - issueID - Issue identifier. Must be unique in the current API Management service instance. // - attachmentID - Attachment identifier within an Issue. Must be unique in the current Issue. // - options - APIIssueAttachmentClientGetOptions contains the optional parameters for the APIIssueAttachmentClient.Get method. func (client *APIIssueAttachmentClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, attachmentID string, options *APIIssueAttachmentClientGetOptions) (APIIssueAttachmentClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, attachmentID, options) if err != nil { return APIIssueAttachmentClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIIssueAttachmentClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIIssueAttachmentClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIIssueAttachmentClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -250,7 +259,7 @@ func (client *APIIssueAttachmentClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,8 +279,8 @@ func (client *APIIssueAttachmentClient) getHandleResponse(resp *http.Response) ( // GetEntityTag - Gets the entity state (Etag) version of the issue Attachment for an API specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - issueID - Issue identifier. Must be unique in the current API Management service instance. @@ -279,18 +288,21 @@ func (client *APIIssueAttachmentClient) getHandleResponse(resp *http.Response) ( // - options - APIIssueAttachmentClientGetEntityTagOptions contains the optional parameters for the APIIssueAttachmentClient.GetEntityTag // method. func (client *APIIssueAttachmentClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, attachmentID string, options *APIIssueAttachmentClientGetEntityTagOptions) (APIIssueAttachmentClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, attachmentID, options) if err != nil { return APIIssueAttachmentClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIIssueAttachmentClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIIssueAttachmentClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIIssueAttachmentClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -325,7 +337,7 @@ func (client *APIIssueAttachmentClient) getEntityTagCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -343,8 +355,8 @@ func (client *APIIssueAttachmentClient) getEntityTagHandleResponse(resp *http.Re // NewListByServicePager - Lists all attachments for the Issue associated with the specified API. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - issueID - Issue identifier. Must be unique in the current API Management service instance. @@ -415,7 +427,7 @@ func (client *APIIssueAttachmentClient) listByServiceCreateRequest(ctx context.C if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apiissueattachment_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiissueattachment_client_example_test.go index 5dc86dcd712b..651183e25714 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apiissueattachment_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiissueattachment_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiIssueAttachments.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApiIssueAttachments.json func ExampleAPIIssueAttachmentClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -60,7 +60,7 @@ func ExampleAPIIssueAttachmentClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiIssueAttachment.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadApiIssueAttachment.json func ExampleAPIIssueAttachmentClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -77,7 +77,7 @@ func ExampleAPIIssueAttachmentClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiIssueAttachment.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiIssueAttachment.json func ExampleAPIIssueAttachmentClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -107,7 +107,7 @@ func ExampleAPIIssueAttachmentClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiIssueAttachment.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiIssueAttachment.json func ExampleAPIIssueAttachmentClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -143,7 +143,7 @@ func ExampleAPIIssueAttachmentClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiIssueAttachment.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteApiIssueAttachment.json func ExampleAPIIssueAttachmentClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apiissuecomment_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiissuecomment_client.go index 5f0bad8bc474..0d2f8ed25d84 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apiissuecomment_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiissuecomment_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type APIIssueCommentClient struct { } // NewAPIIssueCommentClient creates a new instance of APIIssueCommentClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAPIIssueCommentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIIssueCommentClient, error) { @@ -49,8 +47,8 @@ func NewAPIIssueCommentClient(subscriptionID string, credential azcore.TokenCred // CreateOrUpdate - Creates a new Comment for the Issue in an API or updates an existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - issueID - Issue identifier. Must be unique in the current API Management service instance. @@ -59,18 +57,21 @@ func NewAPIIssueCommentClient(subscriptionID string, credential azcore.TokenCred // - options - APIIssueCommentClientCreateOrUpdateOptions contains the optional parameters for the APIIssueCommentClient.CreateOrUpdate // method. func (client *APIIssueCommentClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, commentID string, parameters IssueCommentContract, options *APIIssueCommentClientCreateOrUpdateOptions) (APIIssueCommentClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, commentID, parameters, options) if err != nil { return APIIssueCommentClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIIssueCommentClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return APIIssueCommentClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return APIIssueCommentClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -105,13 +106,16 @@ func (client *APIIssueCommentClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -129,8 +133,8 @@ func (client *APIIssueCommentClient) createOrUpdateHandleResponse(resp *http.Res // Delete - Deletes the specified comment from an Issue. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - issueID - Issue identifier. Must be unique in the current API Management service instance. @@ -139,16 +143,18 @@ func (client *APIIssueCommentClient) createOrUpdateHandleResponse(resp *http.Res // it should be * for unconditional update. // - options - APIIssueCommentClientDeleteOptions contains the optional parameters for the APIIssueCommentClient.Delete method. func (client *APIIssueCommentClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, commentID string, ifMatch string, options *APIIssueCommentClientDeleteOptions) (APIIssueCommentClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, commentID, ifMatch, options) if err != nil { return APIIssueCommentClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIIssueCommentClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return APIIssueCommentClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return APIIssueCommentClientDeleteResponse{}, err } return APIIssueCommentClientDeleteResponse{}, nil } @@ -185,7 +191,7 @@ func (client *APIIssueCommentClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -195,26 +201,29 @@ func (client *APIIssueCommentClient) deleteCreateRequest(ctx context.Context, re // Get - Gets the details of the issue Comment for an API specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - issueID - Issue identifier. Must be unique in the current API Management service instance. // - commentID - Comment identifier within an Issue. Must be unique in the current Issue. // - options - APIIssueCommentClientGetOptions contains the optional parameters for the APIIssueCommentClient.Get method. func (client *APIIssueCommentClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, commentID string, options *APIIssueCommentClientGetOptions) (APIIssueCommentClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, commentID, options) if err != nil { return APIIssueCommentClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIIssueCommentClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIIssueCommentClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIIssueCommentClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -249,7 +258,7 @@ func (client *APIIssueCommentClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,8 +278,8 @@ func (client *APIIssueCommentClient) getHandleResponse(resp *http.Response) (API // GetEntityTag - Gets the entity state (Etag) version of the issue Comment for an API specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - issueID - Issue identifier. Must be unique in the current API Management service instance. @@ -278,18 +287,21 @@ func (client *APIIssueCommentClient) getHandleResponse(resp *http.Response) (API // - options - APIIssueCommentClientGetEntityTagOptions contains the optional parameters for the APIIssueCommentClient.GetEntityTag // method. func (client *APIIssueCommentClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, commentID string, options *APIIssueCommentClientGetEntityTagOptions) (APIIssueCommentClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, commentID, options) if err != nil { return APIIssueCommentClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIIssueCommentClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIIssueCommentClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIIssueCommentClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -324,7 +336,7 @@ func (client *APIIssueCommentClient) getEntityTagCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -342,8 +354,8 @@ func (client *APIIssueCommentClient) getEntityTagHandleResponse(resp *http.Respo // NewListByServicePager - Lists all comments for the Issue associated with the specified API. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - issueID - Issue identifier. Must be unique in the current API Management service instance. @@ -414,7 +426,7 @@ func (client *APIIssueCommentClient) listByServiceCreateRequest(ctx context.Cont if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apiissuecomment_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiissuecomment_client_example_test.go index 0058bb14b324..ff7e37ce9d8e 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apiissuecomment_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiissuecomment_client_example_test.go @@ -17,10 +17,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiIssueComments.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApiIssueComments.json func ExampleAPIIssueCommentClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -62,7 +62,7 @@ func ExampleAPIIssueCommentClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiIssueComment.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadApiIssueComment.json func ExampleAPIIssueCommentClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -79,7 +79,7 @@ func ExampleAPIIssueCommentClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiIssueComment.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiIssueComment.json func ExampleAPIIssueCommentClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -109,7 +109,7 @@ func ExampleAPIIssueCommentClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiIssueComment.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiIssueComment.json func ExampleAPIIssueCommentClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -145,7 +145,7 @@ func ExampleAPIIssueCommentClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiIssueComment.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteApiIssueComment.json func ExampleAPIIssueCommentClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apioperation_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apioperation_client.go index f5558cd5dd1f..0b48449ae7cd 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apioperation_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apioperation_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type APIOperationClient struct { } // NewAPIOperationClient creates a new instance of APIOperationClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAPIOperationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIOperationClient, error) { @@ -49,8 +47,8 @@ func NewAPIOperationClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Creates a new operation in the API or updates an existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -59,18 +57,21 @@ func NewAPIOperationClient(subscriptionID string, credential azcore.TokenCredent // - options - APIOperationClientCreateOrUpdateOptions contains the optional parameters for the APIOperationClient.CreateOrUpdate // method. func (client *APIOperationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, parameters OperationContract, options *APIOperationClientCreateOrUpdateOptions) (APIOperationClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, parameters, options) if err != nil { return APIOperationClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIOperationClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return APIOperationClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return APIOperationClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -101,13 +102,16 @@ func (client *APIOperationClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -125,8 +129,8 @@ func (client *APIOperationClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Deletes the specified operation in the API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -135,16 +139,18 @@ func (client *APIOperationClient) createOrUpdateHandleResponse(resp *http.Respon // it should be * for unconditional update. // - options - APIOperationClientDeleteOptions contains the optional parameters for the APIOperationClient.Delete method. func (client *APIOperationClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, ifMatch string, options *APIOperationClientDeleteOptions) (APIOperationClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, ifMatch, options) if err != nil { return APIOperationClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIOperationClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return APIOperationClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return APIOperationClientDeleteResponse{}, err } return APIOperationClientDeleteResponse{}, nil } @@ -177,7 +183,7 @@ func (client *APIOperationClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -187,26 +193,29 @@ func (client *APIOperationClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets the details of the API Operation specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. // - operationID - Operation identifier within an API. Must be unique in the current API Management service instance. // - options - APIOperationClientGetOptions contains the optional parameters for the APIOperationClient.Get method. func (client *APIOperationClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, options *APIOperationClientGetOptions) (APIOperationClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, options) if err != nil { return APIOperationClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIOperationClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIOperationClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIOperationClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -237,7 +246,7 @@ func (client *APIOperationClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,8 +266,8 @@ func (client *APIOperationClient) getHandleResponse(resp *http.Response) (APIOpe // GetEntityTag - Gets the entity state (Etag) version of the API operation specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -266,18 +275,21 @@ func (client *APIOperationClient) getHandleResponse(resp *http.Response) (APIOpe // - options - APIOperationClientGetEntityTagOptions contains the optional parameters for the APIOperationClient.GetEntityTag // method. func (client *APIOperationClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, options *APIOperationClientGetEntityTagOptions) (APIOperationClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, options) if err != nil { return APIOperationClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIOperationClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIOperationClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIOperationClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -308,7 +320,7 @@ func (client *APIOperationClient) getEntityTagCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,8 +338,8 @@ func (client *APIOperationClient) getEntityTagHandleResponse(resp *http.Response // NewListByAPIPager - Lists a collection of the operations for the specified API. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -397,7 +409,7 @@ func (client *APIOperationClient) listByAPICreateRequest(ctx context.Context, re if options != nil && options.Tags != nil { reqQP.Set("tags", *options.Tags) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -415,8 +427,8 @@ func (client *APIOperationClient) listByAPIHandleResponse(resp *http.Response) ( // Update - Updates the details of the operation in the API specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -426,18 +438,21 @@ func (client *APIOperationClient) listByAPIHandleResponse(resp *http.Response) ( // - parameters - API Operation Update parameters. // - options - APIOperationClientUpdateOptions contains the optional parameters for the APIOperationClient.Update method. func (client *APIOperationClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, ifMatch string, parameters OperationUpdateContract, options *APIOperationClientUpdateOptions) (APIOperationClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, ifMatch, parameters, options) if err != nil { return APIOperationClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIOperationClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIOperationClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIOperationClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -468,11 +483,14 @@ func (client *APIOperationClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apioperation_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apioperation_client_example_test.go index 6dbfd504a85f..768b215065a9 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apioperation_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apioperation_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiOperations.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApiOperations.json func ExampleAPIOperationClient_NewListByAPIPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -101,7 +101,7 @@ func ExampleAPIOperationClient_NewListByAPIPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiOperation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadApiOperation.json func ExampleAPIOperationClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -118,7 +118,7 @@ func ExampleAPIOperationClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiOperation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiOperation.json func ExampleAPIOperationClient_Get_apiManagementGetApiOperation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -176,7 +176,7 @@ func ExampleAPIOperationClient_Get_apiManagementGetApiOperation() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiOperationPetStore.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiOperationPetStore.json func ExampleAPIOperationClient_Get_apiManagementGetApiOperationPetStore() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -276,7 +276,7 @@ func ExampleAPIOperationClient_Get_apiManagementGetApiOperationPetStore() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiOperation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiOperation.json func ExampleAPIOperationClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -368,7 +368,7 @@ func ExampleAPIOperationClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiOperation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateApiOperation.json func ExampleAPIOperationClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -458,7 +458,7 @@ func ExampleAPIOperationClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiOperation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteApiOperation.json func ExampleAPIOperationClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apioperationpolicy_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apioperationpolicy_client.go index bb0e0632fec0..30786fc8bf1b 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apioperationpolicy_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apioperationpolicy_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type APIOperationPolicyClient struct { } // NewAPIOperationPolicyClient creates a new instance of APIOperationPolicyClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAPIOperationPolicyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIOperationPolicyClient, error) { @@ -48,8 +46,8 @@ func NewAPIOperationPolicyClient(subscriptionID string, credential azcore.TokenC // CreateOrUpdate - Creates or updates policy configuration for the API Operation level. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -59,18 +57,21 @@ func NewAPIOperationPolicyClient(subscriptionID string, credential azcore.TokenC // - options - APIOperationPolicyClientCreateOrUpdateOptions contains the optional parameters for the APIOperationPolicyClient.CreateOrUpdate // method. func (client *APIOperationPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, policyID PolicyIDName, parameters PolicyContract, options *APIOperationPolicyClientCreateOrUpdateOptions) (APIOperationPolicyClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, policyID, parameters, options) if err != nil { return APIOperationPolicyClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIOperationPolicyClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return APIOperationPolicyClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return APIOperationPolicyClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -105,13 +106,16 @@ func (client *APIOperationPolicyClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -129,8 +133,8 @@ func (client *APIOperationPolicyClient) createOrUpdateHandleResponse(resp *http. // Delete - Deletes the policy configuration at the Api Operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -141,16 +145,18 @@ func (client *APIOperationPolicyClient) createOrUpdateHandleResponse(resp *http. // - options - APIOperationPolicyClientDeleteOptions contains the optional parameters for the APIOperationPolicyClient.Delete // method. func (client *APIOperationPolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, policyID PolicyIDName, ifMatch string, options *APIOperationPolicyClientDeleteOptions) (APIOperationPolicyClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, policyID, ifMatch, options) if err != nil { return APIOperationPolicyClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIOperationPolicyClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return APIOperationPolicyClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return APIOperationPolicyClientDeleteResponse{}, err } return APIOperationPolicyClientDeleteResponse{}, nil } @@ -187,7 +193,7 @@ func (client *APIOperationPolicyClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -197,8 +203,8 @@ func (client *APIOperationPolicyClient) deleteCreateRequest(ctx context.Context, // Get - Get the policy configuration at the API Operation level. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -206,18 +212,21 @@ func (client *APIOperationPolicyClient) deleteCreateRequest(ctx context.Context, // - policyID - The identifier of the Policy. // - options - APIOperationPolicyClientGetOptions contains the optional parameters for the APIOperationPolicyClient.Get method. func (client *APIOperationPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, policyID PolicyIDName, options *APIOperationPolicyClientGetOptions) (APIOperationPolicyClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, policyID, options) if err != nil { return APIOperationPolicyClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIOperationPolicyClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIOperationPolicyClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIOperationPolicyClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -255,7 +264,7 @@ func (client *APIOperationPolicyClient) getCreateRequest(ctx context.Context, re if options != nil && options.Format != nil { reqQP.Set("format", string(*options.Format)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -275,8 +284,8 @@ func (client *APIOperationPolicyClient) getHandleResponse(resp *http.Response) ( // GetEntityTag - Gets the entity state (Etag) version of the API operation policy specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -285,18 +294,21 @@ func (client *APIOperationPolicyClient) getHandleResponse(resp *http.Response) ( // - options - APIOperationPolicyClientGetEntityTagOptions contains the optional parameters for the APIOperationPolicyClient.GetEntityTag // method. func (client *APIOperationPolicyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, policyID PolicyIDName, options *APIOperationPolicyClientGetEntityTagOptions) (APIOperationPolicyClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, policyID, options) if err != nil { return APIOperationPolicyClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIOperationPolicyClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIOperationPolicyClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIOperationPolicyClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -331,7 +343,7 @@ func (client *APIOperationPolicyClient) getEntityTagCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -350,8 +362,8 @@ func (client *APIOperationPolicyClient) getEntityTagHandleResponse(resp *http.Re // ListByOperation - Get the list of policy configuration at the API Operation level. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -359,18 +371,21 @@ func (client *APIOperationPolicyClient) getEntityTagHandleResponse(resp *http.Re // - options - APIOperationPolicyClientListByOperationOptions contains the optional parameters for the APIOperationPolicyClient.ListByOperation // method. func (client *APIOperationPolicyClient) ListByOperation(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, options *APIOperationPolicyClientListByOperationOptions) (APIOperationPolicyClientListByOperationResponse, error) { + var err error req, err := client.listByOperationCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, options) if err != nil { return APIOperationPolicyClientListByOperationResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIOperationPolicyClientListByOperationResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIOperationPolicyClientListByOperationResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIOperationPolicyClientListByOperationResponse{}, err } - return client.listByOperationHandleResponse(resp) + resp, err := client.listByOperationHandleResponse(httpResp) + return resp, err } // listByOperationCreateRequest creates the ListByOperation request. @@ -401,7 +416,7 @@ func (client *APIOperationPolicyClient) listByOperationCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apioperationpolicy_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apioperationpolicy_client_example_test.go index 2d09988fc1e3..fd7519fc67ca 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apioperationpolicy_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apioperationpolicy_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiOperationPolicies.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApiOperationPolicies.json func ExampleAPIOperationPolicyClient_ListByOperation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -50,7 +50,7 @@ func ExampleAPIOperationPolicyClient_ListByOperation() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiOperationPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadApiOperationPolicy.json func ExampleAPIOperationPolicyClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -67,7 +67,7 @@ func ExampleAPIOperationPolicyClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiOperationPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiOperationPolicy.json func ExampleAPIOperationPolicyClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -95,7 +95,7 @@ func ExampleAPIOperationPolicyClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiOperationPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiOperationPolicy.json func ExampleAPIOperationPolicyClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -128,7 +128,7 @@ func ExampleAPIOperationPolicyClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiOperationPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteApiOperationPolicy.json func ExampleAPIOperationPolicyClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apipolicy_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apipolicy_client.go index 888960d0749c..9ac0877f4907 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apipolicy_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apipolicy_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type APIPolicyClient struct { } // NewAPIPolicyClient creates a new instance of APIPolicyClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAPIPolicyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIPolicyClient, error) { @@ -48,8 +46,8 @@ func NewAPIPolicyClient(subscriptionID string, credential azcore.TokenCredential // CreateOrUpdate - Creates or updates policy configuration for the API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -58,18 +56,21 @@ func NewAPIPolicyClient(subscriptionID string, credential azcore.TokenCredential // - options - APIPolicyClientCreateOrUpdateOptions contains the optional parameters for the APIPolicyClient.CreateOrUpdate // method. func (client *APIPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, policyID PolicyIDName, parameters PolicyContract, options *APIPolicyClientCreateOrUpdateOptions) (APIPolicyClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, policyID, parameters, options) if err != nil { return APIPolicyClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIPolicyClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return APIPolicyClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return APIPolicyClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -100,13 +101,16 @@ func (client *APIPolicyClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -124,8 +128,8 @@ func (client *APIPolicyClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Deletes the policy configuration at the Api. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -134,16 +138,18 @@ func (client *APIPolicyClient) createOrUpdateHandleResponse(resp *http.Response) // it should be * for unconditional update. // - options - APIPolicyClientDeleteOptions contains the optional parameters for the APIPolicyClient.Delete method. func (client *APIPolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, policyID PolicyIDName, ifMatch string, options *APIPolicyClientDeleteOptions) (APIPolicyClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, policyID, ifMatch, options) if err != nil { return APIPolicyClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIPolicyClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return APIPolicyClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return APIPolicyClientDeleteResponse{}, err } return APIPolicyClientDeleteResponse{}, nil } @@ -176,7 +182,7 @@ func (client *APIPolicyClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -186,26 +192,29 @@ func (client *APIPolicyClient) deleteCreateRequest(ctx context.Context, resource // Get - Get the policy configuration at the API level. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. // - policyID - The identifier of the Policy. // - options - APIPolicyClientGetOptions contains the optional parameters for the APIPolicyClient.Get method. func (client *APIPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, policyID PolicyIDName, options *APIPolicyClientGetOptions) (APIPolicyClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, policyID, options) if err != nil { return APIPolicyClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIPolicyClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusOK) { - return APIPolicyClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIPolicyClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -239,7 +248,7 @@ func (client *APIPolicyClient) getCreateRequest(ctx context.Context, resourceGro if options != nil && options.Format != nil { reqQP.Set("format", string(*options.Format)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json, application/vnd.ms-azure-apim.policy+xml, application/vnd.ms-azure-apim.policy.raw+xml"} return req, nil @@ -259,26 +268,29 @@ func (client *APIPolicyClient) getHandleResponse(resp *http.Response) (APIPolicy // GetEntityTag - Gets the entity state (Etag) version of the API policy specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. // - policyID - The identifier of the Policy. // - options - APIPolicyClientGetEntityTagOptions contains the optional parameters for the APIPolicyClient.GetEntityTag method. func (client *APIPolicyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, policyID PolicyIDName, options *APIPolicyClientGetEntityTagOptions) (APIPolicyClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, policyID, options) if err != nil { return APIPolicyClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIPolicyClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIPolicyClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIPolicyClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -309,7 +321,7 @@ func (client *APIPolicyClient) getEntityTagCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,25 +340,28 @@ func (client *APIPolicyClient) getEntityTagHandleResponse(resp *http.Response) ( // ListByAPI - Get the policy configuration at the API level. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. // - options - APIPolicyClientListByAPIOptions contains the optional parameters for the APIPolicyClient.ListByAPI method. func (client *APIPolicyClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIPolicyClientListByAPIOptions) (APIPolicyClientListByAPIResponse, error) { + var err error req, err := client.listByAPICreateRequest(ctx, resourceGroupName, serviceName, apiID, options) if err != nil { return APIPolicyClientListByAPIResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIPolicyClientListByAPIResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIPolicyClientListByAPIResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIPolicyClientListByAPIResponse{}, err } - return client.listByAPIHandleResponse(resp) + resp, err := client.listByAPIHandleResponse(httpResp) + return resp, err } // listByAPICreateRequest creates the ListByAPI request. @@ -373,7 +388,7 @@ func (client *APIPolicyClient) listByAPICreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apipolicy_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apipolicy_client_example_test.go index 4f9ef6cd584e..4fb8cbd527b9 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apipolicy_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apipolicy_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiPolicies.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApiPolicies.json func ExampleAPIPolicyClient_ListByAPI() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -50,7 +50,7 @@ func ExampleAPIPolicyClient_ListByAPI() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadApiPolicy.json func ExampleAPIPolicyClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -67,7 +67,7 @@ func ExampleAPIPolicyClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiPolicy.json func ExampleAPIPolicyClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -95,7 +95,7 @@ func ExampleAPIPolicyClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiPolicy.json func ExampleAPIPolicyClient_CreateOrUpdate_apiManagementCreateApiPolicy() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -128,7 +128,7 @@ func ExampleAPIPolicyClient_CreateOrUpdate_apiManagementCreateApiPolicy() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiPolicyNonXmlEncoded.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiPolicyNonXmlEncoded.json func ExampleAPIPolicyClient_CreateOrUpdate_apiManagementCreateApiPolicyNonXmlEncoded() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -161,7 +161,7 @@ func ExampleAPIPolicyClient_CreateOrUpdate_apiManagementCreateApiPolicyNonXmlEnc // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteApiPolicy.json func ExampleAPIPolicyClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apiproduct_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiproduct_client.go index d4803af90cbf..74af595805d2 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apiproduct_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiproduct_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type APIProductClient struct { } // NewAPIProductClient creates a new instance of APIProductClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAPIProductClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIProductClient, error) { @@ -48,8 +46,8 @@ func NewAPIProductClient(subscriptionID string, credential azcore.TokenCredentia // NewListByApisPager - Lists all Products, which the API is part of. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - options - APIProductClientListByApisOptions contains the optional parameters for the APIProductClient.NewListByApisPager @@ -115,7 +113,7 @@ func (client *APIProductClient) listByApisCreateRequest(ctx context.Context, res if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apiproduct_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiproduct_client_example_test.go index 0e0d99442a66..cbe00708a38c 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apiproduct_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiproduct_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiProducts.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApiProducts.json func ExampleAPIProductClient_NewListByApisPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apirelease_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apirelease_client.go index 4883f1b10498..81bba6ff12f6 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apirelease_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apirelease_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type APIReleaseClient struct { } // NewAPIReleaseClient creates a new instance of APIReleaseClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAPIReleaseClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIReleaseClient, error) { @@ -49,8 +47,8 @@ func NewAPIReleaseClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Creates a new Release for the API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - releaseID - Release identifier within an API. Must be unique in the current API Management service instance. @@ -58,18 +56,21 @@ func NewAPIReleaseClient(subscriptionID string, credential azcore.TokenCredentia // - options - APIReleaseClientCreateOrUpdateOptions contains the optional parameters for the APIReleaseClient.CreateOrUpdate // method. func (client *APIReleaseClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, releaseID string, parameters APIReleaseContract, options *APIReleaseClientCreateOrUpdateOptions) (APIReleaseClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, releaseID, parameters, options) if err != nil { return APIReleaseClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIReleaseClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return APIReleaseClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return APIReleaseClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -100,13 +101,16 @@ func (client *APIReleaseClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -124,8 +128,8 @@ func (client *APIReleaseClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes the specified release in the API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - releaseID - Release identifier within an API. Must be unique in the current API Management service instance. @@ -133,16 +137,18 @@ func (client *APIReleaseClient) createOrUpdateHandleResponse(resp *http.Response // it should be * for unconditional update. // - options - APIReleaseClientDeleteOptions contains the optional parameters for the APIReleaseClient.Delete method. func (client *APIReleaseClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, releaseID string, ifMatch string, options *APIReleaseClientDeleteOptions) (APIReleaseClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, releaseID, ifMatch, options) if err != nil { return APIReleaseClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIReleaseClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return APIReleaseClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return APIReleaseClientDeleteResponse{}, err } return APIReleaseClientDeleteResponse{}, nil } @@ -175,7 +181,7 @@ func (client *APIReleaseClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -185,25 +191,28 @@ func (client *APIReleaseClient) deleteCreateRequest(ctx context.Context, resourc // Get - Returns the details of an API release. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - releaseID - Release identifier within an API. Must be unique in the current API Management service instance. // - options - APIReleaseClientGetOptions contains the optional parameters for the APIReleaseClient.Get method. func (client *APIReleaseClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, releaseID string, options *APIReleaseClientGetOptions) (APIReleaseClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, releaseID, options) if err != nil { return APIReleaseClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIReleaseClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIReleaseClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIReleaseClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -234,7 +243,7 @@ func (client *APIReleaseClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,25 +263,28 @@ func (client *APIReleaseClient) getHandleResponse(resp *http.Response) (APIRelea // GetEntityTag - Returns the etag of an API release. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - releaseID - Release identifier within an API. Must be unique in the current API Management service instance. // - options - APIReleaseClientGetEntityTagOptions contains the optional parameters for the APIReleaseClient.GetEntityTag method. func (client *APIReleaseClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, releaseID string, options *APIReleaseClientGetEntityTagOptions) (APIReleaseClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, releaseID, options) if err != nil { return APIReleaseClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIReleaseClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIReleaseClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIReleaseClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -303,7 +315,7 @@ func (client *APIReleaseClient) getEntityTagCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,8 +335,8 @@ func (client *APIReleaseClient) getEntityTagHandleResponse(resp *http.Response) // are also used to rollback to previous revisions. Results will be paged and can be constrained by // the $top and $skip parameters. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - options - APIReleaseClientListByServiceOptions contains the optional parameters for the APIReleaseClient.NewListByServicePager @@ -390,7 +402,7 @@ func (client *APIReleaseClient) listByServiceCreateRequest(ctx context.Context, if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -408,8 +420,8 @@ func (client *APIReleaseClient) listByServiceHandleResponse(resp *http.Response) // Update - Updates the details of the release of the API specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - releaseID - Release identifier within an API. Must be unique in the current API Management service instance. @@ -418,18 +430,21 @@ func (client *APIReleaseClient) listByServiceHandleResponse(resp *http.Response) // - parameters - API Release Update parameters. // - options - APIReleaseClientUpdateOptions contains the optional parameters for the APIReleaseClient.Update method. func (client *APIReleaseClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, releaseID string, ifMatch string, parameters APIReleaseContract, options *APIReleaseClientUpdateOptions) (APIReleaseClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, apiID, releaseID, ifMatch, parameters, options) if err != nil { return APIReleaseClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIReleaseClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIReleaseClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIReleaseClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -460,11 +475,14 @@ func (client *APIReleaseClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apirelease_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apirelease_client_example_test.go index f0cac561f217..1778bca054e1 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apirelease_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apirelease_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiReleases.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApiReleases.json func ExampleAPIReleaseClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -60,7 +60,7 @@ func ExampleAPIReleaseClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiRelease.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadApiRelease.json func ExampleAPIReleaseClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -77,7 +77,7 @@ func ExampleAPIReleaseClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiRelease.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiRelease.json func ExampleAPIReleaseClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -108,7 +108,7 @@ func ExampleAPIReleaseClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiRelease.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiRelease.json func ExampleAPIReleaseClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -144,7 +144,7 @@ func ExampleAPIReleaseClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiRelease.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateApiRelease.json func ExampleAPIReleaseClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -180,7 +180,7 @@ func ExampleAPIReleaseClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiRelease.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteApiRelease.json func ExampleAPIReleaseClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apirevision_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apirevision_client.go index bf57ea25d919..9a596cbb4955 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apirevision_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apirevision_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type APIRevisionClient struct { } // NewAPIRevisionClient creates a new instance of APIRevisionClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAPIRevisionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIRevisionClient, error) { @@ -48,8 +46,8 @@ func NewAPIRevisionClient(subscriptionID string, credential azcore.TokenCredenti // NewListByServicePager - Lists all revisions of an API. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API identifier. Must be unique in the current API Management service instance. // - options - APIRevisionClientListByServiceOptions contains the optional parameters for the APIRevisionClient.NewListByServicePager @@ -115,7 +113,7 @@ func (client *APIRevisionClient) listByServiceCreateRequest(ctx context.Context, if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apirevision_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apirevision_client_example_test.go index a8f73faa283a..7f4a0b2e9d03 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apirevision_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apirevision_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiRevisions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApiRevisions.json func ExampleAPIRevisionClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apischema_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apischema_client.go index f6c887cce3b5..273bee2b644d 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apischema_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apischema_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type APISchemaClient struct { } // NewAPISchemaClient creates a new instance of APISchemaClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAPISchemaClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APISchemaClient, error) { @@ -49,8 +47,8 @@ func NewAPISchemaClient(subscriptionID string, credential azcore.TokenCredential // BeginCreateOrUpdate - Creates or updates schema configuration for the API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -64,9 +62,10 @@ func (client *APISchemaClient) BeginCreateOrUpdate(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[APISchemaClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[APISchemaClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[APISchemaClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -75,20 +74,22 @@ func (client *APISchemaClient) BeginCreateOrUpdate(ctx context.Context, resource // CreateOrUpdate - Creates or updates schema configuration for the API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *APISchemaClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, schemaID string, parameters SchemaContract, options *APISchemaClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, schemaID, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -119,20 +120,23 @@ func (client *APISchemaClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Delete - Deletes the schema configuration at the Api. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -141,16 +145,18 @@ func (client *APISchemaClient) createOrUpdateCreateRequest(ctx context.Context, // it should be * for unconditional update. // - options - APISchemaClientDeleteOptions contains the optional parameters for the APISchemaClient.Delete method. func (client *APISchemaClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, schemaID string, ifMatch string, options *APISchemaClientDeleteOptions) (APISchemaClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, schemaID, ifMatch, options) if err != nil { return APISchemaClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APISchemaClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return APISchemaClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return APISchemaClientDeleteResponse{}, err } return APISchemaClientDeleteResponse{}, nil } @@ -186,7 +192,7 @@ func (client *APISchemaClient) deleteCreateRequest(ctx context.Context, resource if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -196,26 +202,29 @@ func (client *APISchemaClient) deleteCreateRequest(ctx context.Context, resource // Get - Get the schema configuration at the API level. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. // - schemaID - Schema id identifier. Must be unique in the current API Management service instance. // - options - APISchemaClientGetOptions contains the optional parameters for the APISchemaClient.Get method. func (client *APISchemaClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, schemaID string, options *APISchemaClientGetOptions) (APISchemaClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, schemaID, options) if err != nil { return APISchemaClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APISchemaClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APISchemaClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APISchemaClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -246,7 +255,7 @@ func (client *APISchemaClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -266,26 +275,29 @@ func (client *APISchemaClient) getHandleResponse(resp *http.Response) (APISchema // GetEntityTag - Gets the entity state (Etag) version of the schema specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. // - schemaID - Schema id identifier. Must be unique in the current API Management service instance. // - options - APISchemaClientGetEntityTagOptions contains the optional parameters for the APISchemaClient.GetEntityTag method. func (client *APISchemaClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, schemaID string, options *APISchemaClientGetEntityTagOptions) (APISchemaClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, schemaID, options) if err != nil { return APISchemaClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APISchemaClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APISchemaClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APISchemaClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -316,7 +328,7 @@ func (client *APISchemaClient) getEntityTagCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -334,8 +346,8 @@ func (client *APISchemaClient) getEntityTagHandleResponse(resp *http.Response) ( // NewListByAPIPager - Get the schema configuration at the API level. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -401,7 +413,7 @@ func (client *APISchemaClient) listByAPICreateRequest(ctx context.Context, resou if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apischema_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apischema_client_example_test.go index 58dff8d617da..01ab61e314c3 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apischema_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apischema_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiSchemas.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApiSchemas.json func ExampleAPISchemaClient_NewListByAPIPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -51,14 +51,17 @@ func ExampleAPISchemaClient_NewListByAPIPager() { // Type: to.Ptr("Microsoft.ApiManagement/service/apis/schemas"), // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/59d5b28d1f7fab116c282650/schemas/59d5b28e1f7fab116402044e"), // Properties: &armapimanagement.SchemaContractProperties{ - // ContentType: to.Ptr("application/vnd.ms-azure-apim.swagger.definitions+json"), + // ContentType: to.Ptr("application/vnd.ms-azure-apim.xsd+xml"), + // Document: &armapimanagement.SchemaDocumentProperties{ + // Value: to.Ptr("\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n"), + // }, // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiSchema.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadApiSchema.json func ExampleAPISchemaClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -75,7 +78,7 @@ func ExampleAPISchemaClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiSchema.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiSchema.json func ExampleAPISchemaClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -106,7 +109,7 @@ func ExampleAPISchemaClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiSchema.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiSchema.json func ExampleAPISchemaClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -148,7 +151,7 @@ func ExampleAPISchemaClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiSchema.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteApiSchema.json func ExampleAPISchemaClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apitagdescription_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apitagdescription_client.go index 862770e2d54c..0b48a7b58faf 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apitagdescription_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apitagdescription_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type APITagDescriptionClient struct { } // NewAPITagDescriptionClient creates a new instance of APITagDescriptionClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAPITagDescriptionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APITagDescriptionClient, error) { @@ -49,8 +47,8 @@ func NewAPITagDescriptionClient(subscriptionID string, credential azcore.TokenCr // CreateOrUpdate - Create/Update tag description in scope of the Api. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -60,18 +58,21 @@ func NewAPITagDescriptionClient(subscriptionID string, credential azcore.TokenCr // - options - APITagDescriptionClientCreateOrUpdateOptions contains the optional parameters for the APITagDescriptionClient.CreateOrUpdate // method. func (client *APITagDescriptionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagDescriptionID string, parameters TagDescriptionCreateParameters, options *APITagDescriptionClientCreateOrUpdateOptions) (APITagDescriptionClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, tagDescriptionID, parameters, options) if err != nil { return APITagDescriptionClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APITagDescriptionClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return APITagDescriptionClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return APITagDescriptionClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -102,13 +103,16 @@ func (client *APITagDescriptionClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -126,8 +130,8 @@ func (client *APITagDescriptionClient) createOrUpdateHandleResponse(resp *http.R // Delete - Delete tag description for the Api. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -138,16 +142,18 @@ func (client *APITagDescriptionClient) createOrUpdateHandleResponse(resp *http.R // - options - APITagDescriptionClientDeleteOptions contains the optional parameters for the APITagDescriptionClient.Delete // method. func (client *APITagDescriptionClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagDescriptionID string, ifMatch string, options *APITagDescriptionClientDeleteOptions) (APITagDescriptionClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, tagDescriptionID, ifMatch, options) if err != nil { return APITagDescriptionClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APITagDescriptionClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return APITagDescriptionClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return APITagDescriptionClientDeleteResponse{}, err } return APITagDescriptionClientDeleteResponse{}, nil } @@ -180,7 +186,7 @@ func (client *APITagDescriptionClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -190,8 +196,8 @@ func (client *APITagDescriptionClient) deleteCreateRequest(ctx context.Context, // Get - Get Tag description in scope of API // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -199,18 +205,21 @@ func (client *APITagDescriptionClient) deleteCreateRequest(ctx context.Context, // and Tag names. // - options - APITagDescriptionClientGetOptions contains the optional parameters for the APITagDescriptionClient.Get method. func (client *APITagDescriptionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagDescriptionID string, options *APITagDescriptionClientGetOptions) (APITagDescriptionClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, tagDescriptionID, options) if err != nil { return APITagDescriptionClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APITagDescriptionClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APITagDescriptionClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APITagDescriptionClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -241,7 +250,7 @@ func (client *APITagDescriptionClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -261,8 +270,8 @@ func (client *APITagDescriptionClient) getHandleResponse(resp *http.Response) (A // GetEntityTag - Gets the entity state version of the tag specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -271,18 +280,21 @@ func (client *APITagDescriptionClient) getHandleResponse(resp *http.Response) (A // - options - APITagDescriptionClientGetEntityTagOptions contains the optional parameters for the APITagDescriptionClient.GetEntityTag // method. func (client *APITagDescriptionClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagDescriptionID string, options *APITagDescriptionClientGetEntityTagOptions) (APITagDescriptionClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, tagDescriptionID, options) if err != nil { return APITagDescriptionClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APITagDescriptionClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APITagDescriptionClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APITagDescriptionClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -313,7 +325,7 @@ func (client *APITagDescriptionClient) getEntityTagCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -332,8 +344,8 @@ func (client *APITagDescriptionClient) getEntityTagHandleResponse(resp *http.Res // NewListByServicePager - Lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined // on API level but tag may be assigned to the Operations // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -400,7 +412,7 @@ func (client *APITagDescriptionClient) listByServiceCreateRequest(ctx context.Co if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apitagdescription_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apitagdescription_client_example_test.go index f3f8bb325bd9..d006d8b2560a 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apitagdescription_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apitagdescription_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiTagDescriptions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApiTagDescriptions.json func ExampleAPITagDescriptionClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -61,7 +61,7 @@ func ExampleAPITagDescriptionClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiTagDescription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadApiTagDescription.json func ExampleAPITagDescriptionClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -78,7 +78,7 @@ func ExampleAPITagDescriptionClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiTagDescription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiTagDescription.json func ExampleAPITagDescriptionClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -109,7 +109,7 @@ func ExampleAPITagDescriptionClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiTagDescription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiTagDescription.json func ExampleAPITagDescriptionClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -147,7 +147,7 @@ func ExampleAPITagDescriptionClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiTagDescription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteApiTagDescription.json func ExampleAPITagDescriptionClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apiversionset_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiversionset_client.go index a13705aa2047..1cadc45dbab5 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apiversionset_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiversionset_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type APIVersionSetClient struct { } // NewAPIVersionSetClient creates a new instance of APIVersionSetClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAPIVersionSetClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIVersionSetClient, error) { @@ -49,26 +47,29 @@ func NewAPIVersionSetClient(subscriptionID string, credential azcore.TokenCreden // CreateOrUpdate - Creates or Updates a Api Version Set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance. // - parameters - Create or update parameters. // - options - APIVersionSetClientCreateOrUpdateOptions contains the optional parameters for the APIVersionSetClient.CreateOrUpdate // method. func (client *APIVersionSetClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, parameters APIVersionSetContract, options *APIVersionSetClientCreateOrUpdateOptions) (APIVersionSetClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, versionSetID, parameters, options) if err != nil { return APIVersionSetClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIVersionSetClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return APIVersionSetClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return APIVersionSetClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -95,13 +96,16 @@ func (client *APIVersionSetClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -119,24 +123,26 @@ func (client *APIVersionSetClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Deletes specific Api Version Set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - options - APIVersionSetClientDeleteOptions contains the optional parameters for the APIVersionSetClient.Delete method. func (client *APIVersionSetClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, ifMatch string, options *APIVersionSetClientDeleteOptions) (APIVersionSetClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, versionSetID, ifMatch, options) if err != nil { return APIVersionSetClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIVersionSetClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return APIVersionSetClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return APIVersionSetClientDeleteResponse{}, err } return APIVersionSetClientDeleteResponse{}, nil } @@ -165,7 +171,7 @@ func (client *APIVersionSetClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -175,24 +181,27 @@ func (client *APIVersionSetClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets the details of the Api Version Set specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance. // - options - APIVersionSetClientGetOptions contains the optional parameters for the APIVersionSetClient.Get method. func (client *APIVersionSetClient) Get(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, options *APIVersionSetClientGetOptions) (APIVersionSetClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, versionSetID, options) if err != nil { return APIVersionSetClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIVersionSetClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIVersionSetClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIVersionSetClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -219,7 +228,7 @@ func (client *APIVersionSetClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -239,25 +248,28 @@ func (client *APIVersionSetClient) getHandleResponse(resp *http.Response) (APIVe // GetEntityTag - Gets the entity state (Etag) version of the Api Version Set specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance. // - options - APIVersionSetClientGetEntityTagOptions contains the optional parameters for the APIVersionSetClient.GetEntityTag // method. func (client *APIVersionSetClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, options *APIVersionSetClientGetEntityTagOptions) (APIVersionSetClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, versionSetID, options) if err != nil { return APIVersionSetClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIVersionSetClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIVersionSetClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIVersionSetClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -284,7 +296,7 @@ func (client *APIVersionSetClient) getEntityTagCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -302,8 +314,8 @@ func (client *APIVersionSetClient) getEntityTagHandleResponse(resp *http.Respons // NewListByServicePager - Lists a collection of API Version Sets in the specified service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - APIVersionSetClientListByServiceOptions contains the optional parameters for the APIVersionSetClient.NewListByServicePager // method. @@ -364,7 +376,7 @@ func (client *APIVersionSetClient) listByServiceCreateRequest(ctx context.Contex if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -382,8 +394,8 @@ func (client *APIVersionSetClient) listByServiceHandleResponse(resp *http.Respon // Update - Updates the details of the Api VersionSet specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -391,18 +403,21 @@ func (client *APIVersionSetClient) listByServiceHandleResponse(resp *http.Respon // - parameters - Update parameters. // - options - APIVersionSetClientUpdateOptions contains the optional parameters for the APIVersionSetClient.Update method. func (client *APIVersionSetClient) Update(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, ifMatch string, parameters APIVersionSetUpdateParameters, options *APIVersionSetClientUpdateOptions) (APIVersionSetClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, versionSetID, ifMatch, parameters, options) if err != nil { return APIVersionSetClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIVersionSetClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIVersionSetClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIVersionSetClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -429,11 +444,14 @@ func (client *APIVersionSetClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apiversionset_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiversionset_client_example_test.go index 99049a34823a..03d6dd780eef 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apiversionset_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiversionset_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiVersionSets.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApiVersionSets.json func ExampleAPIVersionSetClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -70,7 +70,7 @@ func ExampleAPIVersionSetClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiVersionSet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadApiVersionSet.json func ExampleAPIVersionSetClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -87,7 +87,7 @@ func ExampleAPIVersionSetClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiVersionSet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiVersionSet.json func ExampleAPIVersionSetClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -117,7 +117,7 @@ func ExampleAPIVersionSetClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiVersionSet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiVersionSet.json func ExampleAPIVersionSetClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -153,7 +153,7 @@ func ExampleAPIVersionSetClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiVersionSet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateApiVersionSet.json func ExampleAPIVersionSetClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -189,7 +189,7 @@ func ExampleAPIVersionSetClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiVersionSet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteApiVersionSet.json func ExampleAPIVersionSetClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apiwiki_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiwiki_client.go new file mode 100644 index 000000000000..180efb3a255c --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiwiki_client.go @@ -0,0 +1,385 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armapimanagement + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// APIWikiClient contains the methods for the APIWiki group. +// Don't use this type directly, use NewAPIWikiClient() instead. +type APIWikiClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAPIWikiClient creates a new instance of APIWikiClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAPIWikiClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIWikiClient, error) { + cl, err := arm.NewClient(moduleName+".APIWikiClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &APIWikiClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates a new Wiki for an API or updates an existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - parameters - Create parameters. +// - options - APIWikiClientCreateOrUpdateOptions contains the optional parameters for the APIWikiClient.CreateOrUpdate method. +func (client *APIWikiClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, parameters WikiContract, options *APIWikiClientCreateOrUpdateOptions) (APIWikiClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, parameters, options) + if err != nil { + return APIWikiClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APIWikiClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return APIWikiClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *APIWikiClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, parameters WikiContract, options *APIWikiClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *APIWikiClient) createOrUpdateHandleResponse(resp *http.Response) (APIWikiClientCreateOrUpdateResponse, error) { + result := APIWikiClientCreateOrUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.WikiContract); err != nil { + return APIWikiClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes the specified Wiki from an API. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - APIWikiClientDeleteOptions contains the optional parameters for the APIWikiClient.Delete method. +func (client *APIWikiClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, ifMatch string, options *APIWikiClientDeleteOptions) (APIWikiClientDeleteResponse, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, ifMatch, options) + if err != nil { + return APIWikiClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APIWikiClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return APIWikiClientDeleteResponse{}, err + } + return APIWikiClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *APIWikiClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, ifMatch string, options *APIWikiClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the details of the Wiki for an API specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - options - APIWikiClientGetOptions contains the optional parameters for the APIWikiClient.Get method. +func (client *APIWikiClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIWikiClientGetOptions) (APIWikiClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, options) + if err != nil { + return APIWikiClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APIWikiClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIWikiClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *APIWikiClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIWikiClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *APIWikiClient) getHandleResponse(resp *http.Response) (APIWikiClientGetResponse, error) { + result := APIWikiClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.WikiContract); err != nil { + return APIWikiClientGetResponse{}, err + } + return result, nil +} + +// GetEntityTag - Gets the entity state (Etag) version of the Wiki for an API specified by its identifier. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - options - APIWikiClientGetEntityTagOptions contains the optional parameters for the APIWikiClient.GetEntityTag method. +func (client *APIWikiClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIWikiClientGetEntityTagOptions) (APIWikiClientGetEntityTagResponse, error) { + var err error + req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, options) + if err != nil { + return APIWikiClientGetEntityTagResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APIWikiClientGetEntityTagResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIWikiClientGetEntityTagResponse{}, err + } + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err +} + +// getEntityTagCreateRequest creates the GetEntityTag request. +func (client *APIWikiClient) getEntityTagCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIWikiClientGetEntityTagOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getEntityTagHandleResponse handles the GetEntityTag response. +func (client *APIWikiClient) getEntityTagHandleResponse(resp *http.Response) (APIWikiClientGetEntityTagResponse, error) { + result := APIWikiClientGetEntityTagResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + result.Success = resp.StatusCode >= 200 && resp.StatusCode < 300 + return result, nil +} + +// Update - Updates the details of the Wiki for an API specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Wiki Update parameters. +// - options - APIWikiClientUpdateOptions contains the optional parameters for the APIWikiClient.Update method. +func (client *APIWikiClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, ifMatch string, parameters WikiUpdateContract, options *APIWikiClientUpdateOptions) (APIWikiClientUpdateResponse, error) { + var err error + req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, apiID, ifMatch, parameters, options) + if err != nil { + return APIWikiClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APIWikiClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIWikiClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *APIWikiClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, ifMatch string, parameters WikiUpdateContract, options *APIWikiClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *APIWikiClient) updateHandleResponse(resp *http.Response) (APIWikiClientUpdateResponse, error) { + result := APIWikiClientUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.WikiContract); err != nil { + return APIWikiClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apiwiki_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiwiki_client_example_test.go new file mode 100644 index 000000000000..09f72468a449 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiwiki_client_example_test.go @@ -0,0 +1,169 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadApiWiki.json +func ExampleAPIWikiClient_GetEntityTag() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewAPIWikiClient().GetEntityTag(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiWiki.json +func ExampleAPIWikiClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAPIWikiClient().Get(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.WikiContract = armapimanagement.WikiContract{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.ApiManagement/service/apis/wikis"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a/wikis/default"), + // Properties: &armapimanagement.WikiContractProperties{ + // Documents: []*armapimanagement.WikiDocumentationContract{ + // { + // DocumentationID: to.Ptr("docId1"), + // }, + // { + // DocumentationID: to.Ptr("docId2"), + // }}, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiWiki.json +func ExampleAPIWikiClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAPIWikiClient().CreateOrUpdate(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", armapimanagement.WikiContract{ + Properties: &armapimanagement.WikiContractProperties{ + Documents: []*armapimanagement.WikiDocumentationContract{ + { + DocumentationID: to.Ptr("docId1"), + }, + { + DocumentationID: to.Ptr("docId2"), + }}, + }, + }, &armapimanagement.APIWikiClientCreateOrUpdateOptions{IfMatch: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.WikiContract = armapimanagement.WikiContract{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.ApiManagement/service/apis/wikis"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a/wikis/default"), + // Properties: &armapimanagement.WikiContractProperties{ + // Documents: []*armapimanagement.WikiDocumentationContract{ + // { + // DocumentationID: to.Ptr("docId1"), + // }, + // { + // DocumentationID: to.Ptr("docId2"), + // }}, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateApiWiki.json +func ExampleAPIWikiClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAPIWikiClient().Update(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "*", armapimanagement.WikiUpdateContract{ + Properties: &armapimanagement.WikiContractProperties{ + Documents: []*armapimanagement.WikiDocumentationContract{ + { + DocumentationID: to.Ptr("docId1"), + }}, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.WikiContract = armapimanagement.WikiContract{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.ApiManagement/service/apis/wikis"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a/wikis/default"), + // Properties: &armapimanagement.WikiContractProperties{ + // Documents: []*armapimanagement.WikiDocumentationContract{ + // { + // DocumentationID: to.Ptr("docId1"), + // }}, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteApiWiki.json +func ExampleAPIWikiClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewAPIWikiClient().Delete(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "*", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apiwikis_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiwikis_client.go new file mode 100644 index 000000000000..9dd65ece9f4c --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiwikis_client.go @@ -0,0 +1,128 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armapimanagement + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// APIWikisClient contains the methods for the APIWikis group. +// Don't use this type directly, use NewAPIWikisClient() instead. +type APIWikisClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAPIWikisClient creates a new instance of APIWikisClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAPIWikisClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIWikisClient, error) { + cl, err := arm.NewClient(moduleName+".APIWikisClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &APIWikisClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Gets the wikis for an API specified by its identifier. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - options - APIWikisClientListOptions contains the optional parameters for the APIWikisClient.NewListPager method. +func (client *APIWikisClient) NewListPager(resourceGroupName string, serviceName string, apiID string, options *APIWikisClientListOptions) *runtime.Pager[APIWikisClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[APIWikisClientListResponse]{ + More: func(page APIWikisClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *APIWikisClientListResponse) (APIWikisClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, apiID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return APIWikisClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APIWikisClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APIWikisClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *APIWikisClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIWikisClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/wikis" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + } + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *APIWikisClient) listHandleResponse(resp *http.Response) (APIWikisClientListResponse, error) { + result := APIWikisClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.WikiCollection); err != nil { + return APIWikisClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apiwikis_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiwikis_client_example_test.go new file mode 100644 index 000000000000..c5068b7644f8 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiwikis_client_example_test.go @@ -0,0 +1,63 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApiWikis.json +func ExampleAPIWikisClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewAPIWikisClient().NewListPager("rg1", "apimService1", "57d1f7558aa04f15146d9d8a", &armapimanagement.APIWikisClientListOptions{Filter: nil, + Top: nil, + Skip: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.WikiCollection = armapimanagement.WikiCollection{ + // Value: []*armapimanagement.WikiContract{ + // { + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.ApiManagement/service/apis/wikis"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d1f7558aa04f15146d9d8a/wikis/default"), + // Properties: &armapimanagement.WikiContractProperties{ + // Documents: []*armapimanagement.WikiDocumentationContract{ + // { + // DocumentationID: to.Ptr("docId1"), + // }, + // { + // DocumentationID: to.Ptr("docId2"), + // }}, + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/authorization_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/authorization_client.go new file mode 100644 index 000000000000..25e73a11fe9d --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/authorization_client.go @@ -0,0 +1,421 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armapimanagement + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// AuthorizationClient contains the methods for the Authorization group. +// Don't use this type directly, use NewAuthorizationClient() instead. +type AuthorizationClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAuthorizationClient creates a new instance of AuthorizationClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAuthorizationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AuthorizationClient, error) { + cl, err := arm.NewClient(moduleName+".AuthorizationClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AuthorizationClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// ConfirmConsentCode - Confirm valid consent code to suppress Authorizations anti-phishing page. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - authorizationID - Identifier of the authorization. +// - parameters - Create parameters. +// - options - AuthorizationClientConfirmConsentCodeOptions contains the optional parameters for the AuthorizationClient.ConfirmConsentCode +// method. +func (client *AuthorizationClient) ConfirmConsentCode(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, parameters AuthorizationConfirmConsentCodeRequestContract, options *AuthorizationClientConfirmConsentCodeOptions) (AuthorizationClientConfirmConsentCodeResponse, error) { + var err error + req, err := client.confirmConsentCodeCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, authorizationID, parameters, options) + if err != nil { + return AuthorizationClientConfirmConsentCodeResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AuthorizationClientConfirmConsentCodeResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AuthorizationClientConfirmConsentCodeResponse{}, err + } + resp, err := client.confirmConsentCodeHandleResponse(httpResp) + return resp, err +} + +// confirmConsentCodeCreateRequest creates the ConfirmConsentCode request. +func (client *AuthorizationClient) confirmConsentCodeCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, parameters AuthorizationConfirmConsentCodeRequestContract, options *AuthorizationClientConfirmConsentCodeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}/confirmConsentCode" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if authorizationID == "" { + return nil, errors.New("parameter authorizationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationId}", url.PathEscape(authorizationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// confirmConsentCodeHandleResponse handles the ConfirmConsentCode response. +func (client *AuthorizationClient) confirmConsentCodeHandleResponse(resp *http.Response) (AuthorizationClientConfirmConsentCodeResponse, error) { + result := AuthorizationClientConfirmConsentCodeResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + return result, nil +} + +// CreateOrUpdate - Creates or updates authorization. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - authorizationID - Identifier of the authorization. +// - parameters - Create parameters. +// - options - AuthorizationClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationClient.CreateOrUpdate +// method. +func (client *AuthorizationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, parameters AuthorizationContract, options *AuthorizationClientCreateOrUpdateOptions) (AuthorizationClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, authorizationID, parameters, options) + if err != nil { + return AuthorizationClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AuthorizationClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return AuthorizationClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AuthorizationClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, parameters AuthorizationContract, options *AuthorizationClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if authorizationID == "" { + return nil, errors.New("parameter authorizationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationId}", url.PathEscape(authorizationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *AuthorizationClient) createOrUpdateHandleResponse(resp *http.Response) (AuthorizationClientCreateOrUpdateResponse, error) { + result := AuthorizationClientCreateOrUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationContract); err != nil { + return AuthorizationClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes specific Authorization from the Authorization provider. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - authorizationID - Identifier of the authorization. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - AuthorizationClientDeleteOptions contains the optional parameters for the AuthorizationClient.Delete method. +func (client *AuthorizationClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, ifMatch string, options *AuthorizationClientDeleteOptions) (AuthorizationClientDeleteResponse, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, authorizationID, ifMatch, options) + if err != nil { + return AuthorizationClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AuthorizationClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AuthorizationClientDeleteResponse{}, err + } + return AuthorizationClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AuthorizationClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, ifMatch string, options *AuthorizationClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if authorizationID == "" { + return nil, errors.New("parameter authorizationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationId}", url.PathEscape(authorizationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the details of the authorization specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - authorizationID - Identifier of the authorization. +// - options - AuthorizationClientGetOptions contains the optional parameters for the AuthorizationClient.Get method. +func (client *AuthorizationClient) Get(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, options *AuthorizationClientGetOptions) (AuthorizationClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, authorizationID, options) + if err != nil { + return AuthorizationClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AuthorizationClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AuthorizationClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *AuthorizationClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, options *AuthorizationClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if authorizationID == "" { + return nil, errors.New("parameter authorizationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationId}", url.PathEscape(authorizationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AuthorizationClient) getHandleResponse(resp *http.Response) (AuthorizationClientGetResponse, error) { + result := AuthorizationClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationContract); err != nil { + return AuthorizationClientGetResponse{}, err + } + return result, nil +} + +// NewListByAuthorizationProviderPager - Lists a collection of authorization providers defined within a authorization provider. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - options - AuthorizationClientListByAuthorizationProviderOptions contains the optional parameters for the AuthorizationClient.NewListByAuthorizationProviderPager +// method. +func (client *AuthorizationClient) NewListByAuthorizationProviderPager(resourceGroupName string, serviceName string, authorizationProviderID string, options *AuthorizationClientListByAuthorizationProviderOptions) *runtime.Pager[AuthorizationClientListByAuthorizationProviderResponse] { + return runtime.NewPager(runtime.PagingHandler[AuthorizationClientListByAuthorizationProviderResponse]{ + More: func(page AuthorizationClientListByAuthorizationProviderResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AuthorizationClientListByAuthorizationProviderResponse) (AuthorizationClientListByAuthorizationProviderResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByAuthorizationProviderCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AuthorizationClientListByAuthorizationProviderResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AuthorizationClientListByAuthorizationProviderResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AuthorizationClientListByAuthorizationProviderResponse{}, runtime.NewResponseError(resp) + } + return client.listByAuthorizationProviderHandleResponse(resp) + }, + }) +} + +// listByAuthorizationProviderCreateRequest creates the ListByAuthorizationProvider request. +func (client *AuthorizationClient) listByAuthorizationProviderCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, options *AuthorizationClientListByAuthorizationProviderOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + } + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByAuthorizationProviderHandleResponse handles the ListByAuthorizationProvider response. +func (client *AuthorizationClient) listByAuthorizationProviderHandleResponse(resp *http.Response) (AuthorizationClientListByAuthorizationProviderResponse, error) { + result := AuthorizationClientListByAuthorizationProviderResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationCollection); err != nil { + return AuthorizationClientListByAuthorizationProviderResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/authorization_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/authorization_client_example_test.go new file mode 100644 index 000000000000..9bbe7936bd55 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/authorization_client_example_test.go @@ -0,0 +1,282 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListAuthorizationsAuthCode.json +func ExampleAuthorizationClient_NewListByAuthorizationProviderPager_apiManagementListAuthorizationsAuthCode() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewAuthorizationClient().NewListByAuthorizationProviderPager("rg1", "apimService1", "aadwithauthcode", &armapimanagement.AuthorizationClientListByAuthorizationProviderOptions{Filter: nil, + Top: nil, + Skip: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.AuthorizationCollection = armapimanagement.AuthorizationCollection{ + // Value: []*armapimanagement.AuthorizationContract{ + // { + // Name: to.Ptr("authz1"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders/authorizations"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithauthcode/authorizations/authz1"), + // Properties: &armapimanagement.AuthorizationContractProperties{ + // AuthorizationType: to.Ptr(armapimanagement.AuthorizationTypeOAuth2), + // OAuth2GrantType: to.Ptr(armapimanagement.OAuth2GrantTypeAuthorizationCode), + // Status: to.Ptr("Connected"), + // }, + // }, + // { + // Name: to.Ptr("authz2"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders/authorizations"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithauthcode/authorizations/authz2"), + // Properties: &armapimanagement.AuthorizationContractProperties{ + // AuthorizationType: to.Ptr(armapimanagement.AuthorizationTypeOAuth2), + // Error: &armapimanagement.AuthorizationError{ + // Code: to.Ptr("Unauthenticated"), + // Message: to.Ptr("This connection is not authenticated."), + // }, + // OAuth2GrantType: to.Ptr(armapimanagement.OAuth2GrantTypeAuthorizationCode), + // Status: to.Ptr("Error"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListAuthorizationsClientCred.json +func ExampleAuthorizationClient_NewListByAuthorizationProviderPager_apiManagementListAuthorizationsClientCred() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewAuthorizationClient().NewListByAuthorizationProviderPager("rg1", "apimService1", "aadwithclientcred", &armapimanagement.AuthorizationClientListByAuthorizationProviderOptions{Filter: nil, + Top: nil, + Skip: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.AuthorizationCollection = armapimanagement.AuthorizationCollection{ + // Value: []*armapimanagement.AuthorizationContract{ + // { + // Name: to.Ptr("authz1"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders/authorizations"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithclientcred/authorizations/authz1"), + // Properties: &armapimanagement.AuthorizationContractProperties{ + // AuthorizationType: to.Ptr(armapimanagement.AuthorizationTypeOAuth2), + // OAuth2GrantType: to.Ptr(armapimanagement.OAuth2GrantTypeClientCredentials), + // Parameters: map[string]*string{ + // "clientId": to.Ptr("53790925-fdd3-4b80-bc7a-4c3aaf25801d"), + // }, + // Status: to.Ptr("Connected"), + // }, + // }, + // { + // Name: to.Ptr("authz2"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders/authorizations"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithclientcred/authorizations/authz2"), + // Properties: &armapimanagement.AuthorizationContractProperties{ + // AuthorizationType: to.Ptr(armapimanagement.AuthorizationTypeOAuth2), + // Error: &armapimanagement.AuthorizationError{ + // Code: to.Ptr("Unauthorized"), + // Message: to.Ptr("Failed to acquire access token for service using client credentials flow: IdentityProvider=aadwithclientcred. Correlation Id=6299d09b-03b7-46ed-b355-0453451d7e49, UTC TimeStamp=5/14/2022 4:53:19 PM, Error: Failed to exchange client credentials for token. Response code=Unauthorized, Details:\r\n{\"error\":\"invalid_client\",\"error_description\":\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app '53790925-fdd3-4b80-bc7a-4c3aaf25801d'.\\r\\nTrace ID: 4a18d3cd-9ad5-4664-b3eb-daaa2f435f00\\r\\nCorrelation ID: dde60c16-35cb-4572-8226-bfb4233af8d7\\r\\nTimestamp: 2022-05-14 16:53:19Z\",\"error_codes\":[7000215],\"timestamp\":\"2022-05-14 16:53:19Z\",\"trace_id\":\"4a18d3cd-9ad5-4664-b3eb-daaa2f435f00\",\"correlation_id\":\"dde60c16-35cb-4572-8226-bfb4233af8d7\",\"error_uri\":\"https://login.windows.net/error?code=7000215\"}"), + // }, + // OAuth2GrantType: to.Ptr(armapimanagement.OAuth2GrantTypeClientCredentials), + // Parameters: map[string]*string{ + // "clientId": to.Ptr("53790925-fdd3-4b80-bc7a-4c3aaf25801d"), + // }, + // Status: to.Ptr("Error"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetAuthorization.json +func ExampleAuthorizationClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAuthorizationClient().Get(ctx, "rg1", "apimService1", "aadwithauthcode", "authz1", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.AuthorizationContract = armapimanagement.AuthorizationContract{ + // Name: to.Ptr("authz1"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders/authorizations"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithauthcode/authorizations/authz1"), + // Properties: &armapimanagement.AuthorizationContractProperties{ + // AuthorizationType: to.Ptr(armapimanagement.AuthorizationTypeOAuth2), + // OAuth2GrantType: to.Ptr(armapimanagement.OAuth2GrantTypeAuthorizationCode), + // Status: to.Ptr("Connected"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateAuthorizationAADAuthCode.json +func ExampleAuthorizationClient_CreateOrUpdate_apiManagementCreateAuthorizationAadAuthCode() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAuthorizationClient().CreateOrUpdate(ctx, "rg1", "apimService1", "aadwithauthcode", "authz2", armapimanagement.AuthorizationContract{ + Properties: &armapimanagement.AuthorizationContractProperties{ + AuthorizationType: to.Ptr(armapimanagement.AuthorizationTypeOAuth2), + OAuth2GrantType: to.Ptr(armapimanagement.OAuth2GrantTypeAuthorizationCode), + }, + }, &armapimanagement.AuthorizationClientCreateOrUpdateOptions{IfMatch: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.AuthorizationContract = armapimanagement.AuthorizationContract{ + // Name: to.Ptr("authz2"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders/authorizations"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithauthcode/authorizations/authz2"), + // Properties: &armapimanagement.AuthorizationContractProperties{ + // AuthorizationType: to.Ptr(armapimanagement.AuthorizationTypeOAuth2), + // Error: &armapimanagement.AuthorizationError{ + // Code: to.Ptr("Unauthenticated"), + // Message: to.Ptr("This connection is not authenticated."), + // }, + // OAuth2GrantType: to.Ptr(armapimanagement.OAuth2GrantTypeAuthorizationCode), + // Status: to.Ptr("Error"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateAuthorizationAADClientCred.json +func ExampleAuthorizationClient_CreateOrUpdate_apiManagementCreateAuthorizationAadClientCred() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAuthorizationClient().CreateOrUpdate(ctx, "rg1", "apimService1", "aadwithclientcred", "authz1", armapimanagement.AuthorizationContract{ + Properties: &armapimanagement.AuthorizationContractProperties{ + AuthorizationType: to.Ptr(armapimanagement.AuthorizationTypeOAuth2), + OAuth2GrantType: to.Ptr(armapimanagement.OAuth2GrantTypeAuthorizationCode), + Parameters: map[string]*string{ + "clientId": to.Ptr("53790925-fdd3-4b80-bc7a-4c3aaf25801d"), + "clientSecret": to.Ptr("FcJkQ3iPSaKAQRA7Ft8Q~fZ1X5vKmqzUAfJagcJ8"), + }, + }, + }, &armapimanagement.AuthorizationClientCreateOrUpdateOptions{IfMatch: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.AuthorizationContract = armapimanagement.AuthorizationContract{ + // Name: to.Ptr("authz1"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders/authorizations"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithclientcred/authorizations/authz1"), + // Properties: &armapimanagement.AuthorizationContractProperties{ + // AuthorizationType: to.Ptr(armapimanagement.AuthorizationTypeOAuth2), + // OAuth2GrantType: to.Ptr(armapimanagement.OAuth2GrantTypeClientCredentials), + // Parameters: map[string]*string{ + // "clientId": to.Ptr("53790925-fdd3-4b80-bc7a-4c3aaf25801d"), + // }, + // Status: to.Ptr("Connected"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteAuthorization.json +func ExampleAuthorizationClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewAuthorizationClient().Delete(ctx, "rg1", "apimService1", "aadwithauthcode", "authz1", "*", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementPostAuthorizationConfirmConsentCodeRequest.json +func ExampleAuthorizationClient_ConfirmConsentCode() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewAuthorizationClient().ConfirmConsentCode(ctx, "rg1", "apimService1", "aadwithauthcode", "authz1", armapimanagement.AuthorizationConfirmConsentCodeRequestContract{ + ConsentCode: to.Ptr("theconsentcode"), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/authorizationaccesspolicy_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationaccesspolicy_client.go new file mode 100644 index 000000000000..9e1d0e94aa5c --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationaccesspolicy_client.go @@ -0,0 +1,368 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armapimanagement + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// AuthorizationAccessPolicyClient contains the methods for the AuthorizationAccessPolicy group. +// Don't use this type directly, use NewAuthorizationAccessPolicyClient() instead. +type AuthorizationAccessPolicyClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAuthorizationAccessPolicyClient creates a new instance of AuthorizationAccessPolicyClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAuthorizationAccessPolicyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AuthorizationAccessPolicyClient, error) { + cl, err := arm.NewClient(moduleName+".AuthorizationAccessPolicyClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AuthorizationAccessPolicyClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates Authorization Access Policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - authorizationID - Identifier of the authorization. +// - authorizationAccessPolicyID - Identifier of the authorization access policy. +// - parameters - Create parameters. +// - options - AuthorizationAccessPolicyClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationAccessPolicyClient.CreateOrUpdate +// method. +func (client *AuthorizationAccessPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, authorizationAccessPolicyID string, parameters AuthorizationAccessPolicyContract, options *AuthorizationAccessPolicyClientCreateOrUpdateOptions) (AuthorizationAccessPolicyClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, authorizationID, authorizationAccessPolicyID, parameters, options) + if err != nil { + return AuthorizationAccessPolicyClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AuthorizationAccessPolicyClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return AuthorizationAccessPolicyClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AuthorizationAccessPolicyClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, authorizationAccessPolicyID string, parameters AuthorizationAccessPolicyContract, options *AuthorizationAccessPolicyClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}/accessPolicies/{authorizationAccessPolicyId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if authorizationID == "" { + return nil, errors.New("parameter authorizationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationId}", url.PathEscape(authorizationID)) + if authorizationAccessPolicyID == "" { + return nil, errors.New("parameter authorizationAccessPolicyID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationAccessPolicyId}", url.PathEscape(authorizationAccessPolicyID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *AuthorizationAccessPolicyClient) createOrUpdateHandleResponse(resp *http.Response) (AuthorizationAccessPolicyClientCreateOrUpdateResponse, error) { + result := AuthorizationAccessPolicyClientCreateOrUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationAccessPolicyContract); err != nil { + return AuthorizationAccessPolicyClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes specific access policy from the Authorization. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - authorizationID - Identifier of the authorization. +// - authorizationAccessPolicyID - Identifier of the authorization access policy. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - AuthorizationAccessPolicyClientDeleteOptions contains the optional parameters for the AuthorizationAccessPolicyClient.Delete +// method. +func (client *AuthorizationAccessPolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, authorizationAccessPolicyID string, ifMatch string, options *AuthorizationAccessPolicyClientDeleteOptions) (AuthorizationAccessPolicyClientDeleteResponse, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, authorizationID, authorizationAccessPolicyID, ifMatch, options) + if err != nil { + return AuthorizationAccessPolicyClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AuthorizationAccessPolicyClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AuthorizationAccessPolicyClientDeleteResponse{}, err + } + return AuthorizationAccessPolicyClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AuthorizationAccessPolicyClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, authorizationAccessPolicyID string, ifMatch string, options *AuthorizationAccessPolicyClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}/accessPolicies/{authorizationAccessPolicyId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if authorizationID == "" { + return nil, errors.New("parameter authorizationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationId}", url.PathEscape(authorizationID)) + if authorizationAccessPolicyID == "" { + return nil, errors.New("parameter authorizationAccessPolicyID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationAccessPolicyId}", url.PathEscape(authorizationAccessPolicyID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the details of the authorization access policy specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - authorizationID - Identifier of the authorization. +// - authorizationAccessPolicyID - Identifier of the authorization access policy. +// - options - AuthorizationAccessPolicyClientGetOptions contains the optional parameters for the AuthorizationAccessPolicyClient.Get +// method. +func (client *AuthorizationAccessPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, authorizationAccessPolicyID string, options *AuthorizationAccessPolicyClientGetOptions) (AuthorizationAccessPolicyClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, authorizationID, authorizationAccessPolicyID, options) + if err != nil { + return AuthorizationAccessPolicyClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AuthorizationAccessPolicyClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AuthorizationAccessPolicyClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *AuthorizationAccessPolicyClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, authorizationAccessPolicyID string, options *AuthorizationAccessPolicyClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}/accessPolicies/{authorizationAccessPolicyId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if authorizationID == "" { + return nil, errors.New("parameter authorizationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationId}", url.PathEscape(authorizationID)) + if authorizationAccessPolicyID == "" { + return nil, errors.New("parameter authorizationAccessPolicyID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationAccessPolicyId}", url.PathEscape(authorizationAccessPolicyID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AuthorizationAccessPolicyClient) getHandleResponse(resp *http.Response) (AuthorizationAccessPolicyClientGetResponse, error) { + result := AuthorizationAccessPolicyClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationAccessPolicyContract); err != nil { + return AuthorizationAccessPolicyClientGetResponse{}, err + } + return result, nil +} + +// NewListByAuthorizationPager - Lists a collection of authorization access policy defined within a authorization. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - authorizationID - Identifier of the authorization. +// - options - AuthorizationAccessPolicyClientListByAuthorizationOptions contains the optional parameters for the AuthorizationAccessPolicyClient.NewListByAuthorizationPager +// method. +func (client *AuthorizationAccessPolicyClient) NewListByAuthorizationPager(resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, options *AuthorizationAccessPolicyClientListByAuthorizationOptions) *runtime.Pager[AuthorizationAccessPolicyClientListByAuthorizationResponse] { + return runtime.NewPager(runtime.PagingHandler[AuthorizationAccessPolicyClientListByAuthorizationResponse]{ + More: func(page AuthorizationAccessPolicyClientListByAuthorizationResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AuthorizationAccessPolicyClientListByAuthorizationResponse) (AuthorizationAccessPolicyClientListByAuthorizationResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByAuthorizationCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, authorizationID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AuthorizationAccessPolicyClientListByAuthorizationResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AuthorizationAccessPolicyClientListByAuthorizationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AuthorizationAccessPolicyClientListByAuthorizationResponse{}, runtime.NewResponseError(resp) + } + return client.listByAuthorizationHandleResponse(resp) + }, + }) +} + +// listByAuthorizationCreateRequest creates the ListByAuthorization request. +func (client *AuthorizationAccessPolicyClient) listByAuthorizationCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, options *AuthorizationAccessPolicyClientListByAuthorizationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}/accessPolicies" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if authorizationID == "" { + return nil, errors.New("parameter authorizationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationId}", url.PathEscape(authorizationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + } + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByAuthorizationHandleResponse handles the ListByAuthorization response. +func (client *AuthorizationAccessPolicyClient) listByAuthorizationHandleResponse(resp *http.Response) (AuthorizationAccessPolicyClientListByAuthorizationResponse, error) { + result := AuthorizationAccessPolicyClientListByAuthorizationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationAccessPolicyCollection); err != nil { + return AuthorizationAccessPolicyClientListByAuthorizationResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/authorizationaccesspolicy_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationaccesspolicy_client_example_test.go new file mode 100644 index 000000000000..f0b6a6686aec --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationaccesspolicy_client_example_test.go @@ -0,0 +1,148 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListAuthorizationAccessPolicies.json +func ExampleAuthorizationAccessPolicyClient_NewListByAuthorizationPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewAuthorizationAccessPolicyClient().NewListByAuthorizationPager("rg1", "apimService1", "aadwithauthcode", "authz1", &armapimanagement.AuthorizationAccessPolicyClientListByAuthorizationOptions{Filter: nil, + Top: nil, + Skip: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.AuthorizationAccessPolicyCollection = armapimanagement.AuthorizationAccessPolicyCollection{ + // Value: []*armapimanagement.AuthorizationAccessPolicyContract{ + // { + // Name: to.Ptr("fe0bed83-631f-4149-bd0b-0464b1bc7cab"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders/authorizations/accessPolicies"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithauthcode/authorizations/authz1/accessPolicies"), + // Properties: &armapimanagement.AuthorizationAccessPolicyContractProperties{ + // ObjectID: to.Ptr("fe0bed83-631f-4149-bd0b-0464b1bc7cab"), + // TenantID: to.Ptr("13932a0d-5c63-4d37-901d-1df9c97722ff"), + // }, + // }, + // { + // Name: to.Ptr("5585d6cd-2289-42e9-ab9b-3e2e23d74b4a"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders/authorizations/accessPolicies"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithauthcode/authorizations/authz1/accessPolicies"), + // Properties: &armapimanagement.AuthorizationAccessPolicyContractProperties{ + // ObjectID: to.Ptr("5585d6cd-2289-42e9-ab9b-3e2e23d74b4a"), + // TenantID: to.Ptr("13932a0d-5c63-4d37-901d-1df9c97722ff"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetAuthorizationAccessPolicy.json +func ExampleAuthorizationAccessPolicyClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAuthorizationAccessPolicyClient().Get(ctx, "rg1", "apimService1", "aadwithauthcode", "authz1", "fe0bed83-631f-4149-bd0b-0464b1bc7cab", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.AuthorizationAccessPolicyContract = armapimanagement.AuthorizationAccessPolicyContract{ + // Name: to.Ptr("fe0bed83-631f-4149-bd0b-0464b1bc7cab"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders/authorizations/accessPolicies"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithauthcode/authorizations/authz1/accessPolicies"), + // Properties: &armapimanagement.AuthorizationAccessPolicyContractProperties{ + // ObjectID: to.Ptr("fe0bed83-631f-4149-bd0b-0464b1bc7cab"), + // TenantID: to.Ptr("13932a0d-5c63-4d37-901d-1df9c97722ff"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateAuthorizationAccessPolicy.json +func ExampleAuthorizationAccessPolicyClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAuthorizationAccessPolicyClient().CreateOrUpdate(ctx, "rg1", "apimService1", "aadwithauthcode", "authz1", "fe0bed83-631f-4149-bd0b-0464b1bc7cab", armapimanagement.AuthorizationAccessPolicyContract{ + Properties: &armapimanagement.AuthorizationAccessPolicyContractProperties{ + ObjectID: to.Ptr("fe0bed83-631f-4149-bd0b-0464b1bc7cab"), + TenantID: to.Ptr("13932a0d-5c63-4d37-901d-1df9c97722ff"), + }, + }, &armapimanagement.AuthorizationAccessPolicyClientCreateOrUpdateOptions{IfMatch: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.AuthorizationAccessPolicyContract = armapimanagement.AuthorizationAccessPolicyContract{ + // Name: to.Ptr("fe0bed83-631f-4149-bd0b-0464b1bc7cab"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders/authorizations/accessPolicies"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithauthcode/authorizations/authz1/accessPolicies"), + // Properties: &armapimanagement.AuthorizationAccessPolicyContractProperties{ + // ObjectID: to.Ptr("fe0bed83-631f-4149-bd0b-0464b1bc7cab"), + // TenantID: to.Ptr("13932a0d-5c63-4d37-901d-1df9c97722ff"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteAuthorizationAccessPolicy.json +func ExampleAuthorizationAccessPolicyClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewAuthorizationAccessPolicyClient().Delete(ctx, "rg1", "apimService1", "aadwithauthcode", "authz1", "fe0bed83-631f-4149-bd0b-0464b1bc7cab", "*", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/authorizationloginlinks_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationloginlinks_client.go new file mode 100644 index 000000000000..e021bac8cef7 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationloginlinks_client.go @@ -0,0 +1,122 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armapimanagement + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// AuthorizationLoginLinksClient contains the methods for the AuthorizationLoginLinks group. +// Don't use this type directly, use NewAuthorizationLoginLinksClient() instead. +type AuthorizationLoginLinksClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAuthorizationLoginLinksClient creates a new instance of AuthorizationLoginLinksClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAuthorizationLoginLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AuthorizationLoginLinksClient, error) { + cl, err := arm.NewClient(moduleName+".AuthorizationLoginLinksClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AuthorizationLoginLinksClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Post - Gets authorization login links. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - authorizationID - Identifier of the authorization. +// - parameters - Create parameters. +// - options - AuthorizationLoginLinksClientPostOptions contains the optional parameters for the AuthorizationLoginLinksClient.Post +// method. +func (client *AuthorizationLoginLinksClient) Post(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, parameters AuthorizationLoginRequestContract, options *AuthorizationLoginLinksClientPostOptions) (AuthorizationLoginLinksClientPostResponse, error) { + var err error + req, err := client.postCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, authorizationID, parameters, options) + if err != nil { + return AuthorizationLoginLinksClientPostResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AuthorizationLoginLinksClientPostResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AuthorizationLoginLinksClientPostResponse{}, err + } + resp, err := client.postHandleResponse(httpResp) + return resp, err +} + +// postCreateRequest creates the Post request. +func (client *AuthorizationLoginLinksClient) postCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, parameters AuthorizationLoginRequestContract, options *AuthorizationLoginLinksClientPostOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}/getLoginLinks" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if authorizationID == "" { + return nil, errors.New("parameter authorizationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationId}", url.PathEscape(authorizationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// postHandleResponse handles the Post response. +func (client *AuthorizationLoginLinksClient) postHandleResponse(resp *http.Response) (AuthorizationLoginLinksClientPostResponse, error) { + result := AuthorizationLoginLinksClientPostResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationLoginResponseContract); err != nil { + return AuthorizationLoginLinksClientPostResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/authorizationloginlinks_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationloginlinks_client_example_test.go new file mode 100644 index 000000000000..608059b958b3 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationloginlinks_client_example_test.go @@ -0,0 +1,44 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetAuthorizationLoginRequest.json +func ExampleAuthorizationLoginLinksClient_Post() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAuthorizationLoginLinksClient().Post(ctx, "rg1", "apimService1", "aadwithauthcode", "authz1", armapimanagement.AuthorizationLoginRequestContract{ + PostLoginRedirectURL: to.Ptr("https://www.bing.com/"), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.AuthorizationLoginResponseContract = armapimanagement.AuthorizationLoginResponseContract{ + // LoginLink: to.Ptr("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1/login?data=eyJMb2dpbklkIjoiY2YtODNmYzQ5N2YyZWYxNDA4MzlmNDdjZDU3YWY3MmZmODctYW5nYW50aS1wcmV2aWV3X2FhZC1hdXRoY29kZV9vYXV0aDItY29kZV90b2tlbiIsIlNlc3Npb25JZCI6IiIsIkxvZ0Nvbm5lY3Rpb25JZCI6ImF1dGh6MiIsIkxvZ0Nvbm5lY3RvcklkIjoiYWFkLWF1dGhjb2RlIiwiTG9nRW52aXJvbm1lbnRJZCI6ImFuZ2FudGktcHJld"), + // } +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/authorizationprovider_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationprovider_client.go new file mode 100644 index 000000000000..3b1177cd8267 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationprovider_client.go @@ -0,0 +1,328 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armapimanagement + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// AuthorizationProviderClient contains the methods for the AuthorizationProvider group. +// Don't use this type directly, use NewAuthorizationProviderClient() instead. +type AuthorizationProviderClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAuthorizationProviderClient creates a new instance of AuthorizationProviderClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAuthorizationProviderClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AuthorizationProviderClient, error) { + cl, err := arm.NewClient(moduleName+".AuthorizationProviderClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AuthorizationProviderClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates authorization provider. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - parameters - Create parameters. +// - options - AuthorizationProviderClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationProviderClient.CreateOrUpdate +// method. +func (client *AuthorizationProviderClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, parameters AuthorizationProviderContract, options *AuthorizationProviderClientCreateOrUpdateOptions) (AuthorizationProviderClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, parameters, options) + if err != nil { + return AuthorizationProviderClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AuthorizationProviderClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return AuthorizationProviderClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AuthorizationProviderClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, parameters AuthorizationProviderContract, options *AuthorizationProviderClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *AuthorizationProviderClient) createOrUpdateHandleResponse(resp *http.Response) (AuthorizationProviderClientCreateOrUpdateResponse, error) { + result := AuthorizationProviderClientCreateOrUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationProviderContract); err != nil { + return AuthorizationProviderClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes specific authorization provider from the API Management service instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - AuthorizationProviderClientDeleteOptions contains the optional parameters for the AuthorizationProviderClient.Delete +// method. +func (client *AuthorizationProviderClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, ifMatch string, options *AuthorizationProviderClientDeleteOptions) (AuthorizationProviderClientDeleteResponse, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, ifMatch, options) + if err != nil { + return AuthorizationProviderClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AuthorizationProviderClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AuthorizationProviderClientDeleteResponse{}, err + } + return AuthorizationProviderClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AuthorizationProviderClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, ifMatch string, options *AuthorizationProviderClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the details of the authorization provider specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - options - AuthorizationProviderClientGetOptions contains the optional parameters for the AuthorizationProviderClient.Get +// method. +func (client *AuthorizationProviderClient) Get(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, options *AuthorizationProviderClientGetOptions) (AuthorizationProviderClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, options) + if err != nil { + return AuthorizationProviderClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AuthorizationProviderClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AuthorizationProviderClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *AuthorizationProviderClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, options *AuthorizationProviderClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AuthorizationProviderClient) getHandleResponse(resp *http.Response) (AuthorizationProviderClientGetResponse, error) { + result := AuthorizationProviderClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationProviderContract); err != nil { + return AuthorizationProviderClientGetResponse{}, err + } + return result, nil +} + +// NewListByServicePager - Lists a collection of authorization providers defined within a service instance. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - AuthorizationProviderClientListByServiceOptions contains the optional parameters for the AuthorizationProviderClient.NewListByServicePager +// method. +func (client *AuthorizationProviderClient) NewListByServicePager(resourceGroupName string, serviceName string, options *AuthorizationProviderClientListByServiceOptions) *runtime.Pager[AuthorizationProviderClientListByServiceResponse] { + return runtime.NewPager(runtime.PagingHandler[AuthorizationProviderClientListByServiceResponse]{ + More: func(page AuthorizationProviderClientListByServiceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AuthorizationProviderClientListByServiceResponse) (AuthorizationProviderClientListByServiceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AuthorizationProviderClientListByServiceResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AuthorizationProviderClientListByServiceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AuthorizationProviderClientListByServiceResponse{}, runtime.NewResponseError(resp) + } + return client.listByServiceHandleResponse(resp) + }, + }) +} + +// listByServiceCreateRequest creates the ListByService request. +func (client *AuthorizationProviderClient) listByServiceCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *AuthorizationProviderClientListByServiceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + } + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServiceHandleResponse handles the ListByService response. +func (client *AuthorizationProviderClient) listByServiceHandleResponse(resp *http.Response) (AuthorizationProviderClientListByServiceResponse, error) { + result := AuthorizationProviderClientListByServiceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationProviderCollection); err != nil { + return AuthorizationProviderClientListByServiceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/authorizationprovider_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationprovider_client_example_test.go new file mode 100644 index 000000000000..5cc61d2a747e --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationprovider_client_example_test.go @@ -0,0 +1,411 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListAuthorizationProviders.json +func ExampleAuthorizationProviderClient_NewListByServicePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewAuthorizationProviderClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.AuthorizationProviderClientListByServiceOptions{Filter: nil, + Top: nil, + Skip: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.AuthorizationProviderCollection = armapimanagement.AuthorizationProviderCollection{ + // Value: []*armapimanagement.AuthorizationProviderContract{ + // { + // Name: to.Ptr("aadwithauthcode"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithauthcode"), + // Properties: &armapimanagement.AuthorizationProviderContractProperties{ + // DisplayName: to.Ptr("aadwithauthcode"), + // IdentityProvider: to.Ptr("aad"), + // Oauth2: &armapimanagement.AuthorizationProviderOAuth2Settings{ + // GrantTypes: &armapimanagement.AuthorizationProviderOAuth2GrantTypes{ + // AuthorizationCode: map[string]*string{ + // "clientId": to.Ptr("53790825-fdd3-4b80-bc7a-4c3aaf25801d"), + // "loginUri": to.Ptr("https://login.windows.net"), + // "resourceUri": to.Ptr("https://graph.microsoft.com"), + // "scopes": to.Ptr("User.Read.All Group.Read.All"), + // "tenantId": to.Ptr("common"), + // }, + // }, + // RedirectURL: to.Ptr("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1"), + // }, + // }, + // }, + // { + // Name: to.Ptr("aadwithclientcred"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithclientcred"), + // Properties: &armapimanagement.AuthorizationProviderContractProperties{ + // DisplayName: to.Ptr("aadwithclientcred"), + // IdentityProvider: to.Ptr("aad"), + // Oauth2: &armapimanagement.AuthorizationProviderOAuth2Settings{ + // GrantTypes: &armapimanagement.AuthorizationProviderOAuth2GrantTypes{ + // ClientCredentials: map[string]*string{ + // "loginUri": to.Ptr("https://login.windows.net"), + // "resourceUri": to.Ptr("https://graph.microsoft.com"), + // "scopes": to.Ptr("User.Read.All Group.Read.All"), + // "tenantId": to.Ptr("common"), + // }, + // }, + // RedirectURL: to.Ptr("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1"), + // }, + // }, + // }, + // { + // Name: to.Ptr("google"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/google"), + // Properties: &armapimanagement.AuthorizationProviderContractProperties{ + // DisplayName: to.Ptr("google"), + // IdentityProvider: to.Ptr("google"), + // Oauth2: &armapimanagement.AuthorizationProviderOAuth2Settings{ + // GrantTypes: &armapimanagement.AuthorizationProviderOAuth2GrantTypes{ + // AuthorizationCode: map[string]*string{ + // "clientId": to.Ptr("508791967882-5qv6o2i99a75un7329vlegtk78kr766h.apps.googleusercontent.com"), + // "scopes": to.Ptr("openid https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email"), + // }, + // }, + // RedirectURL: to.Ptr("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1"), + // }, + // }, + // }, + // { + // Name: to.Ptr("eventbrite"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/eventbrite"), + // Properties: &armapimanagement.AuthorizationProviderContractProperties{ + // DisplayName: to.Ptr("eventbrite"), + // IdentityProvider: to.Ptr("oauth2"), + // Oauth2: &armapimanagement.AuthorizationProviderOAuth2Settings{ + // GrantTypes: &armapimanagement.AuthorizationProviderOAuth2GrantTypes{ + // AuthorizationCode: map[string]*string{ + // "authorizationUrl": to.Ptr("https://www.eventbrite.com/oauth/authorize"), + // "clientId": to.Ptr("ZYIJTBTABHOUQQDLZY"), + // "refreshUrl": to.Ptr("https://www.eventbrite.com/oauth/token"), + // "scopes": nil, + // "tokenUrl": to.Ptr("https://www.eventbrite.com/oauth/token"), + // }, + // }, + // RedirectURL: to.Ptr("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1"), + // }, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetAuthorizationProvider.json +func ExampleAuthorizationProviderClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAuthorizationProviderClient().Get(ctx, "rg1", "apimService1", "aadwithauthcode", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.AuthorizationProviderContract = armapimanagement.AuthorizationProviderContract{ + // Name: to.Ptr("aadwithauthcode"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithauthcode"), + // Properties: &armapimanagement.AuthorizationProviderContractProperties{ + // DisplayName: to.Ptr("aadwithauthcode"), + // IdentityProvider: to.Ptr("aad"), + // Oauth2: &armapimanagement.AuthorizationProviderOAuth2Settings{ + // GrantTypes: &armapimanagement.AuthorizationProviderOAuth2GrantTypes{ + // AuthorizationCode: map[string]*string{ + // "clientId": to.Ptr("53790825-fdd3-4b80-bc7a-4c3aaf25801d"), + // "loginUri": to.Ptr("https://login.windows.net"), + // "resourceUri": to.Ptr("https://graph.microsoft.com"), + // "scopes": to.Ptr("User.Read.All Group.Read.All"), + // "tenantId": to.Ptr("common"), + // }, + // }, + // RedirectURL: to.Ptr("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateAuthorizationProviderAADAuthCode.json +func ExampleAuthorizationProviderClient_CreateOrUpdate_apiManagementCreateAuthorizationProviderAadAuthCode() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAuthorizationProviderClient().CreateOrUpdate(ctx, "rg1", "apimService1", "aadwithauthcode", armapimanagement.AuthorizationProviderContract{ + Properties: &armapimanagement.AuthorizationProviderContractProperties{ + DisplayName: to.Ptr("aadwithauthcode"), + IdentityProvider: to.Ptr("aad"), + Oauth2: &armapimanagement.AuthorizationProviderOAuth2Settings{ + GrantTypes: &armapimanagement.AuthorizationProviderOAuth2GrantTypes{ + AuthorizationCode: map[string]*string{ + "clientId": to.Ptr("59790825-fdd3-4b10-bc7a-4c3aaf25801d"), + "clientSecret": to.Ptr("Q3iPSaKQ~fZFcJk5vKmqzUAfJagcJ8"), + "resourceUri": to.Ptr("https://graph.microsoft.com"), + "scopes": to.Ptr("User.Read.All Group.Read.All"), + }, + }, + RedirectURL: to.Ptr("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1"), + }, + }, + }, &armapimanagement.AuthorizationProviderClientCreateOrUpdateOptions{IfMatch: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.AuthorizationProviderContract = armapimanagement.AuthorizationProviderContract{ + // Name: to.Ptr("aadwithauthcode"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithauthcode"), + // Properties: &armapimanagement.AuthorizationProviderContractProperties{ + // DisplayName: to.Ptr("aadwithauthcode"), + // IdentityProvider: to.Ptr("aad"), + // Oauth2: &armapimanagement.AuthorizationProviderOAuth2Settings{ + // GrantTypes: &armapimanagement.AuthorizationProviderOAuth2GrantTypes{ + // AuthorizationCode: map[string]*string{ + // "clientId": to.Ptr("53790825-fdd3-4b80-bc7a-4c3aaf25801d"), + // "loginUri": to.Ptr("https://login.windows.net"), + // "resourceUri": to.Ptr("https://graph.microsoft.com"), + // "scopes": to.Ptr("User.Read.All Group.Read.All"), + // "tenantId": to.Ptr("common"), + // }, + // }, + // RedirectURL: to.Ptr("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateAuthorizationProviderAADClientCred.json +func ExampleAuthorizationProviderClient_CreateOrUpdate_apiManagementCreateAuthorizationProviderAadClientCred() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAuthorizationProviderClient().CreateOrUpdate(ctx, "rg1", "apimService1", "aadwithclientcred", armapimanagement.AuthorizationProviderContract{ + Properties: &armapimanagement.AuthorizationProviderContractProperties{ + DisplayName: to.Ptr("aadwithclientcred"), + IdentityProvider: to.Ptr("aad"), + Oauth2: &armapimanagement.AuthorizationProviderOAuth2Settings{ + GrantTypes: &armapimanagement.AuthorizationProviderOAuth2GrantTypes{ + AuthorizationCode: map[string]*string{ + "resourceUri": to.Ptr("https://graph.microsoft.com"), + "scopes": to.Ptr("User.Read.All Group.Read.All"), + }, + }, + RedirectURL: to.Ptr("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1"), + }, + }, + }, &armapimanagement.AuthorizationProviderClientCreateOrUpdateOptions{IfMatch: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.AuthorizationProviderContract = armapimanagement.AuthorizationProviderContract{ + // Name: to.Ptr("aadwithclientcred"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/aadwithclientcred"), + // Properties: &armapimanagement.AuthorizationProviderContractProperties{ + // DisplayName: to.Ptr("aadwithclientcred"), + // IdentityProvider: to.Ptr("aad"), + // Oauth2: &armapimanagement.AuthorizationProviderOAuth2Settings{ + // GrantTypes: &armapimanagement.AuthorizationProviderOAuth2GrantTypes{ + // ClientCredentials: map[string]*string{ + // "loginUri": to.Ptr("https://login.windows.net"), + // "resourceUri": to.Ptr("https://graph.microsoft.com"), + // "scopes": to.Ptr("User.Read.All Group.Read.All"), + // "tenantId": to.Ptr("common"), + // }, + // }, + // RedirectURL: to.Ptr("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateAuthorizationProviderGenericOAuth2.json +func ExampleAuthorizationProviderClient_CreateOrUpdate_apiManagementCreateAuthorizationProviderGenericOAuth2() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAuthorizationProviderClient().CreateOrUpdate(ctx, "rg1", "apimService1", "eventbrite", armapimanagement.AuthorizationProviderContract{ + Properties: &armapimanagement.AuthorizationProviderContractProperties{ + DisplayName: to.Ptr("eventbrite"), + IdentityProvider: to.Ptr("oauth2"), + Oauth2: &armapimanagement.AuthorizationProviderOAuth2Settings{ + GrantTypes: &armapimanagement.AuthorizationProviderOAuth2GrantTypes{ + AuthorizationCode: map[string]*string{ + "authorizationUrl": to.Ptr("https://www.eventbrite.com/oauth/authorize"), + "clientId": to.Ptr("ZYIJTBTABHOUQQDLZY"), + "clientSecret": to.Ptr("Q3iPSaKQ~fZFcJk5vKmqzUAfJagcJ8"), + "refreshUrl": to.Ptr("https://www.eventbrite.com/oauth/token"), + "scopes": nil, + "tokenUrl": to.Ptr("https://www.eventbrite.com/oauth/token"), + }, + }, + RedirectURL: to.Ptr("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1"), + }, + }, + }, &armapimanagement.AuthorizationProviderClientCreateOrUpdateOptions{IfMatch: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.AuthorizationProviderContract = armapimanagement.AuthorizationProviderContract{ + // Name: to.Ptr("eventbrite"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/eventbrite"), + // Properties: &armapimanagement.AuthorizationProviderContractProperties{ + // DisplayName: to.Ptr("eventbrite"), + // IdentityProvider: to.Ptr("oauth2"), + // Oauth2: &armapimanagement.AuthorizationProviderOAuth2Settings{ + // GrantTypes: &armapimanagement.AuthorizationProviderOAuth2GrantTypes{ + // AuthorizationCode: map[string]*string{ + // "authorizationUrl": to.Ptr("https://www.eventbrite.com/oauth/authorize"), + // "clientId": to.Ptr("ZYIJTBTABHOUQQDLZY"), + // "refreshUrl": to.Ptr("https://www.eventbrite.com/oauth/token"), + // "scopes": nil, + // "tokenUrl": to.Ptr("https://www.eventbrite.com/oauth/token"), + // }, + // }, + // RedirectURL: to.Ptr("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateAuthorizationProviderOOBGoogle.json +func ExampleAuthorizationProviderClient_CreateOrUpdate_apiManagementCreateAuthorizationProviderOobGoogle() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewAuthorizationProviderClient().CreateOrUpdate(ctx, "rg1", "apimService1", "google", armapimanagement.AuthorizationProviderContract{ + Properties: &armapimanagement.AuthorizationProviderContractProperties{ + DisplayName: to.Ptr("google"), + IdentityProvider: to.Ptr("google"), + Oauth2: &armapimanagement.AuthorizationProviderOAuth2Settings{ + GrantTypes: &armapimanagement.AuthorizationProviderOAuth2GrantTypes{ + AuthorizationCode: map[string]*string{ + "clientId": to.Ptr("508791967882-5qv6o2i99a75un7329vlegtk78kr766h.apps.googleusercontent.com"), + "clientSecret": to.Ptr("qDN0VyVFjU1OsOyT5Kz8ce"), + "scopes": to.Ptr("openid https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email"), + }, + }, + RedirectURL: to.Ptr("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1"), + }, + }, + }, &armapimanagement.AuthorizationProviderClientCreateOrUpdateOptions{IfMatch: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.AuthorizationProviderContract = armapimanagement.AuthorizationProviderContract{ + // Name: to.Ptr("google"), + // Type: to.Ptr("Microsoft.ApiManagement/service/authorizationProviders"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/authorizationProviders/google"), + // Properties: &armapimanagement.AuthorizationProviderContractProperties{ + // DisplayName: to.Ptr("google"), + // IdentityProvider: to.Ptr("google"), + // Oauth2: &armapimanagement.AuthorizationProviderOAuth2Settings{ + // GrantTypes: &armapimanagement.AuthorizationProviderOAuth2GrantTypes{ + // AuthorizationCode: map[string]*string{ + // "clientId": to.Ptr("508791967882-5qv6o2i99a75un7329vlegtk78kr766h.apps.googleusercontent.com"), + // "scopes": to.Ptr("openid https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email"), + // }, + // }, + // RedirectURL: to.Ptr("https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteAuthorizationProvider.json +func ExampleAuthorizationProviderClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewAuthorizationProviderClient().Delete(ctx, "rg1", "apimService1", "aadwithauthcode", "*", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/authorizationserver_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationserver_client.go index 263824066929..f1c893133834 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/authorizationserver_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationserver_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type AuthorizationServerClient struct { } // NewAuthorizationServerClient creates a new instance of AuthorizationServerClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAuthorizationServerClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AuthorizationServerClient, error) { @@ -49,26 +47,29 @@ func NewAuthorizationServerClient(subscriptionID string, credential azcore.Token // CreateOrUpdate - Creates new authorization server or updates an existing authorization server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - authsid - Identifier of the authorization server. // - parameters - Create or update parameters. // - options - AuthorizationServerClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationServerClient.CreateOrUpdate // method. func (client *AuthorizationServerClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, authsid string, parameters AuthorizationServerContract, options *AuthorizationServerClientCreateOrUpdateOptions) (AuthorizationServerClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, authsid, parameters, options) if err != nil { return AuthorizationServerClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AuthorizationServerClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return AuthorizationServerClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return AuthorizationServerClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -95,13 +96,16 @@ func (client *AuthorizationServerClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -119,8 +123,8 @@ func (client *AuthorizationServerClient) createOrUpdateHandleResponse(resp *http // Delete - Deletes specific authorization server instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - authsid - Identifier of the authorization server. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -128,16 +132,18 @@ func (client *AuthorizationServerClient) createOrUpdateHandleResponse(resp *http // - options - AuthorizationServerClientDeleteOptions contains the optional parameters for the AuthorizationServerClient.Delete // method. func (client *AuthorizationServerClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, authsid string, ifMatch string, options *AuthorizationServerClientDeleteOptions) (AuthorizationServerClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, authsid, ifMatch, options) if err != nil { return AuthorizationServerClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AuthorizationServerClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return AuthorizationServerClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AuthorizationServerClientDeleteResponse{}, err } return AuthorizationServerClientDeleteResponse{}, nil } @@ -166,7 +172,7 @@ func (client *AuthorizationServerClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -176,24 +182,27 @@ func (client *AuthorizationServerClient) deleteCreateRequest(ctx context.Context // Get - Gets the details of the authorization server specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - authsid - Identifier of the authorization server. // - options - AuthorizationServerClientGetOptions contains the optional parameters for the AuthorizationServerClient.Get method. func (client *AuthorizationServerClient) Get(ctx context.Context, resourceGroupName string, serviceName string, authsid string, options *AuthorizationServerClientGetOptions) (AuthorizationServerClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, authsid, options) if err != nil { return AuthorizationServerClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AuthorizationServerClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AuthorizationServerClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AuthorizationServerClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -220,7 +229,7 @@ func (client *AuthorizationServerClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,25 +249,28 @@ func (client *AuthorizationServerClient) getHandleResponse(resp *http.Response) // GetEntityTag - Gets the entity state (Etag) version of the authorizationServer specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - authsid - Identifier of the authorization server. // - options - AuthorizationServerClientGetEntityTagOptions contains the optional parameters for the AuthorizationServerClient.GetEntityTag // method. func (client *AuthorizationServerClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, authsid string, options *AuthorizationServerClientGetEntityTagOptions) (AuthorizationServerClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, authsid, options) if err != nil { return AuthorizationServerClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AuthorizationServerClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AuthorizationServerClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AuthorizationServerClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -285,7 +297,7 @@ func (client *AuthorizationServerClient) getEntityTagCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,8 +315,8 @@ func (client *AuthorizationServerClient) getEntityTagHandleResponse(resp *http.R // NewListByServicePager - Lists a collection of authorization servers defined within a service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - AuthorizationServerClientListByServiceOptions contains the optional parameters for the AuthorizationServerClient.NewListByServicePager // method. @@ -365,7 +377,7 @@ func (client *AuthorizationServerClient) listByServiceCreateRequest(ctx context. if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -383,25 +395,28 @@ func (client *AuthorizationServerClient) listByServiceHandleResponse(resp *http. // ListSecrets - Gets the client secret details of the authorization server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - authsid - Identifier of the authorization server. // - options - AuthorizationServerClientListSecretsOptions contains the optional parameters for the AuthorizationServerClient.ListSecrets // method. func (client *AuthorizationServerClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, authsid string, options *AuthorizationServerClientListSecretsOptions) (AuthorizationServerClientListSecretsResponse, error) { + var err error req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, serviceName, authsid, options) if err != nil { return AuthorizationServerClientListSecretsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AuthorizationServerClientListSecretsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AuthorizationServerClientListSecretsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AuthorizationServerClientListSecretsResponse{}, err } - return client.listSecretsHandleResponse(resp) + resp, err := client.listSecretsHandleResponse(httpResp) + return resp, err } // listSecretsCreateRequest creates the ListSecrets request. @@ -428,7 +443,7 @@ func (client *AuthorizationServerClient) listSecretsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -449,8 +464,8 @@ func (client *AuthorizationServerClient) listSecretsHandleResponse(resp *http.Re // Update - Updates the details of the authorization server specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - authsid - Identifier of the authorization server. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -459,18 +474,21 @@ func (client *AuthorizationServerClient) listSecretsHandleResponse(resp *http.Re // - options - AuthorizationServerClientUpdateOptions contains the optional parameters for the AuthorizationServerClient.Update // method. func (client *AuthorizationServerClient) Update(ctx context.Context, resourceGroupName string, serviceName string, authsid string, ifMatch string, parameters AuthorizationServerUpdateContract, options *AuthorizationServerClientUpdateOptions) (AuthorizationServerClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, authsid, ifMatch, parameters, options) if err != nil { return AuthorizationServerClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AuthorizationServerClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AuthorizationServerClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AuthorizationServerClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -497,11 +515,14 @@ func (client *AuthorizationServerClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/authorizationserver_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationserver_client_example_test.go index e8980a287cb1..d5d97f8cdc5c 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/authorizationserver_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationserver_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListAuthorizationServers.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListAuthorizationServers.json func ExampleAuthorizationServerClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -67,6 +67,8 @@ func ExampleAuthorizationServerClient_NewListByServicePager() { // GrantTypes: []*armapimanagement.GrantType{ // to.Ptr(armapimanagement.GrantTypeAuthorizationCode), // to.Ptr(armapimanagement.GrantTypeImplicit)}, + // UseInAPIDocumentation: to.Ptr(false), + // UseInTestConsole: to.Ptr(true), // }, // }, // { @@ -93,13 +95,15 @@ func ExampleAuthorizationServerClient_NewListByServicePager() { // GrantTypes: []*armapimanagement.GrantType{ // to.Ptr(armapimanagement.GrantTypeAuthorizationCode), // to.Ptr(armapimanagement.GrantTypeImplicit)}, + // UseInAPIDocumentation: to.Ptr(true), + // UseInTestConsole: to.Ptr(false), // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadAuthorizationServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadAuthorizationServer.json func ExampleAuthorizationServerClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -116,7 +120,7 @@ func ExampleAuthorizationServerClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetAuthorizationServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetAuthorizationServer.json func ExampleAuthorizationServerClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -158,11 +162,13 @@ func ExampleAuthorizationServerClient_Get() { // GrantTypes: []*armapimanagement.GrantType{ // to.Ptr(armapimanagement.GrantTypeAuthorizationCode), // to.Ptr(armapimanagement.GrantTypeImplicit)}, + // UseInAPIDocumentation: to.Ptr(true), + // UseInTestConsole: to.Ptr(false), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateAuthorizationServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateAuthorizationServer.json func ExampleAuthorizationServerClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -193,6 +199,8 @@ func ExampleAuthorizationServerClient_CreateOrUpdate() { GrantTypes: []*armapimanagement.GrantType{ to.Ptr(armapimanagement.GrantTypeAuthorizationCode), to.Ptr(armapimanagement.GrantTypeImplicit)}, + UseInAPIDocumentation: to.Ptr(true), + UseInTestConsole: to.Ptr(false), }, }, &armapimanagement.AuthorizationServerClientCreateOrUpdateOptions{IfMatch: nil}) if err != nil { @@ -223,11 +231,13 @@ func ExampleAuthorizationServerClient_CreateOrUpdate() { // GrantTypes: []*armapimanagement.GrantType{ // to.Ptr(armapimanagement.GrantTypeAuthorizationCode), // to.Ptr(armapimanagement.GrantTypeImplicit)}, + // UseInAPIDocumentation: to.Ptr(true), + // UseInTestConsole: to.Ptr(false), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateAuthorizationServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateAuthorizationServer.json func ExampleAuthorizationServerClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -240,8 +250,10 @@ func ExampleAuthorizationServerClient_Update() { } res, err := clientFactory.NewAuthorizationServerClient().Update(ctx, "rg1", "apimService1", "newauthServer", "*", armapimanagement.AuthorizationServerUpdateContract{ Properties: &armapimanagement.AuthorizationServerUpdateContractProperties{ - ClientID: to.Ptr("update"), - ClientSecret: to.Ptr("updated"), + ClientID: to.Ptr("update"), + ClientSecret: to.Ptr("updated"), + UseInAPIDocumentation: to.Ptr(true), + UseInTestConsole: to.Ptr(false), }, }, nil) if err != nil { @@ -274,11 +286,13 @@ func ExampleAuthorizationServerClient_Update() { // GrantTypes: []*armapimanagement.GrantType{ // to.Ptr(armapimanagement.GrantTypeAuthorizationCode), // to.Ptr(armapimanagement.GrantTypeImplicit)}, + // UseInAPIDocumentation: to.Ptr(true), + // UseInTestConsole: to.Ptr(false), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteAuthorizationServer.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteAuthorizationServer.json func ExampleAuthorizationServerClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -295,7 +309,7 @@ func ExampleAuthorizationServerClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementAuthorizationServerListSecrets.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementAuthorizationServerListSecrets.json func ExampleAuthorizationServerClient_ListSecrets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/autorest.md b/sdk/resourcemanager/apimanagement/armapimanagement/autorest.md index 86050977612c..fc52bca010ba 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/autorest.md +++ b/sdk/resourcemanager/apimanagement/armapimanagement/autorest.md @@ -5,8 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.1 +module-version: 2.0.0 +tag: package-2022-08 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/backend_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/backend_client.go index fcaf88b0aac3..159d8095ff83 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/backend_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/backend_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type BackendClient struct { } // NewBackendClient creates a new instance of BackendClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewBackendClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackendClient, error) { @@ -49,25 +47,28 @@ func NewBackendClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates or Updates a backend. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance. // - parameters - Create parameters. // - options - BackendClientCreateOrUpdateOptions contains the optional parameters for the BackendClient.CreateOrUpdate method. func (client *BackendClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, backendID string, parameters BackendContract, options *BackendClientCreateOrUpdateOptions) (BackendClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, backendID, parameters, options) if err != nil { return BackendClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackendClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return BackendClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return BackendClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -94,13 +95,16 @@ func (client *BackendClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -118,24 +122,26 @@ func (client *BackendClient) createOrUpdateHandleResponse(resp *http.Response) ( // Delete - Deletes the specified backend. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - options - BackendClientDeleteOptions contains the optional parameters for the BackendClient.Delete method. func (client *BackendClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, backendID string, ifMatch string, options *BackendClientDeleteOptions) (BackendClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, backendID, ifMatch, options) if err != nil { return BackendClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackendClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return BackendClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return BackendClientDeleteResponse{}, err } return BackendClientDeleteResponse{}, nil } @@ -164,7 +170,7 @@ func (client *BackendClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -174,24 +180,27 @@ func (client *BackendClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets the details of the backend specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance. // - options - BackendClientGetOptions contains the optional parameters for the BackendClient.Get method. func (client *BackendClient) Get(ctx context.Context, resourceGroupName string, serviceName string, backendID string, options *BackendClientGetOptions) (BackendClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, backendID, options) if err != nil { return BackendClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackendClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackendClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackendClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -218,7 +227,7 @@ func (client *BackendClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,24 +247,27 @@ func (client *BackendClient) getHandleResponse(resp *http.Response) (BackendClie // GetEntityTag - Gets the entity state (Etag) version of the backend specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance. // - options - BackendClientGetEntityTagOptions contains the optional parameters for the BackendClient.GetEntityTag method. func (client *BackendClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, backendID string, options *BackendClientGetEntityTagOptions) (BackendClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, backendID, options) if err != nil { return BackendClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackendClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackendClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackendClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -282,7 +294,7 @@ func (client *BackendClient) getEntityTagCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -300,8 +312,8 @@ func (client *BackendClient) getEntityTagHandleResponse(resp *http.Response) (Ba // NewListByServicePager - Lists a collection of backends in the specified service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - BackendClientListByServiceOptions contains the optional parameters for the BackendClient.NewListByServicePager // method. @@ -362,7 +374,7 @@ func (client *BackendClient) listByServiceCreateRequest(ctx context.Context, res if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -377,26 +389,28 @@ func (client *BackendClient) listByServiceHandleResponse(resp *http.Response) (B return result, nil } -// Reconnect - Notifies the APIM proxy to create a new connection to the backend after the specified timeout. If no timeout -// was specified, timeout of 2 minutes is used. +// Reconnect - Notifies the API Management gateway to create a new connection to the backend after the specified timeout. +// If no timeout was specified, timeout of 2 minutes is used. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance. // - options - BackendClientReconnectOptions contains the optional parameters for the BackendClient.Reconnect method. func (client *BackendClient) Reconnect(ctx context.Context, resourceGroupName string, serviceName string, backendID string, options *BackendClientReconnectOptions) (BackendClientReconnectResponse, error) { + var err error req, err := client.reconnectCreateRequest(ctx, resourceGroupName, serviceName, backendID, options) if err != nil { return BackendClientReconnectResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackendClientReconnectResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return BackendClientReconnectResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return BackendClientReconnectResponse{}, err } return BackendClientReconnectResponse{}, nil } @@ -425,11 +439,14 @@ func (client *BackendClient) reconnectCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) + if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -437,8 +454,8 @@ func (client *BackendClient) reconnectCreateRequest(ctx context.Context, resourc // Update - Updates an existing backend. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -446,18 +463,21 @@ func (client *BackendClient) reconnectCreateRequest(ctx context.Context, resourc // - parameters - Update parameters. // - options - BackendClientUpdateOptions contains the optional parameters for the BackendClient.Update method. func (client *BackendClient) Update(ctx context.Context, resourceGroupName string, serviceName string, backendID string, ifMatch string, parameters BackendUpdateParameters, options *BackendClientUpdateOptions) (BackendClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, backendID, ifMatch, parameters, options) if err != nil { return BackendClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackendClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackendClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackendClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -484,11 +504,14 @@ func (client *BackendClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/backend_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/backend_client_example_test.go index f0eb11db11de..a25353dc84b0 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/backend_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/backend_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListBackends.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListBackends.json func ExampleBackendClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -109,7 +109,7 @@ func ExampleBackendClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadBackend.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadBackend.json func ExampleBackendClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -126,7 +126,7 @@ func ExampleBackendClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetBackend.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetBackend.json func ExampleBackendClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -169,7 +169,7 @@ func ExampleBackendClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateBackendProxyBackend.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateBackendProxyBackend.json func ExampleBackendClient_CreateOrUpdate_apiManagementCreateBackendProxyBackend() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -257,7 +257,7 @@ func ExampleBackendClient_CreateOrUpdate_apiManagementCreateBackendProxyBackend( // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateBackendServiceFabric.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateBackendServiceFabric.json func ExampleBackendClient_CreateOrUpdate_apiManagementCreateBackendServiceFabric() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -319,7 +319,7 @@ func ExampleBackendClient_CreateOrUpdate_apiManagementCreateBackendServiceFabric // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateBackend.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateBackend.json func ExampleBackendClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -383,7 +383,7 @@ func ExampleBackendClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteBackend.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteBackend.json func ExampleBackendClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -400,7 +400,7 @@ func ExampleBackendClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementBackendReconnect.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementBackendReconnect.json func ExampleBackendClient_Reconnect() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/cache_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/cache_client.go index 6bb3ca7877a8..343fbbc2ccfc 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/cache_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/cache_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type CacheClient struct { } // NewCacheClient creates a new instance of CacheClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewCacheClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CacheClient, error) { @@ -49,25 +47,28 @@ func NewCacheClient(subscriptionID string, credential azcore.TokenCredential, op // CreateOrUpdate - Creates or updates an External Cache to be used in Api Management instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). // - parameters - Create or Update parameters. // - options - CacheClientCreateOrUpdateOptions contains the optional parameters for the CacheClient.CreateOrUpdate method. func (client *CacheClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, parameters CacheContract, options *CacheClientCreateOrUpdateOptions) (CacheClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, cacheID, parameters, options) if err != nil { return CacheClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CacheClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return CacheClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return CacheClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -94,13 +95,16 @@ func (client *CacheClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -118,24 +122,26 @@ func (client *CacheClient) createOrUpdateHandleResponse(resp *http.Response) (Ca // Delete - Deletes specific Cache. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - options - CacheClientDeleteOptions contains the optional parameters for the CacheClient.Delete method. func (client *CacheClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, ifMatch string, options *CacheClientDeleteOptions) (CacheClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, cacheID, ifMatch, options) if err != nil { return CacheClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CacheClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return CacheClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return CacheClientDeleteResponse{}, err } return CacheClientDeleteResponse{}, nil } @@ -164,7 +170,7 @@ func (client *CacheClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -174,24 +180,27 @@ func (client *CacheClient) deleteCreateRequest(ctx context.Context, resourceGrou // Get - Gets the details of the Cache specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). // - options - CacheClientGetOptions contains the optional parameters for the CacheClient.Get method. func (client *CacheClient) Get(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, options *CacheClientGetOptions) (CacheClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, cacheID, options) if err != nil { return CacheClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CacheClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CacheClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CacheClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -218,7 +227,7 @@ func (client *CacheClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,24 +247,27 @@ func (client *CacheClient) getHandleResponse(resp *http.Response) (CacheClientGe // GetEntityTag - Gets the entity state (Etag) version of the Cache specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). // - options - CacheClientGetEntityTagOptions contains the optional parameters for the CacheClient.GetEntityTag method. func (client *CacheClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, options *CacheClientGetEntityTagOptions) (CacheClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, cacheID, options) if err != nil { return CacheClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CacheClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CacheClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CacheClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -282,7 +294,7 @@ func (client *CacheClient) getEntityTagCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -300,8 +312,8 @@ func (client *CacheClient) getEntityTagHandleResponse(resp *http.Response) (Cach // NewListByServicePager - Lists a collection of all external Caches in the specified service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - CacheClientListByServiceOptions contains the optional parameters for the CacheClient.NewListByServicePager method. func (client *CacheClient) NewListByServicePager(resourceGroupName string, serviceName string, options *CacheClientListByServiceOptions) *runtime.Pager[CacheClientListByServiceResponse] { @@ -358,7 +370,7 @@ func (client *CacheClient) listByServiceCreateRequest(ctx context.Context, resou if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -376,8 +388,8 @@ func (client *CacheClient) listByServiceHandleResponse(resp *http.Response) (Cac // Update - Updates the details of the cache specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -385,18 +397,21 @@ func (client *CacheClient) listByServiceHandleResponse(resp *http.Response) (Cac // - parameters - Update parameters. // - options - CacheClientUpdateOptions contains the optional parameters for the CacheClient.Update method. func (client *CacheClient) Update(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, ifMatch string, parameters CacheUpdateParameters, options *CacheClientUpdateOptions) (CacheClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, cacheID, ifMatch, parameters, options) if err != nil { return CacheClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CacheClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CacheClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CacheClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -423,11 +438,14 @@ func (client *CacheClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/cache_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/cache_client_example_test.go index adecf6ca9a86..c628a17f90e0 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/cache_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/cache_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListCaches.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListCaches.json func ExampleCacheClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -60,7 +60,7 @@ func ExampleCacheClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadCache.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadCache.json func ExampleCacheClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -77,7 +77,7 @@ func ExampleCacheClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetCache.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetCache.json func ExampleCacheClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -108,7 +108,7 @@ func ExampleCacheClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateCache.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateCache.json func ExampleCacheClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -146,7 +146,7 @@ func ExampleCacheClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateCache.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateCache.json func ExampleCacheClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -181,7 +181,7 @@ func ExampleCacheClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteCache.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteCache.json func ExampleCacheClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/certificate_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/certificate_client.go index 4486b90ab0fc..a99157ff678f 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/certificate_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/certificate_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type CertificateClient struct { } // NewCertificateClient creates a new instance of CertificateClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewCertificateClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CertificateClient, error) { @@ -49,26 +47,29 @@ func NewCertificateClient(subscriptionID string, credential azcore.TokenCredenti // CreateOrUpdate - Creates or updates the certificate being used for authentication with the backend. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. // - parameters - Create or Update parameters. // - options - CertificateClientCreateOrUpdateOptions contains the optional parameters for the CertificateClient.CreateOrUpdate // method. func (client *CertificateClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, parameters CertificateCreateOrUpdateParameters, options *CertificateClientCreateOrUpdateOptions) (CertificateClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, certificateID, parameters, options) if err != nil { return CertificateClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CertificateClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return CertificateClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return CertificateClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -95,13 +96,16 @@ func (client *CertificateClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -119,24 +123,26 @@ func (client *CertificateClient) createOrUpdateHandleResponse(resp *http.Respons // Delete - Deletes specific certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - options - CertificateClientDeleteOptions contains the optional parameters for the CertificateClient.Delete method. func (client *CertificateClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, ifMatch string, options *CertificateClientDeleteOptions) (CertificateClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, certificateID, ifMatch, options) if err != nil { return CertificateClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CertificateClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return CertificateClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return CertificateClientDeleteResponse{}, err } return CertificateClientDeleteResponse{}, nil } @@ -165,7 +171,7 @@ func (client *CertificateClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -175,24 +181,27 @@ func (client *CertificateClient) deleteCreateRequest(ctx context.Context, resour // Get - Gets the details of the certificate specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. // - options - CertificateClientGetOptions contains the optional parameters for the CertificateClient.Get method. func (client *CertificateClient) Get(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, options *CertificateClientGetOptions) (CertificateClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, certificateID, options) if err != nil { return CertificateClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CertificateClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CertificateClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CertificateClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -219,7 +228,7 @@ func (client *CertificateClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -239,25 +248,28 @@ func (client *CertificateClient) getHandleResponse(resp *http.Response) (Certifi // GetEntityTag - Gets the entity state (Etag) version of the certificate specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. // - options - CertificateClientGetEntityTagOptions contains the optional parameters for the CertificateClient.GetEntityTag // method. func (client *CertificateClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, options *CertificateClientGetEntityTagOptions) (CertificateClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, certificateID, options) if err != nil { return CertificateClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CertificateClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CertificateClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CertificateClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -284,7 +296,7 @@ func (client *CertificateClient) getEntityTagCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -302,8 +314,8 @@ func (client *CertificateClient) getEntityTagHandleResponse(resp *http.Response) // NewListByServicePager - Lists a collection of all certificates in the specified service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - CertificateClientListByServiceOptions contains the optional parameters for the CertificateClient.NewListByServicePager // method. @@ -367,7 +379,7 @@ func (client *CertificateClient) listByServiceCreateRequest(ctx context.Context, if options != nil && options.IsKeyVaultRefreshFailed != nil { reqQP.Set("isKeyVaultRefreshFailed", strconv.FormatBool(*options.IsKeyVaultRefreshFailed)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,25 +397,28 @@ func (client *CertificateClient) listByServiceHandleResponse(resp *http.Response // RefreshSecret - From KeyVault, Refresh the certificate being used for authentication with the backend. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. // - options - CertificateClientRefreshSecretOptions contains the optional parameters for the CertificateClient.RefreshSecret // method. func (client *CertificateClient) RefreshSecret(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, options *CertificateClientRefreshSecretOptions) (CertificateClientRefreshSecretResponse, error) { + var err error req, err := client.refreshSecretCreateRequest(ctx, resourceGroupName, serviceName, certificateID, options) if err != nil { return CertificateClientRefreshSecretResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CertificateClientRefreshSecretResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CertificateClientRefreshSecretResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CertificateClientRefreshSecretResponse{}, err } - return client.refreshSecretHandleResponse(resp) + resp, err := client.refreshSecretHandleResponse(httpResp) + return resp, err } // refreshSecretCreateRequest creates the RefreshSecret request. @@ -430,7 +445,7 @@ func (client *CertificateClient) refreshSecretCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/certificate_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/certificate_client_example_test.go index f206c3d2c305..2af076b9d3af 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/certificate_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/certificate_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListCertificates.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListCertificates.json func ExampleCertificateClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -79,7 +79,7 @@ func ExampleCertificateClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadCertificate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadCertificate.json func ExampleCertificateClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -96,7 +96,7 @@ func ExampleCertificateClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetCertificate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetCertificate.json func ExampleCertificateClient_Get_apiManagementGetCertificate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -126,7 +126,7 @@ func ExampleCertificateClient_Get_apiManagementGetCertificate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetCertificateWithKeyVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetCertificateWithKeyVault.json func ExampleCertificateClient_Get_apiManagementGetCertificateWithKeyVault() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -164,7 +164,7 @@ func ExampleCertificateClient_Get_apiManagementGetCertificateWithKeyVault() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateCertificate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateCertificate.json func ExampleCertificateClient_CreateOrUpdate_apiManagementCreateCertificate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -199,7 +199,7 @@ func ExampleCertificateClient_CreateOrUpdate_apiManagementCreateCertificate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateCertificateWithKeyVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateCertificateWithKeyVault.json func ExampleCertificateClient_CreateOrUpdate_apiManagementCreateCertificateWithKeyVault() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -244,7 +244,7 @@ func ExampleCertificateClient_CreateOrUpdate_apiManagementCreateCertificateWithK // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteCertificate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteCertificate.json func ExampleCertificateClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -261,7 +261,7 @@ func ExampleCertificateClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementRefreshCertificate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementRefreshCertificate.json func ExampleCertificateClient_RefreshSecret() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/client.go b/sdk/resourcemanager/apimanagement/armapimanagement/client.go index 52f289bf8026..bda62a95d1c6 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type Client struct { } // NewClient creates a new instance of Client with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error) { @@ -49,8 +47,8 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // and returns metrics for the connection, as well as errors encountered while trying to establish it. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - connectivityCheckRequestParams - Connectivity Check request parameters. // - options - ClientBeginPerformConnectivityCheckAsyncOptions contains the optional parameters for the Client.BeginPerformConnectivityCheckAsync @@ -61,9 +59,10 @@ func (client *Client) BeginPerformConnectivityCheckAsync(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClientPerformConnectivityCheckAsyncResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ClientPerformConnectivityCheckAsyncResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ClientPerformConnectivityCheckAsyncResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,20 +72,22 @@ func (client *Client) BeginPerformConnectivityCheckAsync(ctx context.Context, re // and returns metrics for the connection, as well as errors encountered while trying to establish it. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *Client) performConnectivityCheckAsync(ctx context.Context, resourceGroupName string, serviceName string, connectivityCheckRequestParams ConnectivityCheckRequest, options *ClientBeginPerformConnectivityCheckAsyncOptions) (*http.Response, error) { + var err error req, err := client.performConnectivityCheckAsyncCreateRequest(ctx, resourceGroupName, serviceName, connectivityCheckRequestParams, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // performConnectivityCheckAsyncCreateRequest creates the PerformConnectivityCheckAsync request. @@ -109,8 +110,11 @@ func (client *Client) performConnectivityCheckAsyncCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, connectivityCheckRequestParams) + if err := runtime.MarshalAsJSON(req, connectivityCheckRequestParams); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/client_example_test.go index 6216a2ff60a9..46f6e79cbe9c 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPerformConnectivityCheckHttpConnect.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementPerformConnectivityCheckHttpConnect.json func ExampleClient_BeginPerformConnectivityCheckAsync_httpConnectivityCheck() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -40,7 +40,7 @@ func ExampleClient_BeginPerformConnectivityCheckAsync_httpConnectivityCheck() { Headers: []*armapimanagement.HTTPHeader{ { Name: to.Ptr("Authorization"), - Value: to.Ptr("Bearer myPreciousToken"), + Value: to.Ptr("******"), }}, ValidStatusCodes: []*int64{ to.Ptr[int64](200), @@ -92,7 +92,7 @@ func ExampleClient_BeginPerformConnectivityCheckAsync_httpConnectivityCheck() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPerformConnectivityCheck.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementPerformConnectivityCheck.json func ExampleClient_BeginPerformConnectivityCheckAsync_tcpConnectivityCheck() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/client_factory.go b/sdk/resourcemanager/apimanagement/armapimanagement/client_factory.go index b3570c576ab1..ce0e5fd52e2c 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/client_factory.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/client_factory.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -24,8 +23,7 @@ type ClientFactory struct { // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { @@ -44,13 +42,28 @@ func (c *ClientFactory) NewAPIClient() *APIClient { return subClient } -func (c *ClientFactory) NewAPIRevisionClient() *APIRevisionClient { - subClient, _ := NewAPIRevisionClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAPIDiagnosticClient() *APIDiagnosticClient { + subClient, _ := NewAPIDiagnosticClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAPIReleaseClient() *APIReleaseClient { - subClient, _ := NewAPIReleaseClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAPIExportClient() *APIExportClient { + subClient, _ := NewAPIExportClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAPIIssueAttachmentClient() *APIIssueAttachmentClient { + subClient, _ := NewAPIIssueAttachmentClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAPIIssueClient() *APIIssueClient { + subClient, _ := NewAPIIssueClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAPIIssueCommentClient() *APIIssueCommentClient { + subClient, _ := NewAPIIssueCommentClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -64,8 +77,8 @@ func (c *ClientFactory) NewAPIOperationPolicyClient() *APIOperationPolicyClient return subClient } -func (c *ClientFactory) NewTagClient() *TagClient { - subClient, _ := NewTagClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAPIPolicyClient() *APIPolicyClient { + subClient, _ := NewAPIPolicyClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -74,8 +87,13 @@ func (c *ClientFactory) NewAPIProductClient() *APIProductClient { return subClient } -func (c *ClientFactory) NewAPIPolicyClient() *APIPolicyClient { - subClient, _ := NewAPIPolicyClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAPIReleaseClient() *APIReleaseClient { + subClient, _ := NewAPIReleaseClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAPIRevisionClient() *APIRevisionClient { + subClient, _ := NewAPIRevisionClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -84,43 +102,43 @@ func (c *ClientFactory) NewAPISchemaClient() *APISchemaClient { return subClient } -func (c *ClientFactory) NewAPIDiagnosticClient() *APIDiagnosticClient { - subClient, _ := NewAPIDiagnosticClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAPITagDescriptionClient() *APITagDescriptionClient { + subClient, _ := NewAPITagDescriptionClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAPIIssueClient() *APIIssueClient { - subClient, _ := NewAPIIssueClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAPIVersionSetClient() *APIVersionSetClient { + subClient, _ := NewAPIVersionSetClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAPIIssueCommentClient() *APIIssueCommentClient { - subClient, _ := NewAPIIssueCommentClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAPIWikiClient() *APIWikiClient { + subClient, _ := NewAPIWikiClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAPIIssueAttachmentClient() *APIIssueAttachmentClient { - subClient, _ := NewAPIIssueAttachmentClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAPIWikisClient() *APIWikisClient { + subClient, _ := NewAPIWikisClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAPITagDescriptionClient() *APITagDescriptionClient { - subClient, _ := NewAPITagDescriptionClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAuthorizationAccessPolicyClient() *AuthorizationAccessPolicyClient { + subClient, _ := NewAuthorizationAccessPolicyClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewOperationClient() *OperationClient { - subClient, _ := NewOperationClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAuthorizationClient() *AuthorizationClient { + subClient, _ := NewAuthorizationClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAPIExportClient() *APIExportClient { - subClient, _ := NewAPIExportClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAuthorizationLoginLinksClient() *AuthorizationLoginLinksClient { + subClient, _ := NewAuthorizationLoginLinksClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAPIVersionSetClient() *APIVersionSetClient { - subClient, _ := NewAPIVersionSetClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAuthorizationProviderClient() *AuthorizationProviderClient { + subClient, _ := NewAuthorizationProviderClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -149,13 +167,18 @@ func (c *ClientFactory) NewClient() *Client { return subClient } +func (c *ClientFactory) NewContentItemClient() *ContentItemClient { + subClient, _ := NewContentItemClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewContentTypeClient() *ContentTypeClient { subClient, _ := NewContentTypeClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewContentItemClient() *ContentItemClient { - subClient, _ := NewContentItemClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDelegationSettingsClient() *DelegationSettingsClient { + subClient, _ := NewDelegationSettingsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -164,28 +187,28 @@ func (c *ClientFactory) NewDeletedServicesClient() *DeletedServicesClient { return subClient } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) +func (c *ClientFactory) NewDiagnosticClient() *DiagnosticClient { + subClient, _ := NewDiagnosticClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServiceSKUsClient() *ServiceSKUsClient { - subClient, _ := NewServiceSKUsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDocumentationClient() *DocumentationClient { + subClient, _ := NewDocumentationClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServiceClient() *ServiceClient { - subClient, _ := NewServiceClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewEmailTemplateClient() *EmailTemplateClient { + subClient, _ := NewEmailTemplateClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDiagnosticClient() *DiagnosticClient { - subClient, _ := NewDiagnosticClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGatewayAPIClient() *GatewayAPIClient { + subClient, _ := NewGatewayAPIClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewEmailTemplateClient() *EmailTemplateClient { - subClient, _ := NewEmailTemplateClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGatewayCertificateAuthorityClient() *GatewayCertificateAuthorityClient { + subClient, _ := NewGatewayCertificateAuthorityClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -199,13 +222,18 @@ func (c *ClientFactory) NewGatewayHostnameConfigurationClient() *GatewayHostname return subClient } -func (c *ClientFactory) NewGatewayAPIClient() *GatewayAPIClient { - subClient, _ := NewGatewayAPIClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGlobalSchemaClient() *GlobalSchemaClient { + subClient, _ := NewGlobalSchemaClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewGatewayCertificateAuthorityClient() *GatewayCertificateAuthorityClient { - subClient, _ := NewGatewayCertificateAuthorityClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGraphQLAPIResolverClient() *GraphQLAPIResolverClient { + subClient, _ := NewGraphQLAPIResolverClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewGraphQLAPIResolverPolicyClient() *GraphQLAPIResolverPolicyClient { + subClient, _ := NewGraphQLAPIResolverPolicyClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -249,13 +277,13 @@ func (c *ClientFactory) NewNotificationClient() *NotificationClient { return subClient } -func (c *ClientFactory) NewNotificationRecipientUserClient() *NotificationRecipientUserClient { - subClient, _ := NewNotificationRecipientUserClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewNotificationRecipientEmailClient() *NotificationRecipientEmailClient { + subClient, _ := NewNotificationRecipientEmailClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewNotificationRecipientEmailClient() *NotificationRecipientEmailClient { - subClient, _ := NewNotificationRecipientEmailClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewNotificationRecipientUserClient() *NotificationRecipientUserClient { + subClient, _ := NewNotificationRecipientUserClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -264,6 +292,16 @@ func (c *ClientFactory) NewOpenIDConnectProviderClient() *OpenIDConnectProviderC return subClient } +func (c *ClientFactory) NewOperationClient() *OperationClient { + subClient, _ := NewOperationClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewOutboundNetworkDependenciesEndpointsClient() *OutboundNetworkDependenciesEndpointsClient { subClient, _ := NewOutboundNetworkDependenciesEndpointsClient(c.subscriptionID, c.credential, c.options) return subClient @@ -279,33 +317,33 @@ func (c *ClientFactory) NewPolicyDescriptionClient() *PolicyDescriptionClient { return subClient } -func (c *ClientFactory) NewPortalRevisionClient() *PortalRevisionClient { - subClient, _ := NewPortalRevisionClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPolicyFragmentClient() *PolicyFragmentClient { + subClient, _ := NewPolicyFragmentClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewPortalSettingsClient() *PortalSettingsClient { - subClient, _ := NewPortalSettingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPortalConfigClient() *PortalConfigClient { + subClient, _ := NewPortalConfigClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSignInSettingsClient() *SignInSettingsClient { - subClient, _ := NewSignInSettingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPortalRevisionClient() *PortalRevisionClient { + subClient, _ := NewPortalRevisionClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSignUpSettingsClient() *SignUpSettingsClient { - subClient, _ := NewSignUpSettingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPortalSettingsClient() *PortalSettingsClient { + subClient, _ := NewPortalSettingsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDelegationSettingsClient() *DelegationSettingsClient { - subClient, _ := NewDelegationSettingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPrivateEndpointConnectionClient() *PrivateEndpointConnectionClient { + subClient, _ := NewPrivateEndpointConnectionClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewPrivateEndpointConnectionClient() *PrivateEndpointConnectionClient { - subClient, _ := NewPrivateEndpointConnectionClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewProductAPIClient() *ProductAPIClient { + subClient, _ := NewProductAPIClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -314,13 +352,13 @@ func (c *ClientFactory) NewProductClient() *ProductClient { return subClient } -func (c *ClientFactory) NewProductAPIClient() *ProductAPIClient { - subClient, _ := NewProductAPIClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewProductGroupClient() *ProductGroupClient { + subClient, _ := NewProductGroupClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewProductGroupClient() *ProductGroupClient { - subClient, _ := NewProductGroupClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewProductPolicyClient() *ProductPolicyClient { + subClient, _ := NewProductPolicyClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -329,8 +367,13 @@ func (c *ClientFactory) NewProductSubscriptionsClient() *ProductSubscriptionsCli return subClient } -func (c *ClientFactory) NewProductPolicyClient() *ProductPolicyClient { - subClient, _ := NewProductPolicyClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewProductWikiClient() *ProductWikiClient { + subClient, _ := NewProductWikiClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewProductWikisClient() *ProductWikisClient { + subClient, _ := NewProductWikisClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -354,18 +397,28 @@ func (c *ClientFactory) NewReportsClient() *ReportsClient { return subClient } -func (c *ClientFactory) NewGlobalSchemaClient() *GlobalSchemaClient { - subClient, _ := NewGlobalSchemaClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSKUsClient() *SKUsClient { + subClient, _ := NewSKUsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewTenantSettingsClient() *TenantSettingsClient { - subClient, _ := NewTenantSettingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServiceClient() *ServiceClient { + subClient, _ := NewServiceClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSKUsClient() *SKUsClient { - subClient, _ := NewSKUsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServiceSKUsClient() *ServiceSKUsClient { + subClient, _ := NewServiceSKUsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewSignInSettingsClient() *SignInSettingsClient { + subClient, _ := NewSignInSettingsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewSignUpSettingsClient() *SignUpSettingsClient { + subClient, _ := NewSignUpSettingsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -374,6 +427,11 @@ func (c *ClientFactory) NewSubscriptionClient() *SubscriptionClient { return subClient } +func (c *ClientFactory) NewTagClient() *TagClient { + subClient, _ := NewTagClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewTagResourceClient() *TagResourceClient { subClient, _ := NewTagResourceClient(c.subscriptionID, c.credential, c.options) return subClient @@ -394,18 +452,23 @@ func (c *ClientFactory) NewTenantConfigurationClient() *TenantConfigurationClien return subClient } +func (c *ClientFactory) NewTenantSettingsClient() *TenantSettingsClient { + subClient, _ := NewTenantSettingsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewUserClient() *UserClient { subClient, _ := NewUserClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewUserGroupClient() *UserGroupClient { - subClient, _ := NewUserGroupClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewUserConfirmationPasswordClient() *UserConfirmationPasswordClient { + subClient, _ := NewUserConfirmationPasswordClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewUserSubscriptionClient() *UserSubscriptionClient { - subClient, _ := NewUserSubscriptionClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewUserGroupClient() *UserGroupClient { + subClient, _ := NewUserGroupClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -414,7 +477,7 @@ func (c *ClientFactory) NewUserIdentitiesClient() *UserIdentitiesClient { return subClient } -func (c *ClientFactory) NewUserConfirmationPasswordClient() *UserConfirmationPasswordClient { - subClient, _ := NewUserConfirmationPasswordClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewUserSubscriptionClient() *UserSubscriptionClient { + subClient, _ := NewUserSubscriptionClient(c.subscriptionID, c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/constants.go b/sdk/resourcemanager/apimanagement/armapimanagement/constants.go index cc723d26d67d..598fcebf0707 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/constants.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/constants.go @@ -3,15 +3,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement const ( moduleName = "armapimanagement" - moduleVersion = "v1.1.1" + moduleVersion = "v2.0.0" ) // APIManagementSKUCapacityScaleType - The scale type applicable to the sku. @@ -36,15 +35,15 @@ func PossibleAPIManagementSKUCapacityScaleTypeValues() []APIManagementSKUCapacit type APIManagementSKURestrictionsReasonCode string const ( - APIManagementSKURestrictionsReasonCodeQuotaID APIManagementSKURestrictionsReasonCode = "QuotaId" APIManagementSKURestrictionsReasonCodeNotAvailableForSubscription APIManagementSKURestrictionsReasonCode = "NotAvailableForSubscription" + APIManagementSKURestrictionsReasonCodeQuotaID APIManagementSKURestrictionsReasonCode = "QuotaId" ) // PossibleAPIManagementSKURestrictionsReasonCodeValues returns the possible values for the APIManagementSKURestrictionsReasonCode const type. func PossibleAPIManagementSKURestrictionsReasonCodeValues() []APIManagementSKURestrictionsReasonCode { return []APIManagementSKURestrictionsReasonCode{ - APIManagementSKURestrictionsReasonCodeQuotaID, APIManagementSKURestrictionsReasonCodeNotAvailableForSubscription, + APIManagementSKURestrictionsReasonCodeQuotaID, } } @@ -89,8 +88,11 @@ func PossibleAPITypeValues() []APIType { type APIVersionSetContractDetailsVersioningScheme string const ( - APIVersionSetContractDetailsVersioningSchemeHeader APIVersionSetContractDetailsVersioningScheme = "Header" - APIVersionSetContractDetailsVersioningSchemeQuery APIVersionSetContractDetailsVersioningScheme = "Query" + // APIVersionSetContractDetailsVersioningSchemeHeader - The API Version is passed in a HTTP header. + APIVersionSetContractDetailsVersioningSchemeHeader APIVersionSetContractDetailsVersioningScheme = "Header" + // APIVersionSetContractDetailsVersioningSchemeQuery - The API Version is passed in a query parameter. + APIVersionSetContractDetailsVersioningSchemeQuery APIVersionSetContractDetailsVersioningScheme = "Query" + // APIVersionSetContractDetailsVersioningSchemeSegment - The API Version is passed in a path segment. APIVersionSetContractDetailsVersioningSchemeSegment APIVersionSetContractDetailsVersioningScheme = "Segment" ) @@ -197,46 +199,81 @@ func PossibleAppTypeValues() []AppType { type AsyncOperationStatus string const ( - AsyncOperationStatusStarted AsyncOperationStatus = "Started" + AsyncOperationStatusFailed AsyncOperationStatus = "Failed" AsyncOperationStatusInProgress AsyncOperationStatus = "InProgress" + AsyncOperationStatusStarted AsyncOperationStatus = "Started" AsyncOperationStatusSucceeded AsyncOperationStatus = "Succeeded" - AsyncOperationStatusFailed AsyncOperationStatus = "Failed" ) // PossibleAsyncOperationStatusValues returns the possible values for the AsyncOperationStatus const type. func PossibleAsyncOperationStatusValues() []AsyncOperationStatus { return []AsyncOperationStatus{ - AsyncOperationStatusStarted, + AsyncOperationStatusFailed, AsyncOperationStatusInProgress, + AsyncOperationStatusStarted, AsyncOperationStatusSucceeded, - AsyncOperationStatusFailed, + } +} + +// AsyncResolverStatus - Status of an async resolver. +type AsyncResolverStatus string + +const ( + AsyncResolverStatusFailed AsyncResolverStatus = "Failed" + AsyncResolverStatusInProgress AsyncResolverStatus = "InProgress" + AsyncResolverStatusStarted AsyncResolverStatus = "Started" + AsyncResolverStatusSucceeded AsyncResolverStatus = "Succeeded" +) + +// PossibleAsyncResolverStatusValues returns the possible values for the AsyncResolverStatus const type. +func PossibleAsyncResolverStatusValues() []AsyncResolverStatus { + return []AsyncResolverStatus{ + AsyncResolverStatusFailed, + AsyncResolverStatusInProgress, + AsyncResolverStatusStarted, + AsyncResolverStatusSucceeded, } } type AuthorizationMethod string const ( + AuthorizationMethodDELETE AuthorizationMethod = "DELETE" + AuthorizationMethodGET AuthorizationMethod = "GET" AuthorizationMethodHEAD AuthorizationMethod = "HEAD" AuthorizationMethodOPTIONS AuthorizationMethod = "OPTIONS" - AuthorizationMethodTRACE AuthorizationMethod = "TRACE" - AuthorizationMethodGET AuthorizationMethod = "GET" + AuthorizationMethodPATCH AuthorizationMethod = "PATCH" AuthorizationMethodPOST AuthorizationMethod = "POST" AuthorizationMethodPUT AuthorizationMethod = "PUT" - AuthorizationMethodPATCH AuthorizationMethod = "PATCH" - AuthorizationMethodDELETE AuthorizationMethod = "DELETE" + AuthorizationMethodTRACE AuthorizationMethod = "TRACE" ) // PossibleAuthorizationMethodValues returns the possible values for the AuthorizationMethod const type. func PossibleAuthorizationMethodValues() []AuthorizationMethod { return []AuthorizationMethod{ + AuthorizationMethodDELETE, + AuthorizationMethodGET, AuthorizationMethodHEAD, AuthorizationMethodOPTIONS, - AuthorizationMethodTRACE, - AuthorizationMethodGET, + AuthorizationMethodPATCH, AuthorizationMethodPOST, AuthorizationMethodPUT, - AuthorizationMethodPATCH, - AuthorizationMethodDELETE, + AuthorizationMethodTRACE, + } +} + +// AuthorizationType - Authorization type options +type AuthorizationType string + +const ( + // AuthorizationTypeOAuth2 - OAuth2 authorization type + AuthorizationTypeOAuth2 AuthorizationType = "OAuth2" +) + +// PossibleAuthorizationTypeValues returns the possible values for the AuthorizationType const type. +func PossibleAuthorizationTypeValues() []AuthorizationType { + return []AuthorizationType{ + AuthorizationTypeOAuth2, } } @@ -627,16 +664,16 @@ type GroupType string const ( GroupTypeCustom GroupType = "custom" - GroupTypeSystem GroupType = "system" GroupTypeExternal GroupType = "external" + GroupTypeSystem GroupType = "system" ) // PossibleGroupTypeValues returns the possible values for the GroupType const type. func PossibleGroupTypeValues() []GroupType { return []GroupType{ GroupTypeCustom, - GroupTypeSystem, GroupTypeExternal, + GroupTypeSystem, } } @@ -801,17 +838,35 @@ func PossibleMethodValues() []Method { type NameAvailabilityReason string const ( - NameAvailabilityReasonValid NameAvailabilityReason = "Valid" - NameAvailabilityReasonInvalid NameAvailabilityReason = "Invalid" NameAvailabilityReasonAlreadyExists NameAvailabilityReason = "AlreadyExists" + NameAvailabilityReasonInvalid NameAvailabilityReason = "Invalid" + NameAvailabilityReasonValid NameAvailabilityReason = "Valid" ) // PossibleNameAvailabilityReasonValues returns the possible values for the NameAvailabilityReason const type. func PossibleNameAvailabilityReasonValues() []NameAvailabilityReason { return []NameAvailabilityReason{ - NameAvailabilityReasonValid, - NameAvailabilityReasonInvalid, NameAvailabilityReasonAlreadyExists, + NameAvailabilityReasonInvalid, + NameAvailabilityReasonValid, + } +} + +// NatGatewayState - Property can be used to enable NAT Gateway for this API Management service. +type NatGatewayState string + +const ( + // NatGatewayStateDisabled - Nat Gateway is disabled for the service. + NatGatewayStateDisabled NatGatewayState = "Disabled" + // NatGatewayStateEnabled - Nat Gateway is enabled for the service. + NatGatewayStateEnabled NatGatewayState = "Enabled" +) + +// PossibleNatGatewayStateValues returns the possible values for the NatGatewayState const type. +func PossibleNatGatewayStateValues() []NatGatewayState { + return []NatGatewayState{ + NatGatewayStateDisabled, + NatGatewayStateEnabled, } } @@ -853,6 +908,24 @@ func PossibleNotificationNameValues() []NotificationName { } } +// OAuth2GrantType - OAuth2 grant type options +type OAuth2GrantType string + +const ( + // OAuth2GrantTypeAuthorizationCode - Authorization Code grant + OAuth2GrantTypeAuthorizationCode OAuth2GrantType = "AuthorizationCode" + // OAuth2GrantTypeClientCredentials - Client Credential grant + OAuth2GrantTypeClientCredentials OAuth2GrantType = "ClientCredentials" +) + +// PossibleOAuth2GrantTypeValues returns the possible values for the OAuth2GrantType const type. +func PossibleOAuth2GrantTypeValues() []OAuth2GrantType { + return []OAuth2GrantType{ + OAuth2GrantTypeAuthorizationCode, + OAuth2GrantTypeClientCredentials, + } +} + // OperationNameFormat - The format of the Operation Name for Application Insights telemetries. Default is Name. type OperationNameFormat string @@ -919,12 +992,12 @@ type PolicyContentFormat string const ( // PolicyContentFormatRawxml - The contents are inline and Content type is a non XML encoded policy document. PolicyContentFormatRawxml PolicyContentFormat = "rawxml" - // PolicyContentFormatRawxmlLink - The policy document is not Xml encoded and is hosted on a http endpoint accessible from + // PolicyContentFormatRawxmlLink - The policy document is not XML encoded and is hosted on a HTTP endpoint accessible from // the API Management service. PolicyContentFormatRawxmlLink PolicyContentFormat = "rawxml-link" // PolicyContentFormatXML - The contents are inline and Content type is an XML document. PolicyContentFormatXML PolicyContentFormat = "xml" - // PolicyContentFormatXMLLink - The policy XML document is hosted on a http endpoint accessible from the API Management service. + // PolicyContentFormatXMLLink - The policy XML document is hosted on a HTTP endpoint accessible from the API Management service. PolicyContentFormatXMLLink PolicyContentFormat = "xml-link" ) @@ -955,6 +1028,23 @@ func PossiblePolicyExportFormatValues() []PolicyExportFormat { } } +type PolicyFragmentContentFormat string + +const ( + // PolicyFragmentContentFormatRawxml - The contents are inline and Content type is a non XML encoded policy document. + PolicyFragmentContentFormatRawxml PolicyFragmentContentFormat = "rawxml" + // PolicyFragmentContentFormatXML - The contents are inline and Content type is an XML document. + PolicyFragmentContentFormatXML PolicyFragmentContentFormat = "xml" +) + +// PossiblePolicyFragmentContentFormatValues returns the possible values for the PolicyFragmentContentFormat const type. +func PossiblePolicyFragmentContentFormatValues() []PolicyFragmentContentFormat { + return []PolicyFragmentContentFormat{ + PolicyFragmentContentFormatRawxml, + PolicyFragmentContentFormatXML, + } +} + type PolicyIDName string const ( @@ -971,21 +1061,21 @@ func PossiblePolicyIDNameValues() []PolicyIDName { type PolicyScopeContract string const ( - PolicyScopeContractTenant PolicyScopeContract = "Tenant" - PolicyScopeContractProduct PolicyScopeContract = "Product" PolicyScopeContractAPI PolicyScopeContract = "Api" - PolicyScopeContractOperation PolicyScopeContract = "Operation" PolicyScopeContractAll PolicyScopeContract = "All" + PolicyScopeContractOperation PolicyScopeContract = "Operation" + PolicyScopeContractProduct PolicyScopeContract = "Product" + PolicyScopeContractTenant PolicyScopeContract = "Tenant" ) // PossiblePolicyScopeContractValues returns the possible values for the PolicyScopeContract const type. func PossiblePolicyScopeContractValues() []PolicyScopeContract { return []PolicyScopeContract{ - PolicyScopeContractTenant, - PolicyScopeContractProduct, PolicyScopeContractAPI, - PolicyScopeContractOperation, PolicyScopeContractAll, + PolicyScopeContractOperation, + PolicyScopeContractProduct, + PolicyScopeContractTenant, } } @@ -1013,6 +1103,27 @@ func PossiblePortalRevisionStatusValues() []PortalRevisionStatus { } } +// PortalSettingsCspMode - The mode of the developer portal Content Security Policy (CSP). +type PortalSettingsCspMode string + +const ( + // PortalSettingsCspModeDisabled - The browser will not apply the origin restrictions. + PortalSettingsCspModeDisabled PortalSettingsCspMode = "disabled" + // PortalSettingsCspModeEnabled - The browser will block requests not matching allowed origins. + PortalSettingsCspModeEnabled PortalSettingsCspMode = "enabled" + // PortalSettingsCspModeReportOnly - The browser will report requests not matching allowed origins without blocking them. + PortalSettingsCspModeReportOnly PortalSettingsCspMode = "reportOnly" +) + +// PossiblePortalSettingsCspModeValues returns the possible values for the PortalSettingsCspMode const type. +func PossiblePortalSettingsCspModeValues() []PortalSettingsCspMode { + return []PortalSettingsCspMode{ + PortalSettingsCspModeDisabled, + PortalSettingsCspModeEnabled, + PortalSettingsCspModeReportOnly, + } +} + // PreferredIPVersion - The IP version to be used. Only IPv4 is supported for now. type PreferredIPVersion string @@ -1192,7 +1303,7 @@ type SchemaType string const ( // SchemaTypeJSON - Json schema type. SchemaTypeJSON SchemaType = "json" - // SchemaTypeXML - Xml schema type. + // SchemaTypeXML - XML schema type. SchemaTypeXML SchemaType = "xml" ) @@ -1297,23 +1408,23 @@ func PossibleStateValues() []State { type SubscriptionState string const ( - SubscriptionStateSuspended SubscriptionState = "suspended" SubscriptionStateActive SubscriptionState = "active" + SubscriptionStateCancelled SubscriptionState = "cancelled" SubscriptionStateExpired SubscriptionState = "expired" - SubscriptionStateSubmitted SubscriptionState = "submitted" SubscriptionStateRejected SubscriptionState = "rejected" - SubscriptionStateCancelled SubscriptionState = "cancelled" + SubscriptionStateSubmitted SubscriptionState = "submitted" + SubscriptionStateSuspended SubscriptionState = "suspended" ) // PossibleSubscriptionStateValues returns the possible values for the SubscriptionState const type. func PossibleSubscriptionStateValues() []SubscriptionState { return []SubscriptionState{ - SubscriptionStateSuspended, SubscriptionStateActive, + SubscriptionStateCancelled, SubscriptionStateExpired, - SubscriptionStateSubmitted, SubscriptionStateRejected, - SubscriptionStateCancelled, + SubscriptionStateSubmitted, + SubscriptionStateSuspended, } } @@ -1356,6 +1467,25 @@ func PossibleTemplateNameValues() []TemplateName { } } +// TranslateRequiredQueryParametersConduct - Strategy of translating required query parameters to template ones. By default +// has value 'template'. Possible values: 'template', 'query' +type TranslateRequiredQueryParametersConduct string + +const ( + // TranslateRequiredQueryParametersConductQuery - Leaves required query parameters as they are (no translation done). + TranslateRequiredQueryParametersConductQuery TranslateRequiredQueryParametersConduct = "query" + // TranslateRequiredQueryParametersConductTemplate - Translates required query parameters to template ones. Is a default value + TranslateRequiredQueryParametersConductTemplate TranslateRequiredQueryParametersConduct = "template" +) + +// PossibleTranslateRequiredQueryParametersConductValues returns the possible values for the TranslateRequiredQueryParametersConduct const type. +func PossibleTranslateRequiredQueryParametersConductValues() []TranslateRequiredQueryParametersConduct { + return []TranslateRequiredQueryParametersConduct{ + TranslateRequiredQueryParametersConductQuery, + TranslateRequiredQueryParametersConductTemplate, + } +} + // UserState - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer // portal or call any APIs of subscribed products. Default state is Active. type UserState string diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/contentitem_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/contentitem_client.go index dda05a01863b..8840f9354caa 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/contentitem_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/contentitem_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type ContentItemClient struct { } // NewContentItemClient creates a new instance of ContentItemClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewContentItemClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContentItemClient, error) { @@ -48,30 +46,34 @@ func NewContentItemClient(subscriptionID string, credential azcore.TokenCredenti // CreateOrUpdate - Creates a new developer portal's content item specified by the provided content type. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - contentTypeID - Content type identifier. // - contentItemID - Content item identifier. +// - parameters - Create or update parameters. // - options - ContentItemClientCreateOrUpdateOptions contains the optional parameters for the ContentItemClient.CreateOrUpdate // method. -func (client *ContentItemClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, contentItemID string, options *ContentItemClientCreateOrUpdateOptions) (ContentItemClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, contentTypeID, contentItemID, options) +func (client *ContentItemClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, contentItemID string, parameters ContentItemContract, options *ContentItemClientCreateOrUpdateOptions) (ContentItemClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, contentTypeID, contentItemID, parameters, options) if err != nil { return ContentItemClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ContentItemClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ContentItemClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ContentItemClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ContentItemClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, contentItemID string, options *ContentItemClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ContentItemClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, contentItemID string, parameters ContentItemContract, options *ContentItemClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -98,12 +100,15 @@ func (client *ContentItemClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } return req, nil } @@ -122,8 +127,8 @@ func (client *ContentItemClient) createOrUpdateHandleResponse(resp *http.Respons // Delete - Removes the specified developer portal's content item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - contentTypeID - Content type identifier. // - contentItemID - Content item identifier. @@ -131,16 +136,18 @@ func (client *ContentItemClient) createOrUpdateHandleResponse(resp *http.Respons // it should be * for unconditional update. // - options - ContentItemClientDeleteOptions contains the optional parameters for the ContentItemClient.Delete method. func (client *ContentItemClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, contentItemID string, ifMatch string, options *ContentItemClientDeleteOptions) (ContentItemClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, contentTypeID, contentItemID, ifMatch, options) if err != nil { return ContentItemClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ContentItemClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ContentItemClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ContentItemClientDeleteResponse{}, err } return ContentItemClientDeleteResponse{}, nil } @@ -173,7 +180,7 @@ func (client *ContentItemClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -183,25 +190,28 @@ func (client *ContentItemClient) deleteCreateRequest(ctx context.Context, resour // Get - Returns the developer portal's content item specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - contentTypeID - Content type identifier. // - contentItemID - Content item identifier. // - options - ContentItemClientGetOptions contains the optional parameters for the ContentItemClient.Get method. func (client *ContentItemClient) Get(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, contentItemID string, options *ContentItemClientGetOptions) (ContentItemClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, contentTypeID, contentItemID, options) if err != nil { return ContentItemClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ContentItemClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ContentItemClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ContentItemClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -232,7 +242,7 @@ func (client *ContentItemClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,26 +262,29 @@ func (client *ContentItemClient) getHandleResponse(resp *http.Response) (Content // GetEntityTag - Returns the entity state (ETag) version of the developer portal's content item specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - contentTypeID - Content type identifier. // - contentItemID - Content item identifier. // - options - ContentItemClientGetEntityTagOptions contains the optional parameters for the ContentItemClient.GetEntityTag // method. func (client *ContentItemClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, contentItemID string, options *ContentItemClientGetEntityTagOptions) (ContentItemClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, contentTypeID, contentItemID, options) if err != nil { return ContentItemClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ContentItemClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ContentItemClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ContentItemClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -302,7 +315,7 @@ func (client *ContentItemClient) getEntityTagCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -320,8 +333,8 @@ func (client *ContentItemClient) getEntityTagHandleResponse(resp *http.Response) // NewListByServicePager - Lists developer portal's content items specified by the provided content type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - contentTypeID - Content type identifier. // - options - ContentItemClientListByServiceOptions contains the optional parameters for the ContentItemClient.NewListByServicePager @@ -378,7 +391,7 @@ func (client *ContentItemClient) listByServiceCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/contentitem_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/contentitem_client_example_test.go index bd06584698bd..34bcacaab9ff 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/contentitem_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/contentitem_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListContentTypeContentItems.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListContentTypeContentItems.json func ExampleContentItemClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -59,7 +59,7 @@ func ExampleContentItemClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadContentTypeContentItem.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadContentTypeContentItem.json func ExampleContentItemClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -76,7 +76,7 @@ func ExampleContentItemClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetContentTypeContentItem.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetContentTypeContentItem.json func ExampleContentItemClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -110,7 +110,7 @@ func ExampleContentItemClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateContentTypeContentItem.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateContentTypeContentItem.json func ExampleContentItemClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -121,7 +121,17 @@ func ExampleContentItemClient_CreateOrUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewContentItemClient().CreateOrUpdate(ctx, "rg1", "apimService1", "page", "4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8", &armapimanagement.ContentItemClientCreateOrUpdateOptions{IfMatch: nil}) + res, err := clientFactory.NewContentItemClient().CreateOrUpdate(ctx, "rg1", "apimService1", "page", "4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8", armapimanagement.ContentItemContract{ + Properties: map[string]any{ + "en_us": map[string]any{ + "description": "Short story about the company.", + "documentId": "contentTypes/document/contentItems/4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8", + "keywords": "company, about", + "permalink": "/about", + "title": "About", + }, + }, + }, &armapimanagement.ContentItemClientCreateOrUpdateOptions{IfMatch: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -144,7 +154,7 @@ func ExampleContentItemClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteContentTypeContentItem.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteContentTypeContentItem.json func ExampleContentItemClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/contenttype_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/contenttype_client.go index 5b29d4ef419e..9be6a9949c76 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/contenttype_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/contenttype_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type ContentTypeClient struct { } // NewContentTypeClient creates a new instance of ContentTypeClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewContentTypeClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContentTypeClient, error) { @@ -50,29 +48,33 @@ func NewContentTypeClient(subscriptionID string, credential azcore.TokenCredenti // prefix. Built-in content types can't be modified. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - contentTypeID - Content type identifier. +// - parameters - Create or update parameters. // - options - ContentTypeClientCreateOrUpdateOptions contains the optional parameters for the ContentTypeClient.CreateOrUpdate // method. -func (client *ContentTypeClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, options *ContentTypeClientCreateOrUpdateOptions) (ContentTypeClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, contentTypeID, options) +func (client *ContentTypeClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, parameters ContentTypeContract, options *ContentTypeClientCreateOrUpdateOptions) (ContentTypeClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, contentTypeID, parameters, options) if err != nil { return ContentTypeClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ContentTypeClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ContentTypeClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ContentTypeClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ContentTypeClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, options *ContentTypeClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ContentTypeClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, parameters ContentTypeContract, options *ContentTypeClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -95,12 +97,15 @@ func (client *ContentTypeClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } return req, nil } @@ -121,24 +126,26 @@ func (client *ContentTypeClient) createOrUpdateHandleResponse(resp *http.Respons // c- prefix) can't be removed. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - contentTypeID - Content type identifier. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - options - ContentTypeClientDeleteOptions contains the optional parameters for the ContentTypeClient.Delete method. func (client *ContentTypeClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, ifMatch string, options *ContentTypeClientDeleteOptions) (ContentTypeClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, contentTypeID, ifMatch, options) if err != nil { return ContentTypeClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ContentTypeClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ContentTypeClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ContentTypeClientDeleteResponse{}, err } return ContentTypeClientDeleteResponse{}, nil } @@ -167,7 +174,7 @@ func (client *ContentTypeClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -178,24 +185,27 @@ func (client *ContentTypeClient) deleteCreateRequest(ctx context.Context, resour // rules, and constraints. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - contentTypeID - Content type identifier. // - options - ContentTypeClientGetOptions contains the optional parameters for the ContentTypeClient.Get method. func (client *ContentTypeClient) Get(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, options *ContentTypeClientGetOptions) (ContentTypeClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, contentTypeID, options) if err != nil { return ContentTypeClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ContentTypeClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ContentTypeClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ContentTypeClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -222,7 +232,7 @@ func (client *ContentTypeClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -243,8 +253,8 @@ func (client *ContentTypeClient) getHandleResponse(resp *http.Response) (Content // NewListByServicePager - Lists the developer portal's content types. Content types describe content items' properties, validation // rules, and constraints. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - ContentTypeClientListByServiceOptions contains the optional parameters for the ContentTypeClient.NewListByServicePager // method. @@ -296,7 +306,7 @@ func (client *ContentTypeClient) listByServiceCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/contenttype_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/contenttype_client_example_test.go index 57a72218213d..39afa9dcbe8a 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/contenttype_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/contenttype_client_example_test.go @@ -13,11 +13,12 @@ import ( "context" "log" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListContentTypes.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListContentTypes.json func ExampleContentTypeClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -100,7 +101,7 @@ func ExampleContentTypeClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetContentType.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetContentType.json func ExampleContentTypeClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -175,7 +176,7 @@ func ExampleContentTypeClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateContentType.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateContentType.json func ExampleContentTypeClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -186,7 +187,58 @@ func ExampleContentTypeClient_CreateOrUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewContentTypeClient().CreateOrUpdate(ctx, "rg1", "apimService1", "page", &armapimanagement.ContentTypeClientCreateOrUpdateOptions{IfMatch: nil}) + res, err := clientFactory.NewContentTypeClient().CreateOrUpdate(ctx, "rg1", "apimService1", "page", armapimanagement.ContentTypeContract{ + Properties: &armapimanagement.ContentTypeContractProperties{ + Name: to.Ptr("Page"), + Schema: map[string]any{ + "additionalProperties": false, + "properties": map[string]any{ + "en_us": map[string]any{ + "type": "object", + "additionalProperties": false, + "properties": map[string]any{ + "description": map[string]any{ + "type": "string", + "description": "Page description. This property gets included in SEO attributes.", + "indexed": true, + "title": "Description", + }, + "documentId": map[string]any{ + "type": "string", + "description": "Reference to page content document.", + "title": "Document ID", + }, + "keywords": map[string]any{ + "type": "string", + "description": "Page keywords. This property gets included in SEO attributes.", + "indexed": true, + "title": "Keywords", + }, + "permalink": map[string]any{ + "type": "string", + "description": "Page permalink, e.g. '/about'.", + "indexed": true, + "title": "Permalink", + }, + "title": map[string]any{ + "type": "string", + "description": "Page title. This property gets included in SEO attributes.", + "indexed": true, + "title": "Title", + }, + }, + "required": []any{ + "title", + "permalink", + "documentId", + }, + }, + }, + }, + Description: to.Ptr("A regular page"), + Version: to.Ptr("1.0.0"), + }, + }, &armapimanagement.ContentTypeClientCreateOrUpdateOptions{IfMatch: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -250,7 +302,7 @@ func ExampleContentTypeClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteContentType.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteContentType.json func ExampleContentTypeClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/delegationsettings_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/delegationsettings_client.go index dcb54f63916d..8a46784f6052 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/delegationsettings_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/delegationsettings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type DelegationSettingsClient struct { } // NewDelegationSettingsClient creates a new instance of DelegationSettingsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewDelegationSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DelegationSettingsClient, error) { @@ -48,25 +46,28 @@ func NewDelegationSettingsClient(subscriptionID string, credential azcore.TokenC // CreateOrUpdate - Create or Update Delegation settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - parameters - Create or update parameters. // - options - DelegationSettingsClientCreateOrUpdateOptions contains the optional parameters for the DelegationSettingsClient.CreateOrUpdate // method. func (client *DelegationSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalDelegationSettings, options *DelegationSettingsClientCreateOrUpdateOptions) (DelegationSettingsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, parameters, options) if err != nil { return DelegationSettingsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DelegationSettingsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DelegationSettingsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DelegationSettingsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -89,13 +90,16 @@ func (client *DelegationSettingsClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -110,23 +114,26 @@ func (client *DelegationSettingsClient) createOrUpdateHandleResponse(resp *http. // Get - Get Delegation Settings for the Portal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - DelegationSettingsClientGetOptions contains the optional parameters for the DelegationSettingsClient.Get method. func (client *DelegationSettingsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *DelegationSettingsClientGetOptions) (DelegationSettingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return DelegationSettingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DelegationSettingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DelegationSettingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DelegationSettingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -149,7 +156,7 @@ func (client *DelegationSettingsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -169,24 +176,27 @@ func (client *DelegationSettingsClient) getHandleResponse(resp *http.Response) ( // GetEntityTag - Gets the entity state (Etag) version of the DelegationSettings. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - DelegationSettingsClientGetEntityTagOptions contains the optional parameters for the DelegationSettingsClient.GetEntityTag // method. func (client *DelegationSettingsClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, options *DelegationSettingsClientGetEntityTagOptions) (DelegationSettingsClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return DelegationSettingsClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DelegationSettingsClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DelegationSettingsClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DelegationSettingsClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -209,7 +219,7 @@ func (client *DelegationSettingsClient) getEntityTagCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -228,24 +238,27 @@ func (client *DelegationSettingsClient) getEntityTagHandleResponse(resp *http.Re // ListSecrets - Gets the secret validation key of the DelegationSettings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - DelegationSettingsClientListSecretsOptions contains the optional parameters for the DelegationSettingsClient.ListSecrets // method. func (client *DelegationSettingsClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, options *DelegationSettingsClientListSecretsOptions) (DelegationSettingsClientListSecretsResponse, error) { + var err error req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return DelegationSettingsClientListSecretsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DelegationSettingsClientListSecretsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DelegationSettingsClientListSecretsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DelegationSettingsClientListSecretsResponse{}, err } - return client.listSecretsHandleResponse(resp) + resp, err := client.listSecretsHandleResponse(httpResp) + return resp, err } // listSecretsCreateRequest creates the ListSecrets request. @@ -268,7 +281,7 @@ func (client *DelegationSettingsClient) listSecretsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -286,8 +299,8 @@ func (client *DelegationSettingsClient) listSecretsHandleResponse(resp *http.Res // Update - Update Delegation settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. @@ -295,16 +308,18 @@ func (client *DelegationSettingsClient) listSecretsHandleResponse(resp *http.Res // - options - DelegationSettingsClientUpdateOptions contains the optional parameters for the DelegationSettingsClient.Update // method. func (client *DelegationSettingsClient) Update(ctx context.Context, resourceGroupName string, serviceName string, ifMatch string, parameters PortalDelegationSettings, options *DelegationSettingsClientUpdateOptions) (DelegationSettingsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, ifMatch, parameters, options) if err != nil { return DelegationSettingsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DelegationSettingsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return DelegationSettingsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return DelegationSettingsClientUpdateResponse{}, err } return DelegationSettingsClientUpdateResponse{}, nil } @@ -329,9 +344,12 @@ func (client *DelegationSettingsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/delegationsettings_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/delegationsettings_client_example_test.go index 6e0ba8d6b537..7aa1eecb2cb8 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/delegationsettings_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/delegationsettings_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadDelegationSettings.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadDelegationSettings.json func ExampleDelegationSettingsClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -35,7 +35,7 @@ func ExampleDelegationSettingsClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsGetDelegation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementPortalSettingsGetDelegation.json func ExampleDelegationSettingsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -69,7 +69,7 @@ func ExampleDelegationSettingsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsUpdateDelegation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementPortalSettingsUpdateDelegation.json func ExampleDelegationSettingsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -97,7 +97,7 @@ func ExampleDelegationSettingsClient_Update() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsPutDelegation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementPortalSettingsPutDelegation.json func ExampleDelegationSettingsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -142,7 +142,7 @@ func ExampleDelegationSettingsClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSecretsPortalSettingsValidationKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListSecretsPortalSettingsValidationKey.json func ExampleDelegationSettingsClient_ListSecrets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/deletedservices_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/deletedservices_client.go index 1256ee9e4113..ba3e2c468dcb 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/deletedservices_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/deletedservices_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type DeletedServicesClient struct { } // NewDeletedServicesClient creates a new instance of DeletedServicesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewDeletedServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeletedServicesClient, error) { @@ -48,24 +46,27 @@ func NewDeletedServicesClient(subscriptionID string, credential azcore.TokenCred // GetByName - Get soft-deleted Api Management Service by name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 // - serviceName - The name of the API Management service. // - location - The location of the deleted API Management service. // - options - DeletedServicesClientGetByNameOptions contains the optional parameters for the DeletedServicesClient.GetByName // method. func (client *DeletedServicesClient) GetByName(ctx context.Context, serviceName string, location string, options *DeletedServicesClientGetByNameOptions) (DeletedServicesClientGetByNameResponse, error) { + var err error req, err := client.getByNameCreateRequest(ctx, serviceName, location, options) if err != nil { return DeletedServicesClientGetByNameResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DeletedServicesClientGetByNameResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DeletedServicesClientGetByNameResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DeletedServicesClientGetByNameResponse{}, err } - return client.getByNameHandleResponse(resp) + resp, err := client.getByNameHandleResponse(httpResp) + return resp, err } // getByNameCreateRequest creates the GetByName request. @@ -88,7 +89,7 @@ func (client *DeletedServicesClient) getByNameCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -105,7 +106,7 @@ func (client *DeletedServicesClient) getByNameHandleResponse(resp *http.Response // NewListBySubscriptionPager - Lists all soft-deleted services available for undelete for the given subscription. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 // - options - DeletedServicesClientListBySubscriptionOptions contains the optional parameters for the DeletedServicesClient.NewListBySubscriptionPager // method. func (client *DeletedServicesClient) NewListBySubscriptionPager(options *DeletedServicesClientListBySubscriptionOptions) *runtime.Pager[DeletedServicesClientListBySubscriptionResponse] { @@ -148,7 +149,7 @@ func (client *DeletedServicesClient) listBySubscriptionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -166,7 +167,7 @@ func (client *DeletedServicesClient) listBySubscriptionHandleResponse(resp *http // BeginPurge - Purges Api Management Service (deletes it with no option to undelete). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 // - serviceName - The name of the API Management service. // - location - The location of the deleted API Management service. // - options - DeletedServicesClientBeginPurgeOptions contains the optional parameters for the DeletedServicesClient.BeginPurge @@ -177,9 +178,10 @@ func (client *DeletedServicesClient) BeginPurge(ctx context.Context, serviceName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeletedServicesClientPurgeResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeletedServicesClientPurgeResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[DeletedServicesClientPurgeResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -188,20 +190,22 @@ func (client *DeletedServicesClient) BeginPurge(ctx context.Context, serviceName // Purge - Purges Api Management Service (deletes it with no option to undelete). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *DeletedServicesClient) purge(ctx context.Context, serviceName string, location string, options *DeletedServicesClientBeginPurgeOptions) (*http.Response, error) { + var err error req, err := client.purgeCreateRequest(ctx, serviceName, location, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // purgeCreateRequest creates the Purge request. @@ -224,7 +228,7 @@ func (client *DeletedServicesClient) purgeCreateRequest(ctx context.Context, ser return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/deletedservices_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/deletedservices_client_example_test.go index fad2f8b72f6e..26f10c1a052f 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/deletedservices_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/deletedservices_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletedServicesListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeletedServicesListBySubscription.json func ExampleDeletedServicesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -67,7 +67,7 @@ func ExampleDeletedServicesClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetDeletedServiceByName.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetDeletedServiceByName.json func ExampleDeletedServicesClient_GetByName() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -98,7 +98,7 @@ func ExampleDeletedServicesClient_GetByName() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletedServicesPurge.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeletedServicesPurge.json func ExampleDeletedServicesClient_BeginPurge() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/diagnostic_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/diagnostic_client.go index a55cdec6059a..cf076a677af5 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/diagnostic_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/diagnostic_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type DiagnosticClient struct { } // NewDiagnosticClient creates a new instance of DiagnosticClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewDiagnosticClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiagnosticClient, error) { @@ -49,26 +47,29 @@ func NewDiagnosticClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Creates a new Diagnostic or updates an existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. // - parameters - Create parameters. // - options - DiagnosticClientCreateOrUpdateOptions contains the optional parameters for the DiagnosticClient.CreateOrUpdate // method. func (client *DiagnosticClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, parameters DiagnosticContract, options *DiagnosticClientCreateOrUpdateOptions) (DiagnosticClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, diagnosticID, parameters, options) if err != nil { return DiagnosticClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DiagnosticClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return DiagnosticClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return DiagnosticClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -95,13 +96,16 @@ func (client *DiagnosticClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -119,24 +123,26 @@ func (client *DiagnosticClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes the specified Diagnostic. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - options - DiagnosticClientDeleteOptions contains the optional parameters for the DiagnosticClient.Delete method. func (client *DiagnosticClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, ifMatch string, options *DiagnosticClientDeleteOptions) (DiagnosticClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, diagnosticID, ifMatch, options) if err != nil { return DiagnosticClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DiagnosticClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return DiagnosticClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return DiagnosticClientDeleteResponse{}, err } return DiagnosticClientDeleteResponse{}, nil } @@ -165,7 +171,7 @@ func (client *DiagnosticClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -175,24 +181,27 @@ func (client *DiagnosticClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets the details of the Diagnostic specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. // - options - DiagnosticClientGetOptions contains the optional parameters for the DiagnosticClient.Get method. func (client *DiagnosticClient) Get(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, options *DiagnosticClientGetOptions) (DiagnosticClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, diagnosticID, options) if err != nil { return DiagnosticClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DiagnosticClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DiagnosticClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DiagnosticClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -219,7 +228,7 @@ func (client *DiagnosticClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -239,24 +248,27 @@ func (client *DiagnosticClient) getHandleResponse(resp *http.Response) (Diagnost // GetEntityTag - Gets the entity state (Etag) version of the Diagnostic specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. // - options - DiagnosticClientGetEntityTagOptions contains the optional parameters for the DiagnosticClient.GetEntityTag method. func (client *DiagnosticClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, options *DiagnosticClientGetEntityTagOptions) (DiagnosticClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, diagnosticID, options) if err != nil { return DiagnosticClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DiagnosticClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DiagnosticClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DiagnosticClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -283,7 +295,7 @@ func (client *DiagnosticClient) getEntityTagCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -301,8 +313,8 @@ func (client *DiagnosticClient) getEntityTagHandleResponse(resp *http.Response) // NewListByServicePager - Lists all diagnostics of the API Management service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - DiagnosticClientListByServiceOptions contains the optional parameters for the DiagnosticClient.NewListByServicePager // method. @@ -363,7 +375,7 @@ func (client *DiagnosticClient) listByServiceCreateRequest(ctx context.Context, if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -381,8 +393,8 @@ func (client *DiagnosticClient) listByServiceHandleResponse(resp *http.Response) // Update - Updates the details of the Diagnostic specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -390,18 +402,21 @@ func (client *DiagnosticClient) listByServiceHandleResponse(resp *http.Response) // - parameters - Diagnostic Update parameters. // - options - DiagnosticClientUpdateOptions contains the optional parameters for the DiagnosticClient.Update method. func (client *DiagnosticClient) Update(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, ifMatch string, parameters DiagnosticContract, options *DiagnosticClientUpdateOptions) (DiagnosticClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, diagnosticID, ifMatch, parameters, options) if err != nil { return DiagnosticClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DiagnosticClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DiagnosticClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DiagnosticClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -428,11 +443,14 @@ func (client *DiagnosticClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/diagnostic_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/diagnostic_client_example_test.go index f0842e8682d0..42c26be8cb1b 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/diagnostic_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/diagnostic_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListDiagnostics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListDiagnostics.json func ExampleDiagnosticClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -111,7 +111,7 @@ func ExampleDiagnosticClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadDiagnostic.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadDiagnostic.json func ExampleDiagnosticClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -128,7 +128,7 @@ func ExampleDiagnosticClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetDiagnostic.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetDiagnostic.json func ExampleDiagnosticClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -195,7 +195,7 @@ func ExampleDiagnosticClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateDiagnostic.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateDiagnostic.json func ExampleDiagnosticClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -301,7 +301,7 @@ func ExampleDiagnosticClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateDiagnostic.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateDiagnostic.json func ExampleDiagnosticClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -409,7 +409,7 @@ func ExampleDiagnosticClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteDiagnostic.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteDiagnostic.json func ExampleDiagnosticClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/documentation_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/documentation_client.go new file mode 100644 index 000000000000..2d9eacad5211 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/documentation_client.go @@ -0,0 +1,467 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armapimanagement + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// DocumentationClient contains the methods for the Documentation group. +// Don't use this type directly, use NewDocumentationClient() instead. +type DocumentationClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDocumentationClient creates a new instance of DocumentationClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDocumentationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DocumentationClient, error) { + cl, err := arm.NewClient(moduleName+".DocumentationClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DocumentationClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates a new Documentation or updates an existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - documentationID - Documentation identifier. Must be unique in the current API Management service instance. +// - parameters - Create parameters. +// - options - DocumentationClientCreateOrUpdateOptions contains the optional parameters for the DocumentationClient.CreateOrUpdate +// method. +func (client *DocumentationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, parameters DocumentationContract, options *DocumentationClientCreateOrUpdateOptions) (DocumentationClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, documentationID, parameters, options) + if err != nil { + return DocumentationClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DocumentationClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return DocumentationClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DocumentationClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, parameters DocumentationContract, options *DocumentationClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/documentations/{documentationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if documentationID == "" { + return nil, errors.New("parameter documentationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{documentationId}", url.PathEscape(documentationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *DocumentationClient) createOrUpdateHandleResponse(resp *http.Response) (DocumentationClientCreateOrUpdateResponse, error) { + result := DocumentationClientCreateOrUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.DocumentationContract); err != nil { + return DocumentationClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes the specified Documentation from an API. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - documentationID - Documentation identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - DocumentationClientDeleteOptions contains the optional parameters for the DocumentationClient.Delete method. +func (client *DocumentationClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, ifMatch string, options *DocumentationClientDeleteOptions) (DocumentationClientDeleteResponse, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, documentationID, ifMatch, options) + if err != nil { + return DocumentationClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DocumentationClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return DocumentationClientDeleteResponse{}, err + } + return DocumentationClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DocumentationClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, ifMatch string, options *DocumentationClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/documentations/{documentationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if documentationID == "" { + return nil, errors.New("parameter documentationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{documentationId}", url.PathEscape(documentationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the details of the Documentation specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - documentationID - Documentation identifier. Must be unique in the current API Management service instance. +// - options - DocumentationClientGetOptions contains the optional parameters for the DocumentationClient.Get method. +func (client *DocumentationClient) Get(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, options *DocumentationClientGetOptions) (DocumentationClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, documentationID, options) + if err != nil { + return DocumentationClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DocumentationClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DocumentationClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DocumentationClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, options *DocumentationClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/documentations/{documentationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if documentationID == "" { + return nil, errors.New("parameter documentationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{documentationId}", url.PathEscape(documentationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DocumentationClient) getHandleResponse(resp *http.Response) (DocumentationClientGetResponse, error) { + result := DocumentationClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.DocumentationContract); err != nil { + return DocumentationClientGetResponse{}, err + } + return result, nil +} + +// GetEntityTag - Gets the entity state (Etag) version of the Documentation by its identifier. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - documentationID - Documentation identifier. Must be unique in the current API Management service instance. +// - options - DocumentationClientGetEntityTagOptions contains the optional parameters for the DocumentationClient.GetEntityTag +// method. +func (client *DocumentationClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, options *DocumentationClientGetEntityTagOptions) (DocumentationClientGetEntityTagResponse, error) { + var err error + req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, documentationID, options) + if err != nil { + return DocumentationClientGetEntityTagResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DocumentationClientGetEntityTagResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DocumentationClientGetEntityTagResponse{}, err + } + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err +} + +// getEntityTagCreateRequest creates the GetEntityTag request. +func (client *DocumentationClient) getEntityTagCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, options *DocumentationClientGetEntityTagOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/documentations/{documentationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if documentationID == "" { + return nil, errors.New("parameter documentationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{documentationId}", url.PathEscape(documentationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getEntityTagHandleResponse handles the GetEntityTag response. +func (client *DocumentationClient) getEntityTagHandleResponse(resp *http.Response) (DocumentationClientGetEntityTagResponse, error) { + result := DocumentationClientGetEntityTagResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + result.Success = resp.StatusCode >= 200 && resp.StatusCode < 300 + return result, nil +} + +// NewListByServicePager - Lists all Documentations of the API Management service instance. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - DocumentationClientListByServiceOptions contains the optional parameters for the DocumentationClient.NewListByServicePager +// method. +func (client *DocumentationClient) NewListByServicePager(resourceGroupName string, serviceName string, options *DocumentationClientListByServiceOptions) *runtime.Pager[DocumentationClientListByServiceResponse] { + return runtime.NewPager(runtime.PagingHandler[DocumentationClientListByServiceResponse]{ + More: func(page DocumentationClientListByServiceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DocumentationClientListByServiceResponse) (DocumentationClientListByServiceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DocumentationClientListByServiceResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DocumentationClientListByServiceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DocumentationClientListByServiceResponse{}, runtime.NewResponseError(resp) + } + return client.listByServiceHandleResponse(resp) + }, + }) +} + +// listByServiceCreateRequest creates the ListByService request. +func (client *DocumentationClient) listByServiceCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *DocumentationClientListByServiceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/documentations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + } + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServiceHandleResponse handles the ListByService response. +func (client *DocumentationClient) listByServiceHandleResponse(resp *http.Response) (DocumentationClientListByServiceResponse, error) { + result := DocumentationClientListByServiceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DocumentationCollection); err != nil { + return DocumentationClientListByServiceResponse{}, err + } + return result, nil +} + +// Update - Updates the details of the Documentation for an API specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - documentationID - Documentation identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Documentation Update parameters. +// - options - DocumentationClientUpdateOptions contains the optional parameters for the DocumentationClient.Update method. +func (client *DocumentationClient) Update(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, ifMatch string, parameters DocumentationUpdateContract, options *DocumentationClientUpdateOptions) (DocumentationClientUpdateResponse, error) { + var err error + req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, documentationID, ifMatch, parameters, options) + if err != nil { + return DocumentationClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DocumentationClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DocumentationClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *DocumentationClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, ifMatch string, parameters DocumentationUpdateContract, options *DocumentationClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/documentations/{documentationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if documentationID == "" { + return nil, errors.New("parameter documentationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{documentationId}", url.PathEscape(documentationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *DocumentationClient) updateHandleResponse(resp *http.Response) (DocumentationClientUpdateResponse, error) { + result := DocumentationClientUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.DocumentationContract); err != nil { + return DocumentationClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/documentation_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/documentation_client_example_test.go new file mode 100644 index 000000000000..90f17a25f87b --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/documentation_client_example_test.go @@ -0,0 +1,208 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListDocumentations.json +func ExampleDocumentationClient_NewListByServicePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewDocumentationClient().NewListByServicePager("rg1", "apimService1", &armapimanagement.DocumentationClientListByServiceOptions{Filter: nil, + Top: nil, + Skip: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.DocumentationCollection = armapimanagement.DocumentationCollection{ + // Value: []*armapimanagement.DocumentationContract{ + // { + // Name: to.Ptr("test"), + // Type: to.Ptr("Microsoft.ApiManagement/service/documentations"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/documentations/test"), + // Properties: &armapimanagement.DocumentationContractProperties{ + // Content: to.Ptr("Test content "), + // Title: to.Ptr("test"), + // }, + // }, + // { + // Name: to.Ptr("test2"), + // Type: to.Ptr("Microsoft.ApiManagement/service/documentations"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/documentations/test2"), + // Properties: &armapimanagement.DocumentationContractProperties{ + // Content: to.Ptr("Test content "), + // Title: to.Ptr("test"), + // }, + // }, + // { + // Name: to.Ptr("test3"), + // Type: to.Ptr("Microsoft.ApiManagement/service/documentations"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/documentations/test3"), + // Properties: &armapimanagement.DocumentationContractProperties{ + // Content: to.Ptr("Test content "), + // Title: to.Ptr("test"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadDocumentation.json +func ExampleDocumentationClient_GetEntityTag() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewDocumentationClient().GetEntityTag(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetDocumentation.json +func ExampleDocumentationClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDocumentationClient().Get(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.DocumentationContract = armapimanagement.DocumentationContract{ + // Name: to.Ptr("57d1f7558aa04f15146d9d8a"), + // Type: to.Ptr("Microsoft.ApiManagement/service/documentations"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/documentations/57d1f7558aa04f15146d9d8a"), + // Properties: &armapimanagement.DocumentationContractProperties{ + // Content: to.Ptr("content"), + // Title: to.Ptr("Title"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateDocumentation.json +func ExampleDocumentationClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDocumentationClient().CreateOrUpdate(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", armapimanagement.DocumentationContract{ + Properties: &armapimanagement.DocumentationContractProperties{ + Content: to.Ptr("content"), + Title: to.Ptr("Title"), + }, + }, &armapimanagement.DocumentationClientCreateOrUpdateOptions{IfMatch: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.DocumentationContract = armapimanagement.DocumentationContract{ + // Name: to.Ptr("57d1f7558aa04f15146d9d8a"), + // Type: to.Ptr("Microsoft.ApiManagement/service/documentations"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/documentations/57d1f7558aa04f15146d9d8a"), + // Properties: &armapimanagement.DocumentationContractProperties{ + // Content: to.Ptr("content"), + // Title: to.Ptr("Title"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateDocumentation.json +func ExampleDocumentationClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDocumentationClient().Update(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "", armapimanagement.DocumentationUpdateContract{ + Properties: &armapimanagement.DocumentationContractProperties{ + Content: to.Ptr("content updated"), + Title: to.Ptr("Title updated"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.DocumentationContract = armapimanagement.DocumentationContract{ + // Name: to.Ptr("57d1f7558aa04f15146d9d8a"), + // Type: to.Ptr("Microsoft.ApiManagement/service/documentations"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/documentations/57d1f7558aa04f15146d9d8a"), + // Properties: &armapimanagement.DocumentationContractProperties{ + // Content: to.Ptr("content updated"), + // Title: to.Ptr("Title updated"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteDocumentation.json +func ExampleDocumentationClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewDocumentationClient().Delete(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/emailtemplate_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/emailtemplate_client.go index 4d5e321d6375..2268b17b9d59 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/emailtemplate_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/emailtemplate_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type EmailTemplateClient struct { } // NewEmailTemplateClient creates a new instance of EmailTemplateClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewEmailTemplateClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EmailTemplateClient, error) { @@ -49,26 +47,29 @@ func NewEmailTemplateClient(subscriptionID string, credential azcore.TokenCreden // CreateOrUpdate - Updates an Email Template. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - templateName - Email Template Name Identifier. // - parameters - Email Template update parameters. // - options - EmailTemplateClientCreateOrUpdateOptions contains the optional parameters for the EmailTemplateClient.CreateOrUpdate // method. func (client *EmailTemplateClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, parameters EmailTemplateUpdateParameters, options *EmailTemplateClientCreateOrUpdateOptions) (EmailTemplateClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, templateName, parameters, options) if err != nil { return EmailTemplateClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EmailTemplateClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return EmailTemplateClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return EmailTemplateClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -95,13 +96,16 @@ func (client *EmailTemplateClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -116,24 +120,26 @@ func (client *EmailTemplateClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Reset the Email Template to default template provided by the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - templateName - Email Template Name Identifier. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - options - EmailTemplateClientDeleteOptions contains the optional parameters for the EmailTemplateClient.Delete method. func (client *EmailTemplateClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, ifMatch string, options *EmailTemplateClientDeleteOptions) (EmailTemplateClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, templateName, ifMatch, options) if err != nil { return EmailTemplateClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EmailTemplateClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return EmailTemplateClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return EmailTemplateClientDeleteResponse{}, err } return EmailTemplateClientDeleteResponse{}, nil } @@ -162,7 +168,7 @@ func (client *EmailTemplateClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -172,24 +178,27 @@ func (client *EmailTemplateClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets the details of the email template specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - templateName - Email Template Name Identifier. // - options - EmailTemplateClientGetOptions contains the optional parameters for the EmailTemplateClient.Get method. func (client *EmailTemplateClient) Get(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, options *EmailTemplateClientGetOptions) (EmailTemplateClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, templateName, options) if err != nil { return EmailTemplateClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EmailTemplateClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EmailTemplateClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EmailTemplateClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -216,7 +225,7 @@ func (client *EmailTemplateClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -236,25 +245,28 @@ func (client *EmailTemplateClient) getHandleResponse(resp *http.Response) (Email // GetEntityTag - Gets the entity state (Etag) version of the email template specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - templateName - Email Template Name Identifier. // - options - EmailTemplateClientGetEntityTagOptions contains the optional parameters for the EmailTemplateClient.GetEntityTag // method. func (client *EmailTemplateClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, options *EmailTemplateClientGetEntityTagOptions) (EmailTemplateClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, templateName, options) if err != nil { return EmailTemplateClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EmailTemplateClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EmailTemplateClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EmailTemplateClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -281,7 +293,7 @@ func (client *EmailTemplateClient) getEntityTagCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -299,8 +311,8 @@ func (client *EmailTemplateClient) getEntityTagHandleResponse(resp *http.Respons // NewListByServicePager - Gets all email templates // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - EmailTemplateClientListByServiceOptions contains the optional parameters for the EmailTemplateClient.NewListByServicePager // method. @@ -361,7 +373,7 @@ func (client *EmailTemplateClient) listByServiceCreateRequest(ctx context.Contex if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -379,8 +391,8 @@ func (client *EmailTemplateClient) listByServiceHandleResponse(resp *http.Respon // Update - Updates API Management email template // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - templateName - Email Template Name Identifier. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -388,18 +400,21 @@ func (client *EmailTemplateClient) listByServiceHandleResponse(resp *http.Respon // - parameters - Update parameters. // - options - EmailTemplateClientUpdateOptions contains the optional parameters for the EmailTemplateClient.Update method. func (client *EmailTemplateClient) Update(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, ifMatch string, parameters EmailTemplateUpdateParameters, options *EmailTemplateClientUpdateOptions) (EmailTemplateClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, templateName, ifMatch, parameters, options) if err != nil { return EmailTemplateClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return EmailTemplateClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return EmailTemplateClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EmailTemplateClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -426,11 +441,14 @@ func (client *EmailTemplateClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/emailtemplate_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/emailtemplate_client_example_test.go index 859c0e5a83c1..4b56a4336f96 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/emailtemplate_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/emailtemplate_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTemplates.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListTemplates.json func ExampleEmailTemplateClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -87,7 +87,7 @@ func ExampleEmailTemplateClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadEmailTemplate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadEmailTemplate.json func ExampleEmailTemplateClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -104,7 +104,7 @@ func ExampleEmailTemplateClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTemplate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetTemplate.json func ExampleEmailTemplateClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -161,7 +161,7 @@ func ExampleEmailTemplateClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateTemplate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateTemplate.json func ExampleEmailTemplateClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -222,7 +222,7 @@ func ExampleEmailTemplateClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateTemplate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateTemplate.json func ExampleEmailTemplateClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -284,7 +284,7 @@ func ExampleEmailTemplateClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteTemplate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteTemplate.json func ExampleEmailTemplateClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/gateway_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/gateway_client.go index 090a071f5aa9..85caf01e1afb 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/gateway_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/gateway_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type GatewayClient struct { } // NewGatewayClient creates a new instance of GatewayClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewGatewayClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewayClient, error) { @@ -49,25 +47,28 @@ func NewGatewayClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates or updates a Gateway to be used in Api Management instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' // - options - GatewayClientCreateOrUpdateOptions contains the optional parameters for the GatewayClient.CreateOrUpdate method. func (client *GatewayClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayContract, options *GatewayClientCreateOrUpdateOptions) (GatewayClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, parameters, options) if err != nil { return GatewayClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return GatewayClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return GatewayClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -94,13 +95,16 @@ func (client *GatewayClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -118,8 +122,8 @@ func (client *GatewayClient) createOrUpdateHandleResponse(resp *http.Response) ( // Delete - Deletes specific Gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' @@ -127,16 +131,18 @@ func (client *GatewayClient) createOrUpdateHandleResponse(resp *http.Response) ( // it should be * for unconditional update. // - options - GatewayClientDeleteOptions contains the optional parameters for the GatewayClient.Delete method. func (client *GatewayClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, ifMatch string, options *GatewayClientDeleteOptions) (GatewayClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, ifMatch, options) if err != nil { return GatewayClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return GatewayClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return GatewayClientDeleteResponse{}, err } return GatewayClientDeleteResponse{}, nil } @@ -165,7 +171,7 @@ func (client *GatewayClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -175,25 +181,28 @@ func (client *GatewayClient) deleteCreateRequest(ctx context.Context, resourceGr // GenerateToken - Gets the Shared Access Authorization Token for the gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' // - options - GatewayClientGenerateTokenOptions contains the optional parameters for the GatewayClient.GenerateToken method. func (client *GatewayClient) GenerateToken(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayTokenRequestContract, options *GatewayClientGenerateTokenOptions) (GatewayClientGenerateTokenResponse, error) { + var err error req, err := client.generateTokenCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, parameters, options) if err != nil { return GatewayClientGenerateTokenResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayClientGenerateTokenResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GatewayClientGenerateTokenResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GatewayClientGenerateTokenResponse{}, err } - return client.generateTokenHandleResponse(resp) + resp, err := client.generateTokenHandleResponse(httpResp) + return resp, err } // generateTokenCreateRequest creates the GenerateToken request. @@ -220,10 +229,13 @@ func (client *GatewayClient) generateTokenCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // generateTokenHandleResponse handles the GenerateToken response. @@ -238,25 +250,28 @@ func (client *GatewayClient) generateTokenHandleResponse(resp *http.Response) (G // Get - Gets the details of the Gateway specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' // - options - GatewayClientGetOptions contains the optional parameters for the GatewayClient.Get method. func (client *GatewayClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, options *GatewayClientGetOptions) (GatewayClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, options) if err != nil { return GatewayClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GatewayClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GatewayClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -283,7 +298,7 @@ func (client *GatewayClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,25 +318,28 @@ func (client *GatewayClient) getHandleResponse(resp *http.Response) (GatewayClie // GetEntityTag - Gets the entity state (Etag) version of the Gateway specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' // - options - GatewayClientGetEntityTagOptions contains the optional parameters for the GatewayClient.GetEntityTag method. func (client *GatewayClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, options *GatewayClientGetEntityTagOptions) (GatewayClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, options) if err != nil { return GatewayClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GatewayClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GatewayClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -348,7 +366,7 @@ func (client *GatewayClient) getEntityTagCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -366,8 +384,8 @@ func (client *GatewayClient) getEntityTagHandleResponse(resp *http.Response) (Ga // NewListByServicePager - Lists a collection of gateways registered with service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - GatewayClientListByServiceOptions contains the optional parameters for the GatewayClient.NewListByServicePager // method. @@ -428,7 +446,7 @@ func (client *GatewayClient) listByServiceCreateRequest(ctx context.Context, res if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -446,25 +464,28 @@ func (client *GatewayClient) listByServiceHandleResponse(resp *http.Response) (G // ListKeys - Retrieves gateway keys. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' // - options - GatewayClientListKeysOptions contains the optional parameters for the GatewayClient.ListKeys method. func (client *GatewayClient) ListKeys(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, options *GatewayClientListKeysOptions) (GatewayClientListKeysResponse, error) { + var err error req, err := client.listKeysCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, options) if err != nil { return GatewayClientListKeysResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayClientListKeysResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GatewayClientListKeysResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GatewayClientListKeysResponse{}, err } - return client.listKeysHandleResponse(resp) + resp, err := client.listKeysHandleResponse(httpResp) + return resp, err } // listKeysCreateRequest creates the ListKeys request. @@ -491,7 +512,7 @@ func (client *GatewayClient) listKeysCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -512,23 +533,25 @@ func (client *GatewayClient) listKeysHandleResponse(resp *http.Response) (Gatewa // RegenerateKey - Regenerates specified gateway key invalidating any tokens created with it. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' // - options - GatewayClientRegenerateKeyOptions contains the optional parameters for the GatewayClient.RegenerateKey method. func (client *GatewayClient) RegenerateKey(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayKeyRegenerationRequestContract, options *GatewayClientRegenerateKeyOptions) (GatewayClientRegenerateKeyResponse, error) { + var err error req, err := client.regenerateKeyCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, parameters, options) if err != nil { return GatewayClientRegenerateKeyResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayClientRegenerateKeyResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return GatewayClientRegenerateKeyResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return GatewayClientRegenerateKeyResponse{}, err } return GatewayClientRegenerateKeyResponse{}, nil } @@ -557,17 +580,20 @@ func (client *GatewayClient) regenerateKeyCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Update - Updates the details of the gateway specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' @@ -575,18 +601,21 @@ func (client *GatewayClient) regenerateKeyCreateRequest(ctx context.Context, res // it should be * for unconditional update. // - options - GatewayClientUpdateOptions contains the optional parameters for the GatewayClient.Update method. func (client *GatewayClient) Update(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, ifMatch string, parameters GatewayContract, options *GatewayClientUpdateOptions) (GatewayClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, ifMatch, parameters, options) if err != nil { return GatewayClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GatewayClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GatewayClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -613,11 +642,14 @@ func (client *GatewayClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/gateway_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/gateway_client_example_test.go index c11f695e2c8a..33d5df8a432e 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/gateway_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/gateway_client_example_test.go @@ -17,10 +17,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGateways.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListGateways.json func ExampleGatewayClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -74,7 +74,7 @@ func ExampleGatewayClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGateway.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadGateway.json func ExampleGatewayClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -91,7 +91,7 @@ func ExampleGatewayClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGateway.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetGateway.json func ExampleGatewayClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -122,7 +122,7 @@ func ExampleGatewayClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGateway.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateGateway.json func ExampleGatewayClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -160,7 +160,7 @@ func ExampleGatewayClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateGateway.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateGateway.json func ExampleGatewayClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -198,7 +198,7 @@ func ExampleGatewayClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGateway.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteGateway.json func ExampleGatewayClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -215,7 +215,7 @@ func ExampleGatewayClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGatewayListKeys.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGatewayListKeys.json func ExampleGatewayClient_ListKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -239,7 +239,7 @@ func ExampleGatewayClient_ListKeys() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGatewayRegenerateKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGatewayRegenerateKey.json func ExampleGatewayClient_RegenerateKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -258,7 +258,7 @@ func ExampleGatewayClient_RegenerateKey() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGatewayGenerateToken.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGatewayGenerateToken.json func ExampleGatewayClient_GenerateToken() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/gatewayapi_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/gatewayapi_client.go index 07f196a6224e..705573ad1da3 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/gatewayapi_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/gatewayapi_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type GatewayAPIClient struct { } // NewGatewayAPIClient creates a new instance of GatewayAPIClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewGatewayAPIClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewayAPIClient, error) { @@ -49,8 +47,8 @@ func NewGatewayAPIClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Adds an API to the specified Gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' @@ -58,18 +56,21 @@ func NewGatewayAPIClient(subscriptionID string, credential azcore.TokenCredentia // - options - GatewayAPIClientCreateOrUpdateOptions contains the optional parameters for the GatewayAPIClient.CreateOrUpdate // method. func (client *GatewayAPIClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiID string, options *GatewayAPIClientCreateOrUpdateOptions) (GatewayAPIClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, apiID, options) if err != nil { return GatewayAPIClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayAPIClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return GatewayAPIClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return GatewayAPIClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -100,11 +101,14 @@ func (client *GatewayAPIClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) + if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -121,24 +125,26 @@ func (client *GatewayAPIClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes the specified API from the specified Gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' // - apiID - API identifier. Must be unique in the current API Management service instance. // - options - GatewayAPIClientDeleteOptions contains the optional parameters for the GatewayAPIClient.Delete method. func (client *GatewayAPIClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiID string, options *GatewayAPIClientDeleteOptions) (GatewayAPIClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, apiID, options) if err != nil { return GatewayAPIClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayAPIClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return GatewayAPIClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return GatewayAPIClientDeleteResponse{}, err } return GatewayAPIClientDeleteResponse{}, nil } @@ -171,7 +177,7 @@ func (client *GatewayAPIClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -179,26 +185,29 @@ func (client *GatewayAPIClient) deleteCreateRequest(ctx context.Context, resourc // GetEntityTag - Checks that API entity specified by identifier is associated with the Gateway entity. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' // - apiID - API identifier. Must be unique in the current API Management service instance. // - options - GatewayAPIClientGetEntityTagOptions contains the optional parameters for the GatewayAPIClient.GetEntityTag method. func (client *GatewayAPIClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiID string, options *GatewayAPIClientGetEntityTagOptions) (GatewayAPIClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, apiID, options) if err != nil { return GatewayAPIClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayAPIClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GatewayAPIClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GatewayAPIClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -229,7 +238,7 @@ func (client *GatewayAPIClient) getEntityTagCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -247,8 +256,8 @@ func (client *GatewayAPIClient) getEntityTagHandleResponse(resp *http.Response) // NewListByServicePager - Lists a collection of the APIs associated with a gateway. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' @@ -315,7 +324,7 @@ func (client *GatewayAPIClient) listByServiceCreateRequest(ctx context.Context, if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/gatewayapi_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/gatewayapi_client_example_test.go index 6d8be96e8f86..a1be09a3107b 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/gatewayapi_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/gatewayapi_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGatewayApis.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListGatewayApis.json func ExampleGatewayAPIClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -65,7 +65,7 @@ func ExampleGatewayAPIClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGatewayApi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadGatewayApi.json func ExampleGatewayAPIClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -82,7 +82,7 @@ func ExampleGatewayAPIClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGatewayApi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateGatewayApi.json func ExampleGatewayAPIClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -126,7 +126,7 @@ func ExampleGatewayAPIClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGatewayApi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteGatewayApi.json func ExampleGatewayAPIClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/gatewaycertificateauthority_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/gatewaycertificateauthority_client.go index f57e57405909..021b02da737b 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/gatewaycertificateauthority_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/gatewaycertificateauthority_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type GatewayCertificateAuthorityClient struct { } // NewGatewayCertificateAuthorityClient creates a new instance of GatewayCertificateAuthorityClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewGatewayCertificateAuthorityClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewayCertificateAuthorityClient, error) { @@ -49,8 +47,8 @@ func NewGatewayCertificateAuthorityClient(subscriptionID string, credential azco // CreateOrUpdate - Assign Certificate entity to Gateway entity as Certificate Authority. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' @@ -58,18 +56,21 @@ func NewGatewayCertificateAuthorityClient(subscriptionID string, credential azco // - options - GatewayCertificateAuthorityClientCreateOrUpdateOptions contains the optional parameters for the GatewayCertificateAuthorityClient.CreateOrUpdate // method. func (client *GatewayCertificateAuthorityClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, certificateID string, parameters GatewayCertificateAuthorityContract, options *GatewayCertificateAuthorityClientCreateOrUpdateOptions) (GatewayCertificateAuthorityClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, certificateID, parameters, options) if err != nil { return GatewayCertificateAuthorityClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayCertificateAuthorityClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return GatewayCertificateAuthorityClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return GatewayCertificateAuthorityClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -100,13 +101,16 @@ func (client *GatewayCertificateAuthorityClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -124,8 +128,8 @@ func (client *GatewayCertificateAuthorityClient) createOrUpdateHandleResponse(re // Delete - Remove relationship between Certificate Authority and Gateway entity. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' @@ -135,16 +139,18 @@ func (client *GatewayCertificateAuthorityClient) createOrUpdateHandleResponse(re // - options - GatewayCertificateAuthorityClientDeleteOptions contains the optional parameters for the GatewayCertificateAuthorityClient.Delete // method. func (client *GatewayCertificateAuthorityClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, certificateID string, ifMatch string, options *GatewayCertificateAuthorityClientDeleteOptions) (GatewayCertificateAuthorityClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, certificateID, ifMatch, options) if err != nil { return GatewayCertificateAuthorityClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayCertificateAuthorityClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return GatewayCertificateAuthorityClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return GatewayCertificateAuthorityClientDeleteResponse{}, err } return GatewayCertificateAuthorityClientDeleteResponse{}, nil } @@ -177,7 +183,7 @@ func (client *GatewayCertificateAuthorityClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -187,8 +193,8 @@ func (client *GatewayCertificateAuthorityClient) deleteCreateRequest(ctx context // Get - Get assigned Gateway Certificate Authority details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' @@ -196,18 +202,21 @@ func (client *GatewayCertificateAuthorityClient) deleteCreateRequest(ctx context // - options - GatewayCertificateAuthorityClientGetOptions contains the optional parameters for the GatewayCertificateAuthorityClient.Get // method. func (client *GatewayCertificateAuthorityClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, certificateID string, options *GatewayCertificateAuthorityClientGetOptions) (GatewayCertificateAuthorityClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, certificateID, options) if err != nil { return GatewayCertificateAuthorityClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayCertificateAuthorityClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GatewayCertificateAuthorityClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GatewayCertificateAuthorityClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -238,7 +247,7 @@ func (client *GatewayCertificateAuthorityClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -258,8 +267,8 @@ func (client *GatewayCertificateAuthorityClient) getHandleResponse(resp *http.Re // GetEntityTag - Checks if Certificate entity is assigned to Gateway entity as Certificate Authority. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' @@ -267,18 +276,21 @@ func (client *GatewayCertificateAuthorityClient) getHandleResponse(resp *http.Re // - options - GatewayCertificateAuthorityClientGetEntityTagOptions contains the optional parameters for the GatewayCertificateAuthorityClient.GetEntityTag // method. func (client *GatewayCertificateAuthorityClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, certificateID string, options *GatewayCertificateAuthorityClientGetEntityTagOptions) (GatewayCertificateAuthorityClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, certificateID, options) if err != nil { return GatewayCertificateAuthorityClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayCertificateAuthorityClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GatewayCertificateAuthorityClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GatewayCertificateAuthorityClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -309,7 +321,7 @@ func (client *GatewayCertificateAuthorityClient) getEntityTagCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,8 +339,8 @@ func (client *GatewayCertificateAuthorityClient) getEntityTagHandleResponse(resp // NewListByServicePager - Lists the collection of Certificate Authorities for the specified Gateway entity. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' @@ -395,7 +407,7 @@ func (client *GatewayCertificateAuthorityClient) listByServiceCreateRequest(ctx if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/gatewaycertificateauthority_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/gatewaycertificateauthority_client_example_test.go index 15cfa153a5a0..c09f61ff8fa8 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/gatewaycertificateauthority_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/gatewaycertificateauthority_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGatewayCertificateAuthorities.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListGatewayCertificateAuthorities.json func ExampleGatewayCertificateAuthorityClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -65,7 +65,7 @@ func ExampleGatewayCertificateAuthorityClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGatewayCertificateAuthority.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadGatewayCertificateAuthority.json func ExampleGatewayCertificateAuthorityClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -82,7 +82,7 @@ func ExampleGatewayCertificateAuthorityClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGatewayCertificateAuthority.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetGatewayCertificateAuthority.json func ExampleGatewayCertificateAuthorityClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -110,7 +110,7 @@ func ExampleGatewayCertificateAuthorityClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGatewayCertificateAuthority.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateGatewayCertificateAuthority.json func ExampleGatewayCertificateAuthorityClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -142,7 +142,7 @@ func ExampleGatewayCertificateAuthorityClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGatewayCertificateAuthority.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteGatewayCertificateAuthority.json func ExampleGatewayCertificateAuthorityClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/gatewayhostnameconfiguration_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/gatewayhostnameconfiguration_client.go index be58df25a942..8a4d5ecfc380 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/gatewayhostnameconfiguration_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/gatewayhostnameconfiguration_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type GatewayHostnameConfigurationClient struct { } // NewGatewayHostnameConfigurationClient creates a new instance of GatewayHostnameConfigurationClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewGatewayHostnameConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewayHostnameConfigurationClient, error) { @@ -49,8 +47,8 @@ func NewGatewayHostnameConfigurationClient(subscriptionID string, credential azc // CreateOrUpdate - Creates of updates hostname configuration for a Gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' @@ -58,18 +56,21 @@ func NewGatewayHostnameConfigurationClient(subscriptionID string, credential azc // - options - GatewayHostnameConfigurationClientCreateOrUpdateOptions contains the optional parameters for the GatewayHostnameConfigurationClient.CreateOrUpdate // method. func (client *GatewayHostnameConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string, parameters GatewayHostnameConfigurationContract, options *GatewayHostnameConfigurationClientCreateOrUpdateOptions) (GatewayHostnameConfigurationClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, hcID, parameters, options) if err != nil { return GatewayHostnameConfigurationClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayHostnameConfigurationClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return GatewayHostnameConfigurationClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return GatewayHostnameConfigurationClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -100,13 +101,16 @@ func (client *GatewayHostnameConfigurationClient) createOrUpdateCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -124,8 +128,8 @@ func (client *GatewayHostnameConfigurationClient) createOrUpdateHandleResponse(r // Delete - Deletes the specified hostname configuration from the specified Gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' @@ -135,16 +139,18 @@ func (client *GatewayHostnameConfigurationClient) createOrUpdateHandleResponse(r // - options - GatewayHostnameConfigurationClientDeleteOptions contains the optional parameters for the GatewayHostnameConfigurationClient.Delete // method. func (client *GatewayHostnameConfigurationClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string, ifMatch string, options *GatewayHostnameConfigurationClientDeleteOptions) (GatewayHostnameConfigurationClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, hcID, ifMatch, options) if err != nil { return GatewayHostnameConfigurationClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayHostnameConfigurationClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return GatewayHostnameConfigurationClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return GatewayHostnameConfigurationClientDeleteResponse{}, err } return GatewayHostnameConfigurationClientDeleteResponse{}, nil } @@ -177,7 +183,7 @@ func (client *GatewayHostnameConfigurationClient) deleteCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -187,8 +193,8 @@ func (client *GatewayHostnameConfigurationClient) deleteCreateRequest(ctx contex // Get - Get details of a hostname configuration // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' @@ -196,18 +202,21 @@ func (client *GatewayHostnameConfigurationClient) deleteCreateRequest(ctx contex // - options - GatewayHostnameConfigurationClientGetOptions contains the optional parameters for the GatewayHostnameConfigurationClient.Get // method. func (client *GatewayHostnameConfigurationClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string, options *GatewayHostnameConfigurationClientGetOptions) (GatewayHostnameConfigurationClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, hcID, options) if err != nil { return GatewayHostnameConfigurationClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayHostnameConfigurationClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GatewayHostnameConfigurationClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GatewayHostnameConfigurationClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -238,7 +247,7 @@ func (client *GatewayHostnameConfigurationClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -258,8 +267,8 @@ func (client *GatewayHostnameConfigurationClient) getHandleResponse(resp *http.R // GetEntityTag - Checks that hostname configuration entity specified by identifier exists for specified Gateway entity. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' @@ -267,18 +276,21 @@ func (client *GatewayHostnameConfigurationClient) getHandleResponse(resp *http.R // - options - GatewayHostnameConfigurationClientGetEntityTagOptions contains the optional parameters for the GatewayHostnameConfigurationClient.GetEntityTag // method. func (client *GatewayHostnameConfigurationClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string, options *GatewayHostnameConfigurationClientGetEntityTagOptions) (GatewayHostnameConfigurationClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, hcID, options) if err != nil { return GatewayHostnameConfigurationClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayHostnameConfigurationClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GatewayHostnameConfigurationClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GatewayHostnameConfigurationClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -309,7 +321,7 @@ func (client *GatewayHostnameConfigurationClient) getEntityTagCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,8 +339,8 @@ func (client *GatewayHostnameConfigurationClient) getEntityTagHandleResponse(res // NewListByServicePager - Lists the collection of hostname configurations for the specified gateway. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value // 'managed' @@ -395,7 +407,7 @@ func (client *GatewayHostnameConfigurationClient) listByServiceCreateRequest(ctx if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/gatewayhostnameconfiguration_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/gatewayhostnameconfiguration_client_example_test.go index b32bdd73acd2..c40d3c690f86 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/gatewayhostnameconfiguration_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/gatewayhostnameconfiguration_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGatewayHostnameConfigurations.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListGatewayHostnameConfigurations.json func ExampleGatewayHostnameConfigurationClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -69,7 +69,7 @@ func ExampleGatewayHostnameConfigurationClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGatewayHostnameConfiguration.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadGatewayHostnameConfiguration.json func ExampleGatewayHostnameConfigurationClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -86,7 +86,7 @@ func ExampleGatewayHostnameConfigurationClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGatewayHostnameConfiguration.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetGatewayHostnameConfiguration.json func ExampleGatewayHostnameConfigurationClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -116,7 +116,7 @@ func ExampleGatewayHostnameConfigurationClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGatewayHostnameConfiguration.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateGatewayHostnameConfiguration.json func ExampleGatewayHostnameConfigurationClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -158,7 +158,7 @@ func ExampleGatewayHostnameConfigurationClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGatewayHostnameConfiguration.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteGatewayHostnameConfiguration.json func ExampleGatewayHostnameConfigurationClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/globalschema_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/globalschema_client.go index e5b5918a9d7d..75946a246e14 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/globalschema_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/globalschema_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type GlobalSchemaClient struct { } // NewGlobalSchemaClient creates a new instance of GlobalSchemaClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewGlobalSchemaClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GlobalSchemaClient, error) { @@ -49,8 +47,8 @@ func NewGlobalSchemaClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Creates new or updates existing specified Schema of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - schemaID - Schema id identifier. Must be unique in the current API Management service instance. // - parameters - Create or update parameters. @@ -62,9 +60,10 @@ func (client *GlobalSchemaClient) BeginCreateOrUpdate(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GlobalSchemaClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GlobalSchemaClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[GlobalSchemaClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,20 +72,22 @@ func (client *GlobalSchemaClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Creates new or updates existing specified Schema of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *GlobalSchemaClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, schemaID string, parameters GlobalSchemaContract, options *GlobalSchemaClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, schemaID, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,36 +114,41 @@ func (client *GlobalSchemaClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Delete - Deletes specific Schema. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - schemaID - Schema id identifier. Must be unique in the current API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - options - GlobalSchemaClientDeleteOptions contains the optional parameters for the GlobalSchemaClient.Delete method. func (client *GlobalSchemaClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, schemaID string, ifMatch string, options *GlobalSchemaClientDeleteOptions) (GlobalSchemaClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, schemaID, ifMatch, options) if err != nil { return GlobalSchemaClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GlobalSchemaClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return GlobalSchemaClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return GlobalSchemaClientDeleteResponse{}, err } return GlobalSchemaClientDeleteResponse{}, nil } @@ -171,7 +177,7 @@ func (client *GlobalSchemaClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -181,24 +187,27 @@ func (client *GlobalSchemaClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets the details of the Schema specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - schemaID - Schema id identifier. Must be unique in the current API Management service instance. // - options - GlobalSchemaClientGetOptions contains the optional parameters for the GlobalSchemaClient.Get method. func (client *GlobalSchemaClient) Get(ctx context.Context, resourceGroupName string, serviceName string, schemaID string, options *GlobalSchemaClientGetOptions) (GlobalSchemaClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, schemaID, options) if err != nil { return GlobalSchemaClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GlobalSchemaClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GlobalSchemaClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GlobalSchemaClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -225,7 +234,7 @@ func (client *GlobalSchemaClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -245,25 +254,28 @@ func (client *GlobalSchemaClient) getHandleResponse(resp *http.Response) (Global // GetEntityTag - Gets the entity state (Etag) version of the Schema specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - schemaID - Schema id identifier. Must be unique in the current API Management service instance. // - options - GlobalSchemaClientGetEntityTagOptions contains the optional parameters for the GlobalSchemaClient.GetEntityTag // method. func (client *GlobalSchemaClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, schemaID string, options *GlobalSchemaClientGetEntityTagOptions) (GlobalSchemaClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, schemaID, options) if err != nil { return GlobalSchemaClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GlobalSchemaClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GlobalSchemaClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GlobalSchemaClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -290,7 +302,7 @@ func (client *GlobalSchemaClient) getEntityTagCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -308,8 +320,8 @@ func (client *GlobalSchemaClient) getEntityTagHandleResponse(resp *http.Response // NewListByServicePager - Lists a collection of schemas registered with service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - GlobalSchemaClientListByServiceOptions contains the optional parameters for the GlobalSchemaClient.NewListByServicePager // method. @@ -370,7 +382,7 @@ func (client *GlobalSchemaClient) listByServiceCreateRequest(ctx context.Context if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/globalschema_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/globalschema_client_example_test.go index c14aabd2e92d..47fab3012569 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/globalschema_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/globalschema_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGlobalSchemas.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListGlobalSchemas.json func ExampleGlobalSchemaClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -90,7 +90,7 @@ func ExampleGlobalSchemaClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGlobalSchema.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadGlobalSchema.json func ExampleGlobalSchemaClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -107,7 +107,7 @@ func ExampleGlobalSchemaClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGlobalSchema1.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetGlobalSchema1.json func ExampleGlobalSchemaClient_Get_apiManagementGetSchema1() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -137,7 +137,7 @@ func ExampleGlobalSchemaClient_Get_apiManagementGetSchema1() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGlobalSchema2.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetGlobalSchema2.json func ExampleGlobalSchemaClient_Get_apiManagementGetSchema2() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -187,7 +187,7 @@ func ExampleGlobalSchemaClient_Get_apiManagementGetSchema2() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGlobalSchema1.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateGlobalSchema1.json func ExampleGlobalSchemaClient_BeginCreateOrUpdate_apiManagementCreateSchema1() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -227,7 +227,7 @@ func ExampleGlobalSchemaClient_BeginCreateOrUpdate_apiManagementCreateSchema1() // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGlobalSchema2.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateGlobalSchema2.json func ExampleGlobalSchemaClient_BeginCreateOrUpdate_apiManagementCreateSchema2() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -307,7 +307,7 @@ func ExampleGlobalSchemaClient_BeginCreateOrUpdate_apiManagementCreateSchema2() // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGlobalSchema.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteGlobalSchema.json func ExampleGlobalSchemaClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/go.mod b/sdk/resourcemanager/apimanagement/armapimanagement/go.mod index eb864e472f10..0700bbd9f96a 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/go.mod +++ b/sdk/resourcemanager/apimanagement/armapimanagement/go.mod @@ -1,17 +1,18 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2 go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement v1.1.1 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 github.com/stretchr/testify v1.7.0 ) require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dnaeon/go-vcr v1.1.0 // indirect @@ -21,9 +22,9 @@ require ( github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/go.sum b/sdk/resourcemanager/apimanagement/armapimanagement/go.sum index 6e2c77825a2c..59ca04014122 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/go.sum +++ b/sdk/resourcemanager/apimanagement/armapimanagement/go.sum @@ -1,9 +1,11 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement v1.1.1 h1:jCkNVNpsEevyic4bmjgVjzVA4tMGSJpXNGirf+S+mDI= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement v1.1.1/go.mod h1:a0Ug1l73Il7EhrCJEEt2dGjlNjvphppZq5KqJdgnwuw= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 h1:mLY+pNLjCUeKhgnAJWAKhEUQM+RJQo2H1fuGSw1Ky1E= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2/go.mod h1:FbdwsQ2EzwvXxOPcMFYO8ogEc9uMMIj3YkmCdXdAFmk= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8= @@ -31,13 +33,13 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolver_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolver_client.go new file mode 100644 index 000000000000..3fb2ac60d62f --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolver_client.go @@ -0,0 +1,505 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armapimanagement + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// GraphQLAPIResolverClient contains the methods for the GraphQLAPIResolver group. +// Don't use this type directly, use NewGraphQLAPIResolverClient() instead. +type GraphQLAPIResolverClient struct { + internal *arm.Client + subscriptionID string +} + +// NewGraphQLAPIResolverClient creates a new instance of GraphQLAPIResolverClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewGraphQLAPIResolverClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GraphQLAPIResolverClient, error) { + cl, err := arm.NewClient(moduleName+".GraphQLAPIResolverClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &GraphQLAPIResolverClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates a new resolver in the GraphQL API or updates an existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - parameters - Create parameters. +// - options - GraphQLAPIResolverClientCreateOrUpdateOptions contains the optional parameters for the GraphQLAPIResolverClient.CreateOrUpdate +// method. +func (client *GraphQLAPIResolverClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, parameters ResolverContract, options *GraphQLAPIResolverClientCreateOrUpdateOptions) (GraphQLAPIResolverClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, parameters, options) + if err != nil { + return GraphQLAPIResolverClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GraphQLAPIResolverClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return GraphQLAPIResolverClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *GraphQLAPIResolverClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, parameters ResolverContract, options *GraphQLAPIResolverClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *GraphQLAPIResolverClient) createOrUpdateHandleResponse(resp *http.Response) (GraphQLAPIResolverClientCreateOrUpdateResponse, error) { + result := GraphQLAPIResolverClientCreateOrUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.ResolverContract); err != nil { + return GraphQLAPIResolverClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes the specified resolver in the GraphQL API. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - GraphQLAPIResolverClientDeleteOptions contains the optional parameters for the GraphQLAPIResolverClient.Delete +// method. +func (client *GraphQLAPIResolverClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, ifMatch string, options *GraphQLAPIResolverClientDeleteOptions) (GraphQLAPIResolverClientDeleteResponse, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, ifMatch, options) + if err != nil { + return GraphQLAPIResolverClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GraphQLAPIResolverClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return GraphQLAPIResolverClientDeleteResponse{}, err + } + return GraphQLAPIResolverClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *GraphQLAPIResolverClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, ifMatch string, options *GraphQLAPIResolverClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the details of the GraphQL API Resolver specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - options - GraphQLAPIResolverClientGetOptions contains the optional parameters for the GraphQLAPIResolverClient.Get method. +func (client *GraphQLAPIResolverClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, options *GraphQLAPIResolverClientGetOptions) (GraphQLAPIResolverClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, options) + if err != nil { + return GraphQLAPIResolverClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GraphQLAPIResolverClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GraphQLAPIResolverClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *GraphQLAPIResolverClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, options *GraphQLAPIResolverClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *GraphQLAPIResolverClient) getHandleResponse(resp *http.Response) (GraphQLAPIResolverClientGetResponse, error) { + result := GraphQLAPIResolverClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.ResolverContract); err != nil { + return GraphQLAPIResolverClientGetResponse{}, err + } + return result, nil +} + +// GetEntityTag - Gets the entity state (Etag) version of the GraphQL API resolver specified by its identifier. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - options - GraphQLAPIResolverClientGetEntityTagOptions contains the optional parameters for the GraphQLAPIResolverClient.GetEntityTag +// method. +func (client *GraphQLAPIResolverClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, options *GraphQLAPIResolverClientGetEntityTagOptions) (GraphQLAPIResolverClientGetEntityTagResponse, error) { + var err error + req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, options) + if err != nil { + return GraphQLAPIResolverClientGetEntityTagResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GraphQLAPIResolverClientGetEntityTagResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GraphQLAPIResolverClientGetEntityTagResponse{}, err + } + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err +} + +// getEntityTagCreateRequest creates the GetEntityTag request. +func (client *GraphQLAPIResolverClient) getEntityTagCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, options *GraphQLAPIResolverClientGetEntityTagOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getEntityTagHandleResponse handles the GetEntityTag response. +func (client *GraphQLAPIResolverClient) getEntityTagHandleResponse(resp *http.Response) (GraphQLAPIResolverClientGetEntityTagResponse, error) { + result := GraphQLAPIResolverClientGetEntityTagResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + result.Success = resp.StatusCode >= 200 && resp.StatusCode < 300 + return result, nil +} + +// NewListByAPIPager - Lists a collection of the resolvers for the specified GraphQL API. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - options - GraphQLAPIResolverClientListByAPIOptions contains the optional parameters for the GraphQLAPIResolverClient.NewListByAPIPager +// method. +func (client *GraphQLAPIResolverClient) NewListByAPIPager(resourceGroupName string, serviceName string, apiID string, options *GraphQLAPIResolverClientListByAPIOptions) *runtime.Pager[GraphQLAPIResolverClientListByAPIResponse] { + return runtime.NewPager(runtime.PagingHandler[GraphQLAPIResolverClientListByAPIResponse]{ + More: func(page GraphQLAPIResolverClientListByAPIResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GraphQLAPIResolverClientListByAPIResponse) (GraphQLAPIResolverClientListByAPIResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByAPICreateRequest(ctx, resourceGroupName, serviceName, apiID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return GraphQLAPIResolverClientListByAPIResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GraphQLAPIResolverClientListByAPIResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GraphQLAPIResolverClientListByAPIResponse{}, runtime.NewResponseError(resp) + } + return client.listByAPIHandleResponse(resp) + }, + }) +} + +// listByAPICreateRequest creates the ListByAPI request. +func (client *GraphQLAPIResolverClient) listByAPICreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *GraphQLAPIResolverClientListByAPIOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + } + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByAPIHandleResponse handles the ListByAPI response. +func (client *GraphQLAPIResolverClient) listByAPIHandleResponse(resp *http.Response) (GraphQLAPIResolverClientListByAPIResponse, error) { + result := GraphQLAPIResolverClientListByAPIResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ResolverCollection); err != nil { + return GraphQLAPIResolverClientListByAPIResponse{}, err + } + return result, nil +} + +// Update - Updates the details of the resolver in the GraphQL API specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - GraphQL API Resolver Update parameters. +// - options - GraphQLAPIResolverClientUpdateOptions contains the optional parameters for the GraphQLAPIResolverClient.Update +// method. +func (client *GraphQLAPIResolverClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, ifMatch string, parameters ResolverUpdateContract, options *GraphQLAPIResolverClientUpdateOptions) (GraphQLAPIResolverClientUpdateResponse, error) { + var err error + req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, ifMatch, parameters, options) + if err != nil { + return GraphQLAPIResolverClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GraphQLAPIResolverClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GraphQLAPIResolverClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *GraphQLAPIResolverClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, ifMatch string, parameters ResolverUpdateContract, options *GraphQLAPIResolverClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *GraphQLAPIResolverClient) updateHandleResponse(resp *http.Response) (GraphQLAPIResolverClientUpdateResponse, error) { + result := GraphQLAPIResolverClientUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.ResolverContract); err != nil { + return GraphQLAPIResolverClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolver_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolver_client_example_test.go new file mode 100644 index 000000000000..db4a11d5b476 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolver_client_example_test.go @@ -0,0 +1,217 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListGraphQLApiResolvers.json +func ExampleGraphQLAPIResolverClient_NewListByAPIPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewGraphQLAPIResolverClient().NewListByAPIPager("rg1", "apimService1", "57d2ef278aa04f0888cba3f3", &armapimanagement.GraphQLAPIResolverClientListByAPIOptions{Filter: nil, + Top: nil, + Skip: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ResolverCollection = armapimanagement.ResolverCollection{ + // Count: to.Ptr[int64](3), + // Value: []*armapimanagement.ResolverContract{ + // { + // Name: to.Ptr("57d2ef278aa04f0ad01d6cdc"), + // Type: to.Ptr("Microsoft.ApiManagement/service/apis/resolvers"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d2ef278aa04f0888cba3f3/resolvers/57d2ef278aa04f0ad01d6cdc"), + // Properties: &armapimanagement.ResolverEntityBaseContract{ + // Path: to.Ptr("Query/users"), + // Description: to.Ptr("A GraphQL Resolver example"), + // DisplayName: to.Ptr("Query Users"), + // }, + // }, + // { + // Name: to.Ptr("57d2ef278aa04f0ad01d6cda"), + // Type: to.Ptr("Microsoft.ApiManagement/service/apis/resolvers"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d2ef278aa04f0888cba3f3/resolvers/57d2ef278aa04f0ad01d6cda"), + // Properties: &armapimanagement.ResolverEntityBaseContract{ + // Path: to.Ptr("Mutation/makeUser"), + // Description: to.Ptr("A GraphQL Resolver example"), + // DisplayName: to.Ptr("Mutation makeUser"), + // }, + // }, + // { + // Name: to.Ptr("57d2ef278aa04f0ad01d6cd9"), + // Type: to.Ptr("Microsoft.ApiManagement/service/apis/resolvers"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d2ef278aa04f0888cba3f3/resolvers/57d2ef278aa04f0ad01d6cd9"), + // Properties: &armapimanagement.ResolverEntityBaseContract{ + // Path: to.Ptr("User/id"), + // Description: to.Ptr("A GraphQL Resolver example"), + // DisplayName: to.Ptr("Query for User Id field"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadGraphQLApiResolver.json +func ExampleGraphQLAPIResolverClient_GetEntityTag() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewGraphQLAPIResolverClient().GetEntityTag(ctx, "rg1", "apimService1", "57d2ef278aa04f0888cba3f3", "57d2ef278aa04f0ad01d6cdc", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetGraphQLApiResolver.json +func ExampleGraphQLAPIResolverClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewGraphQLAPIResolverClient().Get(ctx, "rg1", "apimService1", "57d2ef278aa04f0888cba3f3", "57d2ef278aa04f0ad01d6cdc", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ResolverContract = armapimanagement.ResolverContract{ + // Name: to.Ptr("57d2ef278aa04f0ad01d6cdc"), + // Type: to.Ptr("Microsoft.ApiManagement/service/apis/resolvers"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d2ef278aa04f0888cba3f3/resolvers/57d2ef278aa04f0ad01d6cdc"), + // Properties: &armapimanagement.ResolverEntityBaseContract{ + // Path: to.Ptr("Query/users"), + // Description: to.Ptr("A GraphQL Resolver example"), + // DisplayName: to.Ptr("Query Users"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateGraphQLApiResolver.json +func ExampleGraphQLAPIResolverClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewGraphQLAPIResolverClient().CreateOrUpdate(ctx, "rg1", "apimService1", "someAPI", "newResolver", armapimanagement.ResolverContract{ + Properties: &armapimanagement.ResolverEntityBaseContract{ + Path: to.Ptr("Query/users"), + Description: to.Ptr("A GraphQL Resolver example"), + DisplayName: to.Ptr("Query Users"), + }, + }, &armapimanagement.GraphQLAPIResolverClientCreateOrUpdateOptions{IfMatch: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ResolverContract = armapimanagement.ResolverContract{ + // Name: to.Ptr("newResolver"), + // Type: to.Ptr("Microsoft.ApiManagement/service/apis/resolvers"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/someAPI/resolvers/newResolver"), + // Properties: &armapimanagement.ResolverEntityBaseContract{ + // Path: to.Ptr("Query/users"), + // Description: to.Ptr("A GraphQL Resolver example"), + // DisplayName: to.Ptr("Query Users"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateGraphQLApiResolver.json +func ExampleGraphQLAPIResolverClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewGraphQLAPIResolverClient().Update(ctx, "rg1", "apimService1", "echo-api", "resolverId", "*", armapimanagement.ResolverUpdateContract{ + Properties: &armapimanagement.ResolverUpdateContractProperties{ + Path: to.Ptr("Query/adminUsers"), + Description: to.Ptr("A GraphQL Resolver example"), + DisplayName: to.Ptr("Query AdminUsers"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ResolverContract = armapimanagement.ResolverContract{ + // Name: to.Ptr("57d2ef278aa04f0ad01d6cdc"), + // Type: to.Ptr("Microsoft.ApiManagement/service/apis/resolvers"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/57d2ef278aa04f0888cba3f3/resolvers/57d2ef278aa04f0ad01d6cdc"), + // Properties: &armapimanagement.ResolverEntityBaseContract{ + // Path: to.Ptr("Query/adminUsers"), + // Description: to.Ptr("A GraphQL Resolver example"), + // DisplayName: to.Ptr("Query AdminUsers"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteGraphQLApiResolver.json +func ExampleGraphQLAPIResolverClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewGraphQLAPIResolverClient().Delete(ctx, "rg1", "apimService1", "57d2ef278aa04f0888cba3f3", "57d2ef278aa04f0ad01d6cdc", "*", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolverpolicy_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolverpolicy_client.go new file mode 100644 index 000000000000..66ba3accff3b --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolverpolicy_client.go @@ -0,0 +1,442 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armapimanagement + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// GraphQLAPIResolverPolicyClient contains the methods for the GraphQLAPIResolverPolicy group. +// Don't use this type directly, use NewGraphQLAPIResolverPolicyClient() instead. +type GraphQLAPIResolverPolicyClient struct { + internal *arm.Client + subscriptionID string +} + +// NewGraphQLAPIResolverPolicyClient creates a new instance of GraphQLAPIResolverPolicyClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewGraphQLAPIResolverPolicyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GraphQLAPIResolverPolicyClient, error) { + cl, err := arm.NewClient(moduleName+".GraphQLAPIResolverPolicyClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &GraphQLAPIResolverPolicyClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates policy configuration for the GraphQL API Resolver level. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - policyID - The identifier of the Policy. +// - parameters - The policy contents to apply. +// - options - GraphQLAPIResolverPolicyClientCreateOrUpdateOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.CreateOrUpdate +// method. +func (client *GraphQLAPIResolverPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, policyID PolicyIDName, parameters PolicyContract, options *GraphQLAPIResolverPolicyClientCreateOrUpdateOptions) (GraphQLAPIResolverPolicyClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, policyID, parameters, options) + if err != nil { + return GraphQLAPIResolverPolicyClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GraphQLAPIResolverPolicyClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return GraphQLAPIResolverPolicyClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *GraphQLAPIResolverPolicyClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, policyID PolicyIDName, parameters PolicyContract, options *GraphQLAPIResolverPolicyClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}/policies/{policyId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if policyID == "" { + return nil, errors.New("parameter policyID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{policyId}", url.PathEscape(string(policyID))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *GraphQLAPIResolverPolicyClient) createOrUpdateHandleResponse(resp *http.Response) (GraphQLAPIResolverPolicyClientCreateOrUpdateResponse, error) { + result := GraphQLAPIResolverPolicyClientCreateOrUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.PolicyContract); err != nil { + return GraphQLAPIResolverPolicyClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes the policy configuration at the GraphQL Api Resolver. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - policyID - The identifier of the Policy. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - GraphQLAPIResolverPolicyClientDeleteOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.Delete +// method. +func (client *GraphQLAPIResolverPolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, policyID PolicyIDName, ifMatch string, options *GraphQLAPIResolverPolicyClientDeleteOptions) (GraphQLAPIResolverPolicyClientDeleteResponse, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, policyID, ifMatch, options) + if err != nil { + return GraphQLAPIResolverPolicyClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GraphQLAPIResolverPolicyClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return GraphQLAPIResolverPolicyClientDeleteResponse{}, err + } + return GraphQLAPIResolverPolicyClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *GraphQLAPIResolverPolicyClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, policyID PolicyIDName, ifMatch string, options *GraphQLAPIResolverPolicyClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}/policies/{policyId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if policyID == "" { + return nil, errors.New("parameter policyID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{policyId}", url.PathEscape(string(policyID))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the policy configuration at the GraphQL API Resolver level. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - policyID - The identifier of the Policy. +// - options - GraphQLAPIResolverPolicyClientGetOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.Get +// method. +func (client *GraphQLAPIResolverPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, policyID PolicyIDName, options *GraphQLAPIResolverPolicyClientGetOptions) (GraphQLAPIResolverPolicyClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, policyID, options) + if err != nil { + return GraphQLAPIResolverPolicyClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GraphQLAPIResolverPolicyClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GraphQLAPIResolverPolicyClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *GraphQLAPIResolverPolicyClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, policyID PolicyIDName, options *GraphQLAPIResolverPolicyClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}/policies/{policyId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if policyID == "" { + return nil, errors.New("parameter policyID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{policyId}", url.PathEscape(string(policyID))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Format != nil { + reqQP.Set("format", string(*options.Format)) + } + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *GraphQLAPIResolverPolicyClient) getHandleResponse(resp *http.Response) (GraphQLAPIResolverPolicyClientGetResponse, error) { + result := GraphQLAPIResolverPolicyClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.PolicyContract); err != nil { + return GraphQLAPIResolverPolicyClientGetResponse{}, err + } + return result, nil +} + +// GetEntityTag - Gets the entity state (Etag) version of the GraphQL API resolver policy specified by its identifier. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - policyID - The identifier of the Policy. +// - options - GraphQLAPIResolverPolicyClientGetEntityTagOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.GetEntityTag +// method. +func (client *GraphQLAPIResolverPolicyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, policyID PolicyIDName, options *GraphQLAPIResolverPolicyClientGetEntityTagOptions) (GraphQLAPIResolverPolicyClientGetEntityTagResponse, error) { + var err error + req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, policyID, options) + if err != nil { + return GraphQLAPIResolverPolicyClientGetEntityTagResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GraphQLAPIResolverPolicyClientGetEntityTagResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GraphQLAPIResolverPolicyClientGetEntityTagResponse{}, err + } + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err +} + +// getEntityTagCreateRequest creates the GetEntityTag request. +func (client *GraphQLAPIResolverPolicyClient) getEntityTagCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, policyID PolicyIDName, options *GraphQLAPIResolverPolicyClientGetEntityTagOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}/policies/{policyId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if policyID == "" { + return nil, errors.New("parameter policyID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{policyId}", url.PathEscape(string(policyID))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getEntityTagHandleResponse handles the GetEntityTag response. +func (client *GraphQLAPIResolverPolicyClient) getEntityTagHandleResponse(resp *http.Response) (GraphQLAPIResolverPolicyClientGetEntityTagResponse, error) { + result := GraphQLAPIResolverPolicyClientGetEntityTagResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + result.Success = resp.StatusCode >= 200 && resp.StatusCode < 300 + return result, nil +} + +// NewListByResolverPager - Get the list of policy configuration at the GraphQL API Resolver level. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - options - GraphQLAPIResolverPolicyClientListByResolverOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.NewListByResolverPager +// method. +func (client *GraphQLAPIResolverPolicyClient) NewListByResolverPager(resourceGroupName string, serviceName string, apiID string, resolverID string, options *GraphQLAPIResolverPolicyClientListByResolverOptions) *runtime.Pager[GraphQLAPIResolverPolicyClientListByResolverResponse] { + return runtime.NewPager(runtime.PagingHandler[GraphQLAPIResolverPolicyClientListByResolverResponse]{ + More: func(page GraphQLAPIResolverPolicyClientListByResolverResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GraphQLAPIResolverPolicyClientListByResolverResponse) (GraphQLAPIResolverPolicyClientListByResolverResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResolverCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return GraphQLAPIResolverPolicyClientListByResolverResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GraphQLAPIResolverPolicyClientListByResolverResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GraphQLAPIResolverPolicyClientListByResolverResponse{}, runtime.NewResponseError(resp) + } + return client.listByResolverHandleResponse(resp) + }, + }) +} + +// listByResolverCreateRequest creates the ListByResolver request. +func (client *GraphQLAPIResolverPolicyClient) listByResolverCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, options *GraphQLAPIResolverPolicyClientListByResolverOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}/policies" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResolverHandleResponse handles the ListByResolver response. +func (client *GraphQLAPIResolverPolicyClient) listByResolverHandleResponse(resp *http.Response) (GraphQLAPIResolverPolicyClientListByResolverResponse, error) { + result := GraphQLAPIResolverPolicyClientListByResolverResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PolicyCollection); err != nil { + return GraphQLAPIResolverPolicyClientListByResolverResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolverpolicy_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolverpolicy_client_example_test.go new file mode 100644 index 000000000000..01b22f96bf1d --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolverpolicy_client_example_test.go @@ -0,0 +1,151 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListGraphQLApiResolverPolicies.json +func ExampleGraphQLAPIResolverPolicyClient_NewListByResolverPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewGraphQLAPIResolverPolicyClient().NewListByResolverPager("rg1", "apimService1", "599e2953193c3c0bd0b3e2fa", "599e29ab193c3c0bd0b3e2fb", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.PolicyCollection = armapimanagement.PolicyCollection{ + // Count: to.Ptr[int64](1), + // Value: []*armapimanagement.PolicyContract{ + // { + // Name: to.Ptr("policy"), + // Type: to.Ptr("Microsoft.ApiManagement/service/apis/resolvers/policies"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/599e2953193c3c0bd0b3e2fa/resolvers/599e29ab193c3c0bd0b3e2fb/policies/policy"), + // Properties: &armapimanagement.PolicyContractProperties{ + // Value: to.Ptr("\r\n\r\n \r\n GET\r\n\r\n/api/users \r\n \r\n \r\n \r\n \r\n \r\n { \"id\": \"{{body.id}}\" } \r\n"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadGraphQLApiResolverPolicy.json +func ExampleGraphQLAPIResolverPolicyClient_GetEntityTag() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewGraphQLAPIResolverPolicyClient().GetEntityTag(ctx, "rg1", "apimService1", "5600b539c53f5b0062040001", "5600b53ac53f5b0062080006", armapimanagement.PolicyIDNamePolicy, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetGraphQLApiResolverPolicy.json +func ExampleGraphQLAPIResolverPolicyClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewGraphQLAPIResolverPolicyClient().Get(ctx, "rg1", "apimService1", "5600b539c53f5b0062040001", "5600b53ac53f5b0062080006", armapimanagement.PolicyIDNamePolicy, &armapimanagement.GraphQLAPIResolverPolicyClientGetOptions{Format: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.PolicyContract = armapimanagement.PolicyContract{ + // Name: to.Ptr("policy"), + // Type: to.Ptr("Microsoft.ApiManagement/service/apis/resolvers/policies"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/5600b539c53f5b0062040001/resolvers/5600b53ac53f5b0062080006/policies/policy"), + // Properties: &armapimanagement.PolicyContractProperties{ + // Value: to.Ptr("\r\n \r\n GET\r\n\r\n/api/users\r\n\r\n"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateGraphQLApiResolverPolicy.json +func ExampleGraphQLAPIResolverPolicyClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewGraphQLAPIResolverPolicyClient().CreateOrUpdate(ctx, "rg1", "apimService1", "5600b57e7e8880006a040001", "5600b57e7e8880006a080001", armapimanagement.PolicyIDNamePolicy, armapimanagement.PolicyContract{ + Properties: &armapimanagement.PolicyContractProperties{ + Format: to.Ptr(armapimanagement.PolicyContentFormatXML), + Value: to.Ptr("GET/api/users"), + }, + }, &armapimanagement.GraphQLAPIResolverPolicyClientCreateOrUpdateOptions{IfMatch: to.Ptr("*")}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.PolicyContract = armapimanagement.PolicyContract{ + // Name: to.Ptr("policy"), + // Type: to.Ptr("Microsoft.ApiManagement/service/apis/resolvers/policies"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/5600b57e7e8880006a040001/resolvers/5600b57e7e8880006a080001/policies/policy"), + // Properties: &armapimanagement.PolicyContractProperties{ + // Value: to.Ptr("\r\n \r\n GET\r\n\r\n/api/users\r\n\r\n"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteGraphQLApiResolverPolicy.json +func ExampleGraphQLAPIResolverPolicyClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewGraphQLAPIResolverPolicyClient().Delete(ctx, "rg1", "apimService1", "testapi", "testResolver", armapimanagement.PolicyIDNamePolicy, "*", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/group_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/group_client.go index ffeba7d48fa7..a392c4cc0cdf 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/group_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/group_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type GroupClient struct { } // NewGroupClient creates a new instance of GroupClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewGroupClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupClient, error) { @@ -49,25 +47,28 @@ func NewGroupClient(subscriptionID string, credential azcore.TokenCredential, op // CreateOrUpdate - Creates or Updates a group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - groupID - Group identifier. Must be unique in the current API Management service instance. // - parameters - Create parameters. // - options - GroupClientCreateOrUpdateOptions contains the optional parameters for the GroupClient.CreateOrUpdate method. func (client *GroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, groupID string, parameters GroupCreateParameters, options *GroupClientCreateOrUpdateOptions) (GroupClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, groupID, parameters, options) if err != nil { return GroupClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GroupClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return GroupClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return GroupClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -94,13 +95,16 @@ func (client *GroupClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -118,24 +122,26 @@ func (client *GroupClient) createOrUpdateHandleResponse(resp *http.Response) (Gr // Delete - Deletes specific group of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - groupID - Group identifier. Must be unique in the current API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - options - GroupClientDeleteOptions contains the optional parameters for the GroupClient.Delete method. func (client *GroupClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, groupID string, ifMatch string, options *GroupClientDeleteOptions) (GroupClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, groupID, ifMatch, options) if err != nil { return GroupClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GroupClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return GroupClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return GroupClientDeleteResponse{}, err } return GroupClientDeleteResponse{}, nil } @@ -164,7 +170,7 @@ func (client *GroupClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -174,24 +180,27 @@ func (client *GroupClient) deleteCreateRequest(ctx context.Context, resourceGrou // Get - Gets the details of the group specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - groupID - Group identifier. Must be unique in the current API Management service instance. // - options - GroupClientGetOptions contains the optional parameters for the GroupClient.Get method. func (client *GroupClient) Get(ctx context.Context, resourceGroupName string, serviceName string, groupID string, options *GroupClientGetOptions) (GroupClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, groupID, options) if err != nil { return GroupClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GroupClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GroupClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GroupClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -218,7 +227,7 @@ func (client *GroupClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,24 +247,27 @@ func (client *GroupClient) getHandleResponse(resp *http.Response) (GroupClientGe // GetEntityTag - Gets the entity state (Etag) version of the group specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - groupID - Group identifier. Must be unique in the current API Management service instance. // - options - GroupClientGetEntityTagOptions contains the optional parameters for the GroupClient.GetEntityTag method. func (client *GroupClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, groupID string, options *GroupClientGetEntityTagOptions) (GroupClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, groupID, options) if err != nil { return GroupClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GroupClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GroupClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GroupClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -282,7 +294,7 @@ func (client *GroupClient) getEntityTagCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -300,8 +312,8 @@ func (client *GroupClient) getEntityTagHandleResponse(resp *http.Response) (Grou // NewListByServicePager - Lists a collection of groups defined within a service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - GroupClientListByServiceOptions contains the optional parameters for the GroupClient.NewListByServicePager method. func (client *GroupClient) NewListByServicePager(resourceGroupName string, serviceName string, options *GroupClientListByServiceOptions) *runtime.Pager[GroupClientListByServiceResponse] { @@ -361,7 +373,7 @@ func (client *GroupClient) listByServiceCreateRequest(ctx context.Context, resou if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -379,8 +391,8 @@ func (client *GroupClient) listByServiceHandleResponse(resp *http.Response) (Gro // Update - Updates the details of the group specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - groupID - Group identifier. Must be unique in the current API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -388,18 +400,21 @@ func (client *GroupClient) listByServiceHandleResponse(resp *http.Response) (Gro // - parameters - Update parameters. // - options - GroupClientUpdateOptions contains the optional parameters for the GroupClient.Update method. func (client *GroupClient) Update(ctx context.Context, resourceGroupName string, serviceName string, groupID string, ifMatch string, parameters GroupUpdateParameters, options *GroupClientUpdateOptions) (GroupClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, groupID, ifMatch, parameters, options) if err != nil { return GroupClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GroupClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GroupClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GroupClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -426,11 +441,14 @@ func (client *GroupClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/group_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/group_client_example_test.go index 851297dbd73e..1ad7bd641806 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/group_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/group_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGroups.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListGroups.json func ExampleGroupClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -95,7 +95,7 @@ func ExampleGroupClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadGroup.json func ExampleGroupClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -112,7 +112,7 @@ func ExampleGroupClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetGroup.json func ExampleGroupClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -144,7 +144,7 @@ func ExampleGroupClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateGroup.json func ExampleGroupClient_CreateOrUpdate_apiManagementCreateGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -177,7 +177,7 @@ func ExampleGroupClient_CreateOrUpdate_apiManagementCreateGroup() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGroupExternal.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateGroupExternal.json func ExampleGroupClient_CreateOrUpdate_apiManagementCreateGroupExternal() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -215,7 +215,7 @@ func ExampleGroupClient_CreateOrUpdate_apiManagementCreateGroupExternal() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateGroup.json func ExampleGroupClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -251,7 +251,7 @@ func ExampleGroupClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteGroup.json func ExampleGroupClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/groupuser_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/groupuser_client.go index 78b782fc7a2b..98562845236f 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/groupuser_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/groupuser_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type GroupUserClient struct { } // NewGroupUserClient creates a new instance of GroupUserClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewGroupUserClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupUserClient, error) { @@ -48,26 +46,28 @@ func NewGroupUserClient(subscriptionID string, credential azcore.TokenCredential // CheckEntityExists - Checks that user entity specified by identifier is associated with the group entity. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - groupID - Group identifier. Must be unique in the current API Management service instance. // - userID - User identifier. Must be unique in the current API Management service instance. // - options - GroupUserClientCheckEntityExistsOptions contains the optional parameters for the GroupUserClient.CheckEntityExists // method. func (client *GroupUserClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string, options *GroupUserClientCheckEntityExistsOptions) (GroupUserClientCheckEntityExistsResponse, error) { + var err error req, err := client.checkEntityExistsCreateRequest(ctx, resourceGroupName, serviceName, groupID, userID, options) if err != nil { return GroupUserClientCheckEntityExistsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GroupUserClientCheckEntityExistsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent, http.StatusNotFound) { - return GroupUserClientCheckEntityExistsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent, http.StatusNotFound) { + err = runtime.NewResponseError(httpResp) + return GroupUserClientCheckEntityExistsResponse{}, err } - return GroupUserClientCheckEntityExistsResponse{Success: resp.StatusCode >= 200 && resp.StatusCode < 300}, nil + return GroupUserClientCheckEntityExistsResponse{Success: httpResp.StatusCode >= 200 && httpResp.StatusCode < 300}, nil } // checkEntityExistsCreateRequest creates the CheckEntityExists request. @@ -98,7 +98,7 @@ func (client *GroupUserClient) checkEntityExistsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -107,25 +107,28 @@ func (client *GroupUserClient) checkEntityExistsCreateRequest(ctx context.Contex // Create - Add existing user to existing group // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - groupID - Group identifier. Must be unique in the current API Management service instance. // - userID - User identifier. Must be unique in the current API Management service instance. // - options - GroupUserClientCreateOptions contains the optional parameters for the GroupUserClient.Create method. func (client *GroupUserClient) Create(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string, options *GroupUserClientCreateOptions) (GroupUserClientCreateResponse, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, serviceName, groupID, userID, options) if err != nil { return GroupUserClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GroupUserClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return GroupUserClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return GroupUserClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. @@ -156,7 +159,7 @@ func (client *GroupUserClient) createCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,23 +177,25 @@ func (client *GroupUserClient) createHandleResponse(resp *http.Response) (GroupU // Delete - Remove existing user from existing group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - groupID - Group identifier. Must be unique in the current API Management service instance. // - userID - User identifier. Must be unique in the current API Management service instance. // - options - GroupUserClientDeleteOptions contains the optional parameters for the GroupUserClient.Delete method. func (client *GroupUserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string, options *GroupUserClientDeleteOptions) (GroupUserClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, groupID, userID, options) if err != nil { return GroupUserClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GroupUserClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return GroupUserClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return GroupUserClientDeleteResponse{}, err } return GroupUserClientDeleteResponse{}, nil } @@ -223,7 +228,7 @@ func (client *GroupUserClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -231,8 +236,8 @@ func (client *GroupUserClient) deleteCreateRequest(ctx context.Context, resource // NewListPager - Lists a collection of user entities associated with the group. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - groupID - Group identifier. Must be unique in the current API Management service instance. // - options - GroupUserClientListOptions contains the optional parameters for the GroupUserClient.NewListPager method. @@ -297,7 +302,7 @@ func (client *GroupUserClient) listCreateRequest(ctx context.Context, resourceGr if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/groupuser_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/groupuser_client_example_test.go index d08c356e941b..f41c207544b0 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/groupuser_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/groupuser_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGroupUsers.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListGroupUsers.json func ExampleGroupUserClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -67,7 +67,7 @@ func ExampleGroupUserClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGroupUser.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadGroupUser.json func ExampleGroupUserClient_CheckEntityExists() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -84,7 +84,7 @@ func ExampleGroupUserClient_CheckEntityExists() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGroupUser.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateGroupUser.json func ExampleGroupUserClient_Create() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -120,7 +120,7 @@ func ExampleGroupUserClient_Create() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGroupUser.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteGroupUser.json func ExampleGroupUserClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/identityprovider_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/identityprovider_client.go index 4cdfd29ce200..b7a78e36684b 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/identityprovider_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/identityprovider_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type IdentityProviderClient struct { } // NewIdentityProviderClient creates a new instance of IdentityProviderClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewIdentityProviderClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IdentityProviderClient, error) { @@ -48,26 +46,29 @@ func NewIdentityProviderClient(subscriptionID string, credential azcore.TokenCre // CreateOrUpdate - Creates or Updates the IdentityProvider configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - identityProviderName - Identity Provider Type identifier. // - parameters - Create parameters. // - options - IdentityProviderClientCreateOrUpdateOptions contains the optional parameters for the IdentityProviderClient.CreateOrUpdate // method. func (client *IdentityProviderClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, parameters IdentityProviderCreateContract, options *IdentityProviderClientCreateOrUpdateOptions) (IdentityProviderClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, identityProviderName, parameters, options) if err != nil { return IdentityProviderClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IdentityProviderClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return IdentityProviderClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return IdentityProviderClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -94,13 +95,16 @@ func (client *IdentityProviderClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -118,24 +122,26 @@ func (client *IdentityProviderClient) createOrUpdateHandleResponse(resp *http.Re // Delete - Deletes the specified identity provider configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - identityProviderName - Identity Provider Type identifier. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - options - IdentityProviderClientDeleteOptions contains the optional parameters for the IdentityProviderClient.Delete method. func (client *IdentityProviderClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, ifMatch string, options *IdentityProviderClientDeleteOptions) (IdentityProviderClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, identityProviderName, ifMatch, options) if err != nil { return IdentityProviderClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IdentityProviderClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return IdentityProviderClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return IdentityProviderClientDeleteResponse{}, err } return IdentityProviderClientDeleteResponse{}, nil } @@ -164,7 +170,7 @@ func (client *IdentityProviderClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -174,24 +180,27 @@ func (client *IdentityProviderClient) deleteCreateRequest(ctx context.Context, r // Get - Gets the configuration details of the identity Provider configured in specified service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - identityProviderName - Identity Provider Type identifier. // - options - IdentityProviderClientGetOptions contains the optional parameters for the IdentityProviderClient.Get method. func (client *IdentityProviderClient) Get(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, options *IdentityProviderClientGetOptions) (IdentityProviderClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, identityProviderName, options) if err != nil { return IdentityProviderClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IdentityProviderClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IdentityProviderClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IdentityProviderClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -218,7 +227,7 @@ func (client *IdentityProviderClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,25 +247,28 @@ func (client *IdentityProviderClient) getHandleResponse(resp *http.Response) (Id // GetEntityTag - Gets the entity state (Etag) version of the identityProvider specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - identityProviderName - Identity Provider Type identifier. // - options - IdentityProviderClientGetEntityTagOptions contains the optional parameters for the IdentityProviderClient.GetEntityTag // method. func (client *IdentityProviderClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, options *IdentityProviderClientGetEntityTagOptions) (IdentityProviderClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, identityProviderName, options) if err != nil { return IdentityProviderClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IdentityProviderClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IdentityProviderClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IdentityProviderClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -283,7 +295,7 @@ func (client *IdentityProviderClient) getEntityTagCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -301,8 +313,8 @@ func (client *IdentityProviderClient) getEntityTagHandleResponse(resp *http.Resp // NewListByServicePager - Lists a collection of Identity Provider configured in the specified service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - IdentityProviderClientListByServiceOptions contains the optional parameters for the IdentityProviderClient.NewListByServicePager // method. @@ -354,7 +366,7 @@ func (client *IdentityProviderClient) listByServiceCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -372,25 +384,28 @@ func (client *IdentityProviderClient) listByServiceHandleResponse(resp *http.Res // ListSecrets - Gets the client secret details of the Identity Provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - identityProviderName - Identity Provider Type identifier. // - options - IdentityProviderClientListSecretsOptions contains the optional parameters for the IdentityProviderClient.ListSecrets // method. func (client *IdentityProviderClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, options *IdentityProviderClientListSecretsOptions) (IdentityProviderClientListSecretsResponse, error) { + var err error req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, serviceName, identityProviderName, options) if err != nil { return IdentityProviderClientListSecretsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IdentityProviderClientListSecretsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IdentityProviderClientListSecretsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IdentityProviderClientListSecretsResponse{}, err } - return client.listSecretsHandleResponse(resp) + resp, err := client.listSecretsHandleResponse(httpResp) + return resp, err } // listSecretsCreateRequest creates the ListSecrets request. @@ -417,7 +432,7 @@ func (client *IdentityProviderClient) listSecretsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -438,8 +453,8 @@ func (client *IdentityProviderClient) listSecretsHandleResponse(resp *http.Respo // Update - Updates an existing IdentityProvider configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - identityProviderName - Identity Provider Type identifier. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -447,18 +462,21 @@ func (client *IdentityProviderClient) listSecretsHandleResponse(resp *http.Respo // - parameters - Update parameters. // - options - IdentityProviderClientUpdateOptions contains the optional parameters for the IdentityProviderClient.Update method. func (client *IdentityProviderClient) Update(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, ifMatch string, parameters IdentityProviderUpdateParameters, options *IdentityProviderClientUpdateOptions) (IdentityProviderClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, identityProviderName, ifMatch, parameters, options) if err != nil { return IdentityProviderClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IdentityProviderClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IdentityProviderClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IdentityProviderClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -485,11 +503,14 @@ func (client *IdentityProviderClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/identityprovider_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/identityprovider_client_example_test.go index c6aee165c61e..ad17bc328da6 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/identityprovider_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/identityprovider_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListIdentityProviders.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListIdentityProviders.json func ExampleIdentityProviderClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -80,7 +80,7 @@ func ExampleIdentityProviderClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadIdentityProvider.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadIdentityProvider.json func ExampleIdentityProviderClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -97,7 +97,7 @@ func ExampleIdentityProviderClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetIdentityProvider.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetIdentityProvider.json func ExampleIdentityProviderClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -133,7 +133,7 @@ func ExampleIdentityProviderClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateIdentityProvider.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateIdentityProvider.json func ExampleIdentityProviderClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -167,7 +167,7 @@ func ExampleIdentityProviderClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateIdentityProvider.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateIdentityProvider.json func ExampleIdentityProviderClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -208,7 +208,7 @@ func ExampleIdentityProviderClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteIdentityProvider.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteIdentityProvider.json func ExampleIdentityProviderClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -225,7 +225,7 @@ func ExampleIdentityProviderClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementIdentityProviderListSecrets.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementIdentityProviderListSecrets.json func ExampleIdentityProviderClient_ListSecrets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/issue_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/issue_client.go index 3172e5e7a869..b966dbc0c72a 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/issue_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/issue_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type IssueClient struct { } // NewIssueClient creates a new instance of IssueClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewIssueClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IssueClient, error) { @@ -49,24 +47,27 @@ func NewIssueClient(subscriptionID string, credential azcore.TokenCredential, op // Get - Gets API Management issue details // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - issueID - Issue identifier. Must be unique in the current API Management service instance. // - options - IssueClientGetOptions contains the optional parameters for the IssueClient.Get method. func (client *IssueClient) Get(ctx context.Context, resourceGroupName string, serviceName string, issueID string, options *IssueClientGetOptions) (IssueClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, issueID, options) if err != nil { return IssueClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IssueClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IssueClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IssueClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -93,7 +94,7 @@ func (client *IssueClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -113,8 +114,8 @@ func (client *IssueClient) getHandleResponse(resp *http.Response) (IssueClientGe // NewListByServicePager - Lists a collection of issues in the specified service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - IssueClientListByServiceOptions contains the optional parameters for the IssueClient.NewListByServicePager method. func (client *IssueClient) NewListByServicePager(resourceGroupName string, serviceName string, options *IssueClientListByServiceOptions) *runtime.Pager[IssueClientListByServiceResponse] { @@ -174,7 +175,7 @@ func (client *IssueClient) listByServiceCreateRequest(ctx context.Context, resou if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/issue_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/issue_client_example_test.go index 11c8c59f6745..dcda8fae380d 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/issue_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/issue_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListIssues.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListIssues.json func ExampleIssueClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -62,7 +62,7 @@ func ExampleIssueClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetIssue.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetIssue.json func ExampleIssueClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/logger_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/logger_client.go index 3ad0afd2ffdf..e6e23060620e 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/logger_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/logger_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type LoggerClient struct { } // NewLoggerClient creates a new instance of LoggerClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewLoggerClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoggerClient, error) { @@ -49,25 +47,28 @@ func NewLoggerClient(subscriptionID string, credential azcore.TokenCredential, o // CreateOrUpdate - Creates or Updates a logger. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - loggerID - Logger identifier. Must be unique in the API Management service instance. // - parameters - Create parameters. // - options - LoggerClientCreateOrUpdateOptions contains the optional parameters for the LoggerClient.CreateOrUpdate method. func (client *LoggerClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, parameters LoggerContract, options *LoggerClientCreateOrUpdateOptions) (LoggerClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, loggerID, parameters, options) if err != nil { return LoggerClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LoggerClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return LoggerClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return LoggerClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -94,13 +95,16 @@ func (client *LoggerClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -118,24 +122,26 @@ func (client *LoggerClient) createOrUpdateHandleResponse(resp *http.Response) (L // Delete - Deletes the specified logger. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - loggerID - Logger identifier. Must be unique in the API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - options - LoggerClientDeleteOptions contains the optional parameters for the LoggerClient.Delete method. func (client *LoggerClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, ifMatch string, options *LoggerClientDeleteOptions) (LoggerClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, loggerID, ifMatch, options) if err != nil { return LoggerClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LoggerClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return LoggerClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return LoggerClientDeleteResponse{}, err } return LoggerClientDeleteResponse{}, nil } @@ -164,7 +170,7 @@ func (client *LoggerClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -174,24 +180,27 @@ func (client *LoggerClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Gets the details of the logger specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - loggerID - Logger identifier. Must be unique in the API Management service instance. // - options - LoggerClientGetOptions contains the optional parameters for the LoggerClient.Get method. func (client *LoggerClient) Get(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, options *LoggerClientGetOptions) (LoggerClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, loggerID, options) if err != nil { return LoggerClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LoggerClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LoggerClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LoggerClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -218,7 +227,7 @@ func (client *LoggerClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,24 +247,27 @@ func (client *LoggerClient) getHandleResponse(resp *http.Response) (LoggerClient // GetEntityTag - Gets the entity state (Etag) version of the logger specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - loggerID - Logger identifier. Must be unique in the API Management service instance. // - options - LoggerClientGetEntityTagOptions contains the optional parameters for the LoggerClient.GetEntityTag method. func (client *LoggerClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, options *LoggerClientGetEntityTagOptions) (LoggerClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, loggerID, options) if err != nil { return LoggerClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LoggerClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LoggerClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LoggerClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -282,7 +294,7 @@ func (client *LoggerClient) getEntityTagCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -300,8 +312,8 @@ func (client *LoggerClient) getEntityTagHandleResponse(resp *http.Response) (Log // NewListByServicePager - Lists a collection of loggers in the specified service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - LoggerClientListByServiceOptions contains the optional parameters for the LoggerClient.NewListByServicePager // method. @@ -362,7 +374,7 @@ func (client *LoggerClient) listByServiceCreateRequest(ctx context.Context, reso if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -380,8 +392,8 @@ func (client *LoggerClient) listByServiceHandleResponse(resp *http.Response) (Lo // Update - Updates an existing logger. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - loggerID - Logger identifier. Must be unique in the API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -389,18 +401,21 @@ func (client *LoggerClient) listByServiceHandleResponse(resp *http.Response) (Lo // - parameters - Update parameters. // - options - LoggerClientUpdateOptions contains the optional parameters for the LoggerClient.Update method. func (client *LoggerClient) Update(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, ifMatch string, parameters LoggerUpdateContract, options *LoggerClientUpdateOptions) (LoggerClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, loggerID, ifMatch, parameters, options) if err != nil { return LoggerClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LoggerClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LoggerClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LoggerClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -427,11 +442,14 @@ func (client *LoggerClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/logger_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/logger_client_example_test.go index 317b37e5241e..c427d53a4a1f 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/logger_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/logger_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListLoggers.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListLoggers.json func ExampleLoggerClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -84,7 +84,7 @@ func ExampleLoggerClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadLogger.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadLogger.json func ExampleLoggerClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -101,7 +101,7 @@ func ExampleLoggerClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetLogger.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetLogger.json func ExampleLoggerClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -136,7 +136,7 @@ func ExampleLoggerClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateAILogger.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateAILogger.json func ExampleLoggerClient_CreateOrUpdate_apiManagementCreateAiLogger() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -176,7 +176,7 @@ func ExampleLoggerClient_CreateOrUpdate_apiManagementCreateAiLogger() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateEHLogger.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateEHLogger.json func ExampleLoggerClient_CreateOrUpdate_apiManagementCreateEhLogger() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -218,7 +218,7 @@ func ExampleLoggerClient_CreateOrUpdate_apiManagementCreateEhLogger() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateLogger.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateLogger.json func ExampleLoggerClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -256,7 +256,7 @@ func ExampleLoggerClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteLogger.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteLogger.json func ExampleLoggerClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/models.go b/sdk/resourcemanager/apimanagement/armapimanagement/models.go index 492def6fc900..3681bdb0a2bd 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/models.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/models.go @@ -3,84 +3,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement import "time" -// APIClientBeginCreateOrUpdateOptions contains the optional parameters for the APIClient.BeginCreateOrUpdate method. -type APIClientBeginCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string - // Resumes the LRO from the provided token. - ResumeToken string -} - -// APIClientDeleteOptions contains the optional parameters for the APIClient.Delete method. -type APIClientDeleteOptions struct { - // Delete all revisions of the Api. - DeleteRevisions *bool -} - -// APIClientGetEntityTagOptions contains the optional parameters for the APIClient.GetEntityTag method. -type APIClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// APIClientGetOptions contains the optional parameters for the APIClient.Get method. -type APIClientGetOptions struct { - // placeholder for future optional parameters -} - -// APIClientListByServiceOptions contains the optional parameters for the APIClient.NewListByServicePager method. -type APIClientListByServiceOptions struct { - // Include full ApiVersionSet resource in response - ExpandAPIVersionSet *bool - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | isCurrent | filter | eq, ne | | - Filter *string - // Number of records to skip. - Skip *int32 - // Include tags in the response. - Tags *string - // Number of records to return. - Top *int32 -} - -// APIClientListByTagsOptions contains the optional parameters for the APIClient.NewListByTagsPager method. -type APIClientListByTagsOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | isCurrent | filter | eq | | - Filter *string - // Include not tagged APIs. - IncludeNotTaggedApis *bool - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// APIClientUpdateOptions contains the optional parameters for the APIClient.Update method. -type APIClientUpdateOptions struct { - // placeholder for future optional parameters -} - // APICollection - Paged API list representation. type APICollection struct { // Total record count number across all pages. @@ -330,6 +259,10 @@ type APICreateOrUpdateProperties struct { // A URL to the Terms of Service for the API. MUST be in the format of a URL. TermsOfServiceURL *string + // Strategy of translating required query parameters to template ones. By default has value 'template'. Possible values: 'template', + // 'query' + TranslateRequiredQueryParametersConduct *TranslateRequiredQueryParametersConduct + // Content value when Importing an API. Value *string @@ -349,45 +282,6 @@ type APICreateOrUpdatePropertiesWsdlSelector struct { WsdlServiceName *string } -// APIDiagnosticClientCreateOrUpdateOptions contains the optional parameters for the APIDiagnosticClient.CreateOrUpdate method. -type APIDiagnosticClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// APIDiagnosticClientDeleteOptions contains the optional parameters for the APIDiagnosticClient.Delete method. -type APIDiagnosticClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// APIDiagnosticClientGetEntityTagOptions contains the optional parameters for the APIDiagnosticClient.GetEntityTag method. -type APIDiagnosticClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// APIDiagnosticClientGetOptions contains the optional parameters for the APIDiagnosticClient.Get method. -type APIDiagnosticClientGetOptions struct { - // placeholder for future optional parameters -} - -// APIDiagnosticClientListByServiceOptions contains the optional parameters for the APIDiagnosticClient.NewListByServicePager -// method. -type APIDiagnosticClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// APIDiagnosticClientUpdateOptions contains the optional parameters for the APIDiagnosticClient.Update method. -type APIDiagnosticClientUpdateOptions struct { - // placeholder for future optional parameters -} - // APIEntityBaseContract - API base contract details. type APIEntityBaseContract struct { // Describes the revision of the API. If no value is provided, default revision 1 is created @@ -436,11 +330,6 @@ type APIEntityBaseContract struct { IsOnline *bool } -// APIExportClientGetOptions contains the optional parameters for the APIExportClient.Get method. -type APIExportClientGetOptions struct { - // placeholder for future optional parameters -} - // APIExportResult - API Export result. type APIExportResult struct { // Format in which the API Details are exported to the Storage Blob with Sas Key valid for 5 minutes. @@ -459,122 +348,6 @@ type APIExportResultValue struct { Link *string } -// APIIssueAttachmentClientCreateOrUpdateOptions contains the optional parameters for the APIIssueAttachmentClient.CreateOrUpdate -// method. -type APIIssueAttachmentClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// APIIssueAttachmentClientDeleteOptions contains the optional parameters for the APIIssueAttachmentClient.Delete method. -type APIIssueAttachmentClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// APIIssueAttachmentClientGetEntityTagOptions contains the optional parameters for the APIIssueAttachmentClient.GetEntityTag -// method. -type APIIssueAttachmentClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// APIIssueAttachmentClientGetOptions contains the optional parameters for the APIIssueAttachmentClient.Get method. -type APIIssueAttachmentClientGetOptions struct { - // placeholder for future optional parameters -} - -// APIIssueAttachmentClientListByServiceOptions contains the optional parameters for the APIIssueAttachmentClient.NewListByServicePager -// method. -type APIIssueAttachmentClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// APIIssueClientCreateOrUpdateOptions contains the optional parameters for the APIIssueClient.CreateOrUpdate method. -type APIIssueClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// APIIssueClientDeleteOptions contains the optional parameters for the APIIssueClient.Delete method. -type APIIssueClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// APIIssueClientGetEntityTagOptions contains the optional parameters for the APIIssueClient.GetEntityTag method. -type APIIssueClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// APIIssueClientGetOptions contains the optional parameters for the APIIssueClient.Get method. -type APIIssueClientGetOptions struct { - // Expand the comment attachments. - ExpandCommentsAttachments *bool -} - -// APIIssueClientListByServiceOptions contains the optional parameters for the APIIssueClient.NewListByServicePager method. -type APIIssueClientListByServiceOptions struct { - // Expand the comment attachments. - ExpandCommentsAttachments *bool - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | state | filter | eq | | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// APIIssueClientUpdateOptions contains the optional parameters for the APIIssueClient.Update method. -type APIIssueClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// APIIssueCommentClientCreateOrUpdateOptions contains the optional parameters for the APIIssueCommentClient.CreateOrUpdate -// method. -type APIIssueCommentClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// APIIssueCommentClientDeleteOptions contains the optional parameters for the APIIssueCommentClient.Delete method. -type APIIssueCommentClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// APIIssueCommentClientGetEntityTagOptions contains the optional parameters for the APIIssueCommentClient.GetEntityTag method. -type APIIssueCommentClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// APIIssueCommentClientGetOptions contains the optional parameters for the APIIssueCommentClient.Get method. -type APIIssueCommentClientGetOptions struct { - // placeholder for future optional parameters -} - -// APIIssueCommentClientListByServiceOptions contains the optional parameters for the APIIssueCommentClient.NewListByServicePager -// method. -type APIIssueCommentClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - // APILicenseInformation - API license information type APILicenseInformation struct { // The license name used for the API @@ -584,157 +357,6 @@ type APILicenseInformation struct { URL *string } -// APIOperationClientCreateOrUpdateOptions contains the optional parameters for the APIOperationClient.CreateOrUpdate method. -type APIOperationClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// APIOperationClientDeleteOptions contains the optional parameters for the APIOperationClient.Delete method. -type APIOperationClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// APIOperationClientGetEntityTagOptions contains the optional parameters for the APIOperationClient.GetEntityTag method. -type APIOperationClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// APIOperationClientGetOptions contains the optional parameters for the APIOperationClient.Get method. -type APIOperationClientGetOptions struct { - // placeholder for future optional parameters -} - -// APIOperationClientListByAPIOptions contains the optional parameters for the APIOperationClient.NewListByAPIPager method. -type APIOperationClientListByAPIOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Include tags in the response. - Tags *string - // Number of records to return. - Top *int32 -} - -// APIOperationClientUpdateOptions contains the optional parameters for the APIOperationClient.Update method. -type APIOperationClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// APIOperationPolicyClientCreateOrUpdateOptions contains the optional parameters for the APIOperationPolicyClient.CreateOrUpdate -// method. -type APIOperationPolicyClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// APIOperationPolicyClientDeleteOptions contains the optional parameters for the APIOperationPolicyClient.Delete method. -type APIOperationPolicyClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// APIOperationPolicyClientGetEntityTagOptions contains the optional parameters for the APIOperationPolicyClient.GetEntityTag -// method. -type APIOperationPolicyClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// APIOperationPolicyClientGetOptions contains the optional parameters for the APIOperationPolicyClient.Get method. -type APIOperationPolicyClientGetOptions struct { - // Policy Export Format. - Format *PolicyExportFormat -} - -// APIOperationPolicyClientListByOperationOptions contains the optional parameters for the APIOperationPolicyClient.ListByOperation -// method. -type APIOperationPolicyClientListByOperationOptions struct { - // placeholder for future optional parameters -} - -// APIPolicyClientCreateOrUpdateOptions contains the optional parameters for the APIPolicyClient.CreateOrUpdate method. -type APIPolicyClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// APIPolicyClientDeleteOptions contains the optional parameters for the APIPolicyClient.Delete method. -type APIPolicyClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// APIPolicyClientGetEntityTagOptions contains the optional parameters for the APIPolicyClient.GetEntityTag method. -type APIPolicyClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// APIPolicyClientGetOptions contains the optional parameters for the APIPolicyClient.Get method. -type APIPolicyClientGetOptions struct { - // Policy Export Format. - Format *PolicyExportFormat -} - -// APIPolicyClientListByAPIOptions contains the optional parameters for the APIPolicyClient.ListByAPI method. -type APIPolicyClientListByAPIOptions struct { - // placeholder for future optional parameters -} - -// APIProductClientListByApisOptions contains the optional parameters for the APIProductClient.NewListByApisPager method. -type APIProductClientListByApisOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// APIReleaseClientCreateOrUpdateOptions contains the optional parameters for the APIReleaseClient.CreateOrUpdate method. -type APIReleaseClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// APIReleaseClientDeleteOptions contains the optional parameters for the APIReleaseClient.Delete method. -type APIReleaseClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// APIReleaseClientGetEntityTagOptions contains the optional parameters for the APIReleaseClient.GetEntityTag method. -type APIReleaseClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// APIReleaseClientGetOptions contains the optional parameters for the APIReleaseClient.Get method. -type APIReleaseClientGetOptions struct { - // placeholder for future optional parameters -} - -// APIReleaseClientListByServiceOptions contains the optional parameters for the APIReleaseClient.NewListByServicePager method. -type APIReleaseClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | notes | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// APIReleaseClientUpdateOptions contains the optional parameters for the APIReleaseClient.Update method. -type APIReleaseClientUpdateOptions struct { - // placeholder for future optional parameters -} - // APIReleaseCollection - Paged ApiRelease list representation. type APIReleaseCollection struct { // Total record count number across all pages. @@ -778,19 +400,6 @@ type APIReleaseContractProperties struct { UpdatedDateTime *time.Time } -// APIRevisionClientListByServiceOptions contains the optional parameters for the APIRevisionClient.NewListByServicePager -// method. -type APIRevisionClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - // APIRevisionCollection - Paged API Revision list representation. type APIRevisionCollection struct { // Total record count number across all pages. @@ -847,80 +456,6 @@ type APIRevisionInfoContract struct { SourceAPIID *string } -// APISchemaClientBeginCreateOrUpdateOptions contains the optional parameters for the APISchemaClient.BeginCreateOrUpdate -// method. -type APISchemaClientBeginCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string - // Resumes the LRO from the provided token. - ResumeToken string -} - -// APISchemaClientDeleteOptions contains the optional parameters for the APISchemaClient.Delete method. -type APISchemaClientDeleteOptions struct { - // If true removes all references to the schema before deleting it. - Force *bool -} - -// APISchemaClientGetEntityTagOptions contains the optional parameters for the APISchemaClient.GetEntityTag method. -type APISchemaClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// APISchemaClientGetOptions contains the optional parameters for the APISchemaClient.Get method. -type APISchemaClientGetOptions struct { - // placeholder for future optional parameters -} - -// APISchemaClientListByAPIOptions contains the optional parameters for the APISchemaClient.NewListByAPIPager method. -type APISchemaClientListByAPIOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | contentType | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// APITagDescriptionClientCreateOrUpdateOptions contains the optional parameters for the APITagDescriptionClient.CreateOrUpdate -// method. -type APITagDescriptionClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// APITagDescriptionClientDeleteOptions contains the optional parameters for the APITagDescriptionClient.Delete method. -type APITagDescriptionClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// APITagDescriptionClientGetEntityTagOptions contains the optional parameters for the APITagDescriptionClient.GetEntityTag -// method. -type APITagDescriptionClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// APITagDescriptionClientGetOptions contains the optional parameters for the APITagDescriptionClient.Get method. -type APITagDescriptionClientGetOptions struct { - // placeholder for future optional parameters -} - -// APITagDescriptionClientListByServiceOptions contains the optional parameters for the APITagDescriptionClient.NewListByServicePager -// method. -type APITagDescriptionClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - // APITagResourceContractProperties - API contract properties for the Tag Resources. type APITagResourceContractProperties struct { // Describes the revision of the API. If no value is provided, default revision 1 is created @@ -998,44 +533,6 @@ type APIVersionConstraint struct { MinAPIVersion *string } -// APIVersionSetClientCreateOrUpdateOptions contains the optional parameters for the APIVersionSetClient.CreateOrUpdate method. -type APIVersionSetClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// APIVersionSetClientDeleteOptions contains the optional parameters for the APIVersionSetClient.Delete method. -type APIVersionSetClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// APIVersionSetClientGetEntityTagOptions contains the optional parameters for the APIVersionSetClient.GetEntityTag method. -type APIVersionSetClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// APIVersionSetClientGetOptions contains the optional parameters for the APIVersionSetClient.Get method. -type APIVersionSetClientGetOptions struct { - // placeholder for future optional parameters -} - -// APIVersionSetClientListByServiceOptions contains the optional parameters for the APIVersionSetClient.NewListByServicePager -// method. -type APIVersionSetClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// APIVersionSetClientUpdateOptions contains the optional parameters for the APIVersionSetClient.Update method. -type APIVersionSetClientUpdateOptions struct { - // placeholder for future optional parameters -} - // APIVersionSetCollection - Paged API Version Set list representation. type APIVersionSetCollection struct { // Total record count number across all pages. @@ -1242,6 +739,9 @@ type AdditionalLocation struct { // in this additional location. DisableGateway *bool + // Property can be used to enable NAT Gateway for this API Management service. + NatGatewayState *NatGatewayState + // Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the location. Supported // only for Premium SKU being deployed in Virtual Network. PublicIPAddressID *string @@ -1255,6 +755,10 @@ type AdditionalLocation struct { // READ-ONLY; Gateway URL of the API Management service in the Region. GatewayRegionalURL *string + // READ-ONLY; Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium + // SKU on stv2 platform. + OutboundPublicIPAddresses []*string + // READ-ONLY; Compute Platform Version running the service. PlatformVersion *PlatformVersion @@ -1315,56 +819,176 @@ type AuthenticationSettingsContract struct { // OAuth2 Authentication settings OAuth2 *OAuth2AuthenticationSettingsContract + // Collection of OAuth2 authentication settings included into this API. + OAuth2AuthenticationSettings []*OAuth2AuthenticationSettingsContract + // OpenID Connect Authentication Settings Openid *OpenIDAuthenticationSettingsContract + + // Collection of Open ID Connect authentication settings included into this API. + OpenidAuthenticationSettings []*OpenIDAuthenticationSettingsContract +} + +// AuthorizationAccessPolicyCollection - Paged Authorization Access Policy list representation. +type AuthorizationAccessPolicyCollection struct { + // Total record count number across all pages. + Count *int64 + + // Next page link if any. + NextLink *string + + // Page values. + Value []*AuthorizationAccessPolicyContract +} + +// AuthorizationAccessPolicyContract - Authorization access policy contract. +type AuthorizationAccessPolicyContract struct { + // Properties of the Authorization Contract. + Properties *AuthorizationAccessPolicyContractProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// AuthorizationAccessPolicyContractProperties - Authorization Access Policy details. +type AuthorizationAccessPolicyContractProperties struct { + // The Object Id + ObjectID *string + + // The Tenant Id + TenantID *string +} + +// AuthorizationCollection - Paged Authorization list representation. +type AuthorizationCollection struct { + // Total record count number across all pages. + Count *int64 + + // Next page link if any. + NextLink *string + + // Page values. + Value []*AuthorizationContract +} + +// AuthorizationConfirmConsentCodeRequestContract - Authorization confirm consent code request contract. +type AuthorizationConfirmConsentCodeRequestContract struct { + // The consent code from the authorization server after authorizing and consenting. + ConsentCode *string +} + +// AuthorizationContract - Authorization contract. +type AuthorizationContract struct { + // Properties of the Authorization Contract. + Properties *AuthorizationContractProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// AuthorizationContractProperties - Authorization details. +type AuthorizationContractProperties struct { + // Authorization type options + AuthorizationType *AuthorizationType + + // Authorization error details. + Error *AuthorizationError + + // OAuth2 grant type options + OAuth2GrantType *OAuth2GrantType + + // Authorization parameters + Parameters map[string]*string + + // Status of the Authorization + Status *string +} + +// AuthorizationError - Authorization error details. +type AuthorizationError struct { + // Error code + Code *string + + // Error message + Message *string } -// AuthorizationServerClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationServerClient.CreateOrUpdate -// method. -type AuthorizationServerClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string +// AuthorizationLoginRequestContract - Authorization login request contract. +type AuthorizationLoginRequestContract struct { + // The redirect URL after login has completed. + PostLoginRedirectURL *string } -// AuthorizationServerClientDeleteOptions contains the optional parameters for the AuthorizationServerClient.Delete method. -type AuthorizationServerClientDeleteOptions struct { - // placeholder for future optional parameters +// AuthorizationLoginResponseContract - Authorization login response contract. +type AuthorizationLoginResponseContract struct { + // The login link + LoginLink *string } -// AuthorizationServerClientGetEntityTagOptions contains the optional parameters for the AuthorizationServerClient.GetEntityTag -// method. -type AuthorizationServerClientGetEntityTagOptions struct { - // placeholder for future optional parameters +// AuthorizationProviderCollection - Paged Authorization Provider list representation. +type AuthorizationProviderCollection struct { + // Next page link if any. + NextLink *string + + // Page values. + Value []*AuthorizationProviderContract } -// AuthorizationServerClientGetOptions contains the optional parameters for the AuthorizationServerClient.Get method. -type AuthorizationServerClientGetOptions struct { - // placeholder for future optional parameters +// AuthorizationProviderContract - Authorization Provider contract. +type AuthorizationProviderContract struct { + // Properties of the Authorization Provider Contract. + Properties *AuthorizationProviderContractProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string } -// AuthorizationServerClientListByServiceOptions contains the optional parameters for the AuthorizationServerClient.NewListByServicePager -// method. -type AuthorizationServerClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 +// AuthorizationProviderContractProperties - Authorization Provider details. +type AuthorizationProviderContractProperties struct { + // Authorization Provider name. Must be 1 to 300 characters long. + DisplayName *string + + // Identity provider name. Must be 1 to 300 characters long. + IdentityProvider *string + + // OAuth2 settings + Oauth2 *AuthorizationProviderOAuth2Settings } -// AuthorizationServerClientListSecretsOptions contains the optional parameters for the AuthorizationServerClient.ListSecrets -// method. -type AuthorizationServerClientListSecretsOptions struct { - // placeholder for future optional parameters +// AuthorizationProviderOAuth2GrantTypes - Authorization Provider oauth2 grant types settings +type AuthorizationProviderOAuth2GrantTypes struct { + // OAuth2 authorization code grant parameters + AuthorizationCode map[string]*string + + // OAuth2 client credential grant parameters + ClientCredentials map[string]*string } -// AuthorizationServerClientUpdateOptions contains the optional parameters for the AuthorizationServerClient.Update method. -type AuthorizationServerClientUpdateOptions struct { - // placeholder for future optional parameters +// AuthorizationProviderOAuth2Settings - OAuth2 settings details +type AuthorizationProviderOAuth2Settings struct { + // OAuth2 settings + GrantTypes *AuthorizationProviderOAuth2GrantTypes + + // Redirect URL to be set in the OAuth application. + RedirectURL *string } // AuthorizationServerCollection - Paged OAuth2 Authorization Servers list representation. @@ -1494,6 +1118,13 @@ type AuthorizationServerContractProperties struct { // OAuth token endpoint. Contains absolute URI to entity being referenced. TokenEndpoint *string + + // If true, the authorization server will be used in the API documentation in the developer portal. False by default if no + // value is provided. + UseInAPIDocumentation *bool + + // If true, the authorization server may be used in the developer portal test console. True by default if no value is provided. + UseInTestConsole *bool } // AuthorizationServerSecretsContract - OAuth Server Secrets Contract. @@ -1584,6 +1215,13 @@ type AuthorizationServerUpdateContractProperties struct { // OAuth token endpoint. Contains absolute URI to entity being referenced. TokenEndpoint *string + + // If true, the authorization server will be used in the API documentation in the developer portal. False by default if no + // value is provided. + UseInAPIDocumentation *bool + + // If true, the authorization server may be used in the developer portal test console. True by default if no value is provided. + UseInTestConsole *bool } // BackendAuthorizationHeaderCredentials - Authorization header information. @@ -1606,10 +1244,10 @@ type BackendBaseParameters struct { // Backend Properties contract Properties *BackendProperties - // Backend Proxy Contract Properties + // Backend gateway Contract Properties Proxy *BackendProxyContract - // Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or + // Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or // API Apps. ResourceID *string @@ -1620,52 +1258,6 @@ type BackendBaseParameters struct { Title *string } -// BackendClientCreateOrUpdateOptions contains the optional parameters for the BackendClient.CreateOrUpdate method. -type BackendClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// BackendClientDeleteOptions contains the optional parameters for the BackendClient.Delete method. -type BackendClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// BackendClientGetEntityTagOptions contains the optional parameters for the BackendClient.GetEntityTag method. -type BackendClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// BackendClientGetOptions contains the optional parameters for the BackendClient.Get method. -type BackendClientGetOptions struct { - // placeholder for future optional parameters -} - -// BackendClientListByServiceOptions contains the optional parameters for the BackendClient.NewListByServicePager method. -type BackendClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | title | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | url | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// BackendClientReconnectOptions contains the optional parameters for the BackendClient.Reconnect method. -type BackendClientReconnectOptions struct { - // Reconnect request parameters. - Parameters *BackendReconnectContract -} - -// BackendClientUpdateOptions contains the optional parameters for the BackendClient.Update method. -type BackendClientUpdateOptions struct { - // placeholder for future optional parameters -} - // BackendCollection - Paged Backend list representation. type BackendCollection struct { // Total record count number across all pages. @@ -1710,10 +1302,10 @@ type BackendContractProperties struct { // Backend Properties contract Properties *BackendProperties - // Backend Proxy Contract Properties + // Backend gateway Contract Properties Proxy *BackendProxyContract - // Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or + // Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or // API Apps. ResourceID *string @@ -1828,10 +1420,10 @@ type BackendUpdateParameterProperties struct { // Backend communication protocol. Protocol *BackendProtocol - // Backend Proxy Contract Properties + // Backend gateway Contract Properties Proxy *BackendProxyContract - // Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or + // Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or // API Apps. ResourceID *string @@ -1857,40 +1449,6 @@ type BodyDiagnosticSettings struct { Bytes *int32 } -// CacheClientCreateOrUpdateOptions contains the optional parameters for the CacheClient.CreateOrUpdate method. -type CacheClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// CacheClientDeleteOptions contains the optional parameters for the CacheClient.Delete method. -type CacheClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// CacheClientGetEntityTagOptions contains the optional parameters for the CacheClient.GetEntityTag method. -type CacheClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// CacheClientGetOptions contains the optional parameters for the CacheClient.Get method. -type CacheClientGetOptions struct { - // placeholder for future optional parameters -} - -// CacheClientListByServiceOptions contains the optional parameters for the CacheClient.NewListByServicePager method. -type CacheClientListByServiceOptions struct { - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// CacheClientUpdateOptions contains the optional parameters for the CacheClient.Update method. -type CacheClientUpdateOptions struct { - // placeholder for future optional parameters -} - // CacheCollection - Paged Caches list representation. type CacheCollection struct { // Total record count number across all pages. @@ -1954,50 +1512,6 @@ type CacheUpdateProperties struct { UseFromLocation *string } -// CertificateClientCreateOrUpdateOptions contains the optional parameters for the CertificateClient.CreateOrUpdate method. -type CertificateClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// CertificateClientDeleteOptions contains the optional parameters for the CertificateClient.Delete method. -type CertificateClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// CertificateClientGetEntityTagOptions contains the optional parameters for the CertificateClient.GetEntityTag method. -type CertificateClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// CertificateClientGetOptions contains the optional parameters for the CertificateClient.Get method. -type CertificateClientGetOptions struct { - // placeholder for future optional parameters -} - -// CertificateClientListByServiceOptions contains the optional parameters for the CertificateClient.NewListByServicePager -// method. -type CertificateClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | subject | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | thumbprint | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | expirationDate | filter | ge, le, eq, ne, gt, lt | | - Filter *string - // When set to true, the response contains only certificates entities which failed refresh. - IsKeyVaultRefreshFailed *bool - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// CertificateClientRefreshSecretOptions contains the optional parameters for the CertificateClient.RefreshSecret method. -type CertificateClientRefreshSecretOptions struct { - // placeholder for future optional parameters -} - // CertificateCollection - Paged Certificates list representation. type CertificateCollection struct { // Total record count number across all pages. @@ -2088,13 +1602,6 @@ type CertificateInformation struct { Thumbprint *string } -// ClientBeginPerformConnectivityCheckAsyncOptions contains the optional parameters for the Client.BeginPerformConnectivityCheckAsync -// method. -type ClientBeginPerformConnectivityCheckAsyncOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // ClientSecretContract - Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. type ClientSecretContract struct { // Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. @@ -2246,33 +1753,6 @@ type ConnectivityStatusContract struct { Error *string } -// ContentItemClientCreateOrUpdateOptions contains the optional parameters for the ContentItemClient.CreateOrUpdate method. -type ContentItemClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// ContentItemClientDeleteOptions contains the optional parameters for the ContentItemClient.Delete method. -type ContentItemClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ContentItemClientGetEntityTagOptions contains the optional parameters for the ContentItemClient.GetEntityTag method. -type ContentItemClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// ContentItemClientGetOptions contains the optional parameters for the ContentItemClient.Get method. -type ContentItemClientGetOptions struct { - // placeholder for future optional parameters -} - -// ContentItemClientListByServiceOptions contains the optional parameters for the ContentItemClient.NewListByServicePager -// method. -type ContentItemClientListByServiceOptions struct { - // placeholder for future optional parameters -} - // ContentItemCollection - Paged list of content items. type ContentItemCollection struct { // READ-ONLY; Next page link, if any. @@ -2297,28 +1777,6 @@ type ContentItemContract struct { Type *string } -// ContentTypeClientCreateOrUpdateOptions contains the optional parameters for the ContentTypeClient.CreateOrUpdate method. -type ContentTypeClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// ContentTypeClientDeleteOptions contains the optional parameters for the ContentTypeClient.Delete method. -type ContentTypeClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ContentTypeClientGetOptions contains the optional parameters for the ContentTypeClient.Get method. -type ContentTypeClientGetOptions struct { - // placeholder for future optional parameters -} - -// ContentTypeClientListByServiceOptions contains the optional parameters for the ContentTypeClient.NewListByServicePager -// method. -type ContentTypeClientListByServiceOptions struct { - // placeholder for future optional parameters -} - // ContentTypeCollection - Paged list of content types. type ContentTypeCollection struct { // READ-ONLY; Next page link, if any. @@ -2376,35 +1834,6 @@ type DataMaskingEntity struct { Value *string } -// DelegationSettingsClientCreateOrUpdateOptions contains the optional parameters for the DelegationSettingsClient.CreateOrUpdate -// method. -type DelegationSettingsClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// DelegationSettingsClientGetEntityTagOptions contains the optional parameters for the DelegationSettingsClient.GetEntityTag -// method. -type DelegationSettingsClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// DelegationSettingsClientGetOptions contains the optional parameters for the DelegationSettingsClient.Get method. -type DelegationSettingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DelegationSettingsClientListSecretsOptions contains the optional parameters for the DelegationSettingsClient.ListSecrets -// method. -type DelegationSettingsClientListSecretsOptions struct { - // placeholder for future optional parameters -} - -// DelegationSettingsClientUpdateOptions contains the optional parameters for the DelegationSettingsClient.Update method. -type DelegationSettingsClientUpdateOptions struct { - // placeholder for future optional parameters -} - // DeletedServiceContract - Deleted API Management Service information. type DeletedServiceContract struct { // Deleted API Management Service details. @@ -2436,23 +1865,6 @@ type DeletedServiceContractProperties struct { ServiceID *string } -// DeletedServicesClientBeginPurgeOptions contains the optional parameters for the DeletedServicesClient.BeginPurge method. -type DeletedServicesClientBeginPurgeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DeletedServicesClientGetByNameOptions contains the optional parameters for the DeletedServicesClient.GetByName method. -type DeletedServicesClientGetByNameOptions struct { - // placeholder for future optional parameters -} - -// DeletedServicesClientListBySubscriptionOptions contains the optional parameters for the DeletedServicesClient.NewListBySubscriptionPager -// method. -type DeletedServicesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // DeletedServicesCollection - Paged deleted API Management Services List Representation. type DeletedServicesCollection struct { // READ-ONLY; Next page link if any. @@ -2477,44 +1889,6 @@ type DeployConfigurationParameters struct { Properties *DeployConfigurationParameterProperties } -// DiagnosticClientCreateOrUpdateOptions contains the optional parameters for the DiagnosticClient.CreateOrUpdate method. -type DiagnosticClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// DiagnosticClientDeleteOptions contains the optional parameters for the DiagnosticClient.Delete method. -type DiagnosticClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// DiagnosticClientGetEntityTagOptions contains the optional parameters for the DiagnosticClient.GetEntityTag method. -type DiagnosticClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// DiagnosticClientGetOptions contains the optional parameters for the DiagnosticClient.Get method. -type DiagnosticClientGetOptions struct { - // placeholder for future optional parameters -} - -// DiagnosticClientListByServiceOptions contains the optional parameters for the DiagnosticClient.NewListByServicePager method. -type DiagnosticClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// DiagnosticClientUpdateOptions contains the optional parameters for the DiagnosticClient.Update method. -type DiagnosticClientUpdateOptions struct { - // placeholder for future optional parameters -} - // DiagnosticCollection - Paged Diagnostic list representation. type DiagnosticCollection struct { // Total record count number across all pages. @@ -2562,6 +1936,9 @@ type DiagnosticContractProperties struct { // Log the ClientIP. Default is false. LogClientIP *bool + // Emit custom metrics via emit-metric policy. Applicable only to Application Insights diagnostic settings. + Metrics *bool + // The format of the Operation Name for Application Insights telemetries. Default is Name. OperationNameFormat *OperationNameFormat @@ -2572,43 +1949,43 @@ type DiagnosticContractProperties struct { Verbosity *Verbosity } -// EmailTemplateClientCreateOrUpdateOptions contains the optional parameters for the EmailTemplateClient.CreateOrUpdate method. -type EmailTemplateClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} +// DocumentationCollection - Paged Documentation list representation. +type DocumentationCollection struct { + // READ-ONLY; Next page link if any. + NextLink *string -// EmailTemplateClientDeleteOptions contains the optional parameters for the EmailTemplateClient.Delete method. -type EmailTemplateClientDeleteOptions struct { - // placeholder for future optional parameters + // READ-ONLY; Page values. + Value []*DocumentationContract } -// EmailTemplateClientGetEntityTagOptions contains the optional parameters for the EmailTemplateClient.GetEntityTag method. -type EmailTemplateClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} +// DocumentationContract - Markdown documentation details. +type DocumentationContract struct { + // Markdown Documentation details. + Properties *DocumentationContractProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string -// EmailTemplateClientGetOptions contains the optional parameters for the EmailTemplateClient.Get method. -type EmailTemplateClientGetOptions struct { - // placeholder for future optional parameters + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string } -// EmailTemplateClientListByServiceOptions contains the optional parameters for the EmailTemplateClient.NewListByServicePager -// method. -type EmailTemplateClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 +// DocumentationContractProperties - Markdown documentation details. +type DocumentationContractProperties struct { + // Markdown documentation content. + Content *string + + // documentation title. + Title *string } -// EmailTemplateClientUpdateOptions contains the optional parameters for the EmailTemplateClient.Update method. -type EmailTemplateClientUpdateOptions struct { - // placeholder for future optional parameters +// DocumentationUpdateContract - Documentation update contract details. +type DocumentationUpdateContract struct { + // Markdown Documentation details. + Properties *DocumentationContractProperties } // EmailTemplateCollection - Paged email template list representation. @@ -2743,71 +2120,6 @@ type ErrorResponseBody struct { Message *string } -// GatewayAPIClientCreateOrUpdateOptions contains the optional parameters for the GatewayAPIClient.CreateOrUpdate method. -type GatewayAPIClientCreateOrUpdateOptions struct { - Parameters *AssociationContract -} - -// GatewayAPIClientDeleteOptions contains the optional parameters for the GatewayAPIClient.Delete method. -type GatewayAPIClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// GatewayAPIClientGetEntityTagOptions contains the optional parameters for the GatewayAPIClient.GetEntityTag method. -type GatewayAPIClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// GatewayAPIClientListByServiceOptions contains the optional parameters for the GatewayAPIClient.NewListByServicePager method. -type GatewayAPIClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// GatewayCertificateAuthorityClientCreateOrUpdateOptions contains the optional parameters for the GatewayCertificateAuthorityClient.CreateOrUpdate -// method. -type GatewayCertificateAuthorityClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// GatewayCertificateAuthorityClientDeleteOptions contains the optional parameters for the GatewayCertificateAuthorityClient.Delete -// method. -type GatewayCertificateAuthorityClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// GatewayCertificateAuthorityClientGetEntityTagOptions contains the optional parameters for the GatewayCertificateAuthorityClient.GetEntityTag -// method. -type GatewayCertificateAuthorityClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// GatewayCertificateAuthorityClientGetOptions contains the optional parameters for the GatewayCertificateAuthorityClient.Get -// method. -type GatewayCertificateAuthorityClientGetOptions struct { - // placeholder for future optional parameters -} - -// GatewayCertificateAuthorityClientListByServiceOptions contains the optional parameters for the GatewayCertificateAuthorityClient.NewListByServicePager -// method. -type GatewayCertificateAuthorityClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | eq, ne | | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - // GatewayCertificateAuthorityCollection - Paged Gateway certificate authority list representation. type GatewayCertificateAuthorityCollection struct { // READ-ONLY; Next page link if any. @@ -2838,61 +2150,6 @@ type GatewayCertificateAuthorityContractProperties struct { IsTrusted *bool } -// GatewayClientCreateOrUpdateOptions contains the optional parameters for the GatewayClient.CreateOrUpdate method. -type GatewayClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// GatewayClientDeleteOptions contains the optional parameters for the GatewayClient.Delete method. -type GatewayClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// GatewayClientGenerateTokenOptions contains the optional parameters for the GatewayClient.GenerateToken method. -type GatewayClientGenerateTokenOptions struct { - // placeholder for future optional parameters -} - -// GatewayClientGetEntityTagOptions contains the optional parameters for the GatewayClient.GetEntityTag method. -type GatewayClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// GatewayClientGetOptions contains the optional parameters for the GatewayClient.Get method. -type GatewayClientGetOptions struct { - // placeholder for future optional parameters -} - -// GatewayClientListByServiceOptions contains the optional parameters for the GatewayClient.NewListByServicePager method. -type GatewayClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | region | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// GatewayClientListKeysOptions contains the optional parameters for the GatewayClient.ListKeys method. -type GatewayClientListKeysOptions struct { - // placeholder for future optional parameters -} - -// GatewayClientRegenerateKeyOptions contains the optional parameters for the GatewayClient.RegenerateKey method. -type GatewayClientRegenerateKeyOptions struct { - // placeholder for future optional parameters -} - -// GatewayClientUpdateOptions contains the optional parameters for the GatewayClient.Update method. -type GatewayClientUpdateOptions struct { - // placeholder for future optional parameters -} - // GatewayCollection - Paged Gateway list representation. type GatewayCollection struct { // Total record count number across all pages. @@ -2929,45 +2186,6 @@ type GatewayContractProperties struct { LocationData *ResourceLocationDataContract } -// GatewayHostnameConfigurationClientCreateOrUpdateOptions contains the optional parameters for the GatewayHostnameConfigurationClient.CreateOrUpdate -// method. -type GatewayHostnameConfigurationClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// GatewayHostnameConfigurationClientDeleteOptions contains the optional parameters for the GatewayHostnameConfigurationClient.Delete -// method. -type GatewayHostnameConfigurationClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// GatewayHostnameConfigurationClientGetEntityTagOptions contains the optional parameters for the GatewayHostnameConfigurationClient.GetEntityTag -// method. -type GatewayHostnameConfigurationClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// GatewayHostnameConfigurationClientGetOptions contains the optional parameters for the GatewayHostnameConfigurationClient.Get -// method. -type GatewayHostnameConfigurationClientGetOptions struct { - // placeholder for future optional parameters -} - -// GatewayHostnameConfigurationClientListByServiceOptions contains the optional parameters for the GatewayHostnameConfigurationClient.NewListByServicePager -// method. -type GatewayHostnameConfigurationClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | hostname | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - // GatewayHostnameConfigurationCollection - Paged Gateway hostname configuration list representation. type GatewayHostnameConfigurationCollection struct { // READ-ONLY; Next page link if any. @@ -3050,43 +2268,6 @@ type GenerateSsoURLResult struct { Value *string } -// GlobalSchemaClientBeginCreateOrUpdateOptions contains the optional parameters for the GlobalSchemaClient.BeginCreateOrUpdate -// method. -type GlobalSchemaClientBeginCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GlobalSchemaClientDeleteOptions contains the optional parameters for the GlobalSchemaClient.Delete method. -type GlobalSchemaClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// GlobalSchemaClientGetEntityTagOptions contains the optional parameters for the GlobalSchemaClient.GetEntityTag method. -type GlobalSchemaClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// GlobalSchemaClientGetOptions contains the optional parameters for the GlobalSchemaClient.Get method. -type GlobalSchemaClientGetOptions struct { - // placeholder for future optional parameters -} - -// GlobalSchemaClientListByServiceOptions contains the optional parameters for the GlobalSchemaClient.NewListByServicePager -// method. -type GlobalSchemaClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - // GlobalSchemaCollection - The response of the list schema operation. type GlobalSchemaCollection struct { // Total record count number. @@ -3129,47 +2310,6 @@ type GlobalSchemaContractProperties struct { Value any } -// GroupClientCreateOrUpdateOptions contains the optional parameters for the GroupClient.CreateOrUpdate method. -type GroupClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// GroupClientDeleteOptions contains the optional parameters for the GroupClient.Delete method. -type GroupClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// GroupClientGetEntityTagOptions contains the optional parameters for the GroupClient.GetEntityTag method. -type GroupClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// GroupClientGetOptions contains the optional parameters for the GroupClient.Get method. -type GroupClientGetOptions struct { - // placeholder for future optional parameters -} - -// GroupClientListByServiceOptions contains the optional parameters for the GroupClient.NewListByServicePager method. -type GroupClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | externalId | filter | eq | | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// GroupClientUpdateOptions contains the optional parameters for the GroupClient.Update method. -type GroupClientUpdateOptions struct { - // placeholder for future optional parameters -} - // GroupCollection - Paged Group list representation. type GroupCollection struct { // Total record count number across all pages. @@ -3263,38 +2403,6 @@ type GroupUpdateParametersProperties struct { Type *GroupType } -// GroupUserClientCheckEntityExistsOptions contains the optional parameters for the GroupUserClient.CheckEntityExists method. -type GroupUserClientCheckEntityExistsOptions struct { - // placeholder for future optional parameters -} - -// GroupUserClientCreateOptions contains the optional parameters for the GroupUserClient.Create method. -type GroupUserClientCreateOptions struct { - // placeholder for future optional parameters -} - -// GroupUserClientDeleteOptions contains the optional parameters for the GroupUserClient.Delete method. -type GroupUserClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// GroupUserClientListOptions contains the optional parameters for the GroupUserClient.NewListPager method. -type GroupUserClientListOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | firstName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | lastName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | registrationDate | filter | ge, le, eq, ne, gt, lt | | - // | note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - // HTTPHeader - HTTP header and it's value. type HTTPHeader struct { // REQUIRED; Header name. @@ -3339,7 +2447,7 @@ type HostnameConfiguration struct { // Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate. If a client does not // send the SNI header, then this will be the certificate that will be challenged. // The property is useful if a service has multiple custom hostname enabled and it needs to decide on the default ssl certificate. - // The setting only applied to Proxy Hostname Type. + // The setting only applied to gateway Hostname Type. DefaultSSLBinding *bool // Base64 Encoded certificate. @@ -3366,6 +2474,9 @@ type IdentityProviderBaseParameters struct { // OpenID Connect discovery endpoint hostname for AAD or AAD B2C. Authority *string + // The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + ClientLibrary *string + // Password Reset Policy Name. Only applies to AAD B2C Identity Provider. PasswordResetPolicyName *string @@ -3385,45 +2496,6 @@ type IdentityProviderBaseParameters struct { Type *IdentityProviderType } -// IdentityProviderClientCreateOrUpdateOptions contains the optional parameters for the IdentityProviderClient.CreateOrUpdate -// method. -type IdentityProviderClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// IdentityProviderClientDeleteOptions contains the optional parameters for the IdentityProviderClient.Delete method. -type IdentityProviderClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// IdentityProviderClientGetEntityTagOptions contains the optional parameters for the IdentityProviderClient.GetEntityTag -// method. -type IdentityProviderClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// IdentityProviderClientGetOptions contains the optional parameters for the IdentityProviderClient.Get method. -type IdentityProviderClientGetOptions struct { - // placeholder for future optional parameters -} - -// IdentityProviderClientListByServiceOptions contains the optional parameters for the IdentityProviderClient.NewListByServicePager -// method. -type IdentityProviderClientListByServiceOptions struct { - // placeholder for future optional parameters -} - -// IdentityProviderClientListSecretsOptions contains the optional parameters for the IdentityProviderClient.ListSecrets method. -type IdentityProviderClientListSecretsOptions struct { - // placeholder for future optional parameters -} - -// IdentityProviderClientUpdateOptions contains the optional parameters for the IdentityProviderClient.Update method. -type IdentityProviderClientUpdateOptions struct { - // placeholder for future optional parameters -} - // IdentityProviderContract - Identity Provider details. type IdentityProviderContract struct { // Identity Provider contract properties. @@ -3452,6 +2524,9 @@ type IdentityProviderContractProperties struct { // OpenID Connect discovery endpoint hostname for AAD or AAD B2C. Authority *string + // The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + ClientLibrary *string + // Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is // App Secret for Facebook login, API Key for Google login, Public Key for // Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. @@ -3509,6 +2584,9 @@ type IdentityProviderCreateContractProperties struct { // OpenID Connect discovery endpoint hostname for AAD or AAD B2C. Authority *string + // The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + ClientLibrary *string + // Password Reset Policy Name. Only applies to AAD B2C Identity Provider. PasswordResetPolicyName *string @@ -3558,6 +2636,9 @@ type IdentityProviderUpdateProperties struct { // App ID for Microsoft. ClientID *string + // The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + ClientLibrary *string + // Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is // App Secret for Facebook login, API Key for Google login, Public Key for // Microsoft. @@ -3622,28 +2703,6 @@ type IssueAttachmentContractProperties struct { Title *string } -// IssueClientGetOptions contains the optional parameters for the IssueClient.Get method. -type IssueClientGetOptions struct { - // placeholder for future optional parameters -} - -// IssueClientListByServiceOptions contains the optional parameters for the IssueClient.NewListByServicePager method. -type IssueClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | title | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | authorName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | state | filter | eq | | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - // IssueCollection - Paged Issue list representation. type IssueCollection struct { // Total record count number across all pages. @@ -3806,47 +2865,6 @@ type KeyVaultLastAccessStatusContractProperties struct { TimeStampUTC *time.Time } -// LoggerClientCreateOrUpdateOptions contains the optional parameters for the LoggerClient.CreateOrUpdate method. -type LoggerClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// LoggerClientDeleteOptions contains the optional parameters for the LoggerClient.Delete method. -type LoggerClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// LoggerClientGetEntityTagOptions contains the optional parameters for the LoggerClient.GetEntityTag method. -type LoggerClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// LoggerClientGetOptions contains the optional parameters for the LoggerClient.Get method. -type LoggerClientGetOptions struct { - // placeholder for future optional parameters -} - -// LoggerClientListByServiceOptions contains the optional parameters for the LoggerClient.NewListByServicePager method. -type LoggerClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | loggerType | filter | eq | | - // | resourceId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// LoggerClientUpdateOptions contains the optional parameters for the LoggerClient.Update method. -type LoggerClientUpdateOptions struct { - // placeholder for future optional parameters -} - // LoggerCollection - Paged Logger list representation. type LoggerCollection struct { // Total record count number across all pages. @@ -3915,63 +2933,6 @@ type LoggerUpdateParameters struct { LoggerType *LoggerType } -// NamedValueClientBeginCreateOrUpdateOptions contains the optional parameters for the NamedValueClient.BeginCreateOrUpdate -// method. -type NamedValueClientBeginCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NamedValueClientBeginRefreshSecretOptions contains the optional parameters for the NamedValueClient.BeginRefreshSecret -// method. -type NamedValueClientBeginRefreshSecretOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NamedValueClientBeginUpdateOptions contains the optional parameters for the NamedValueClient.BeginUpdate method. -type NamedValueClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// NamedValueClientDeleteOptions contains the optional parameters for the NamedValueClient.Delete method. -type NamedValueClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// NamedValueClientGetEntityTagOptions contains the optional parameters for the NamedValueClient.GetEntityTag method. -type NamedValueClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// NamedValueClientGetOptions contains the optional parameters for the NamedValueClient.Get method. -type NamedValueClientGetOptions struct { - // placeholder for future optional parameters -} - -// NamedValueClientListByServiceOptions contains the optional parameters for the NamedValueClient.NewListByServicePager method. -type NamedValueClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | tags | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith, any, all | - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // When set to true, the response contains only named value entities which failed refresh. - IsKeyVaultRefreshFailed *bool - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// NamedValueClientListValueOptions contains the optional parameters for the NamedValueClient.ListValue method. -type NamedValueClientListValueOptions struct { - // placeholder for future optional parameters -} - // NamedValueCollection - Paged NamedValue list representation. type NamedValueCollection struct { // Total record count number across all pages. @@ -4093,16 +3054,6 @@ type NamedValueUpdateParameters struct { Properties *NamedValueUpdateParameterProperties } -// NetworkStatusClientListByLocationOptions contains the optional parameters for the NetworkStatusClient.ListByLocation method. -type NetworkStatusClientListByLocationOptions struct { - // placeholder for future optional parameters -} - -// NetworkStatusClientListByServiceOptions contains the optional parameters for the NetworkStatusClient.ListByService method. -type NetworkStatusClientListByServiceOptions struct { - // placeholder for future optional parameters -} - // NetworkStatusContract - Network Status details. type NetworkStatusContract struct { // REQUIRED; Gets the list of Connectivity Status to the Resources on which the service depends upon. @@ -4121,26 +3072,6 @@ type NetworkStatusContractByLocation struct { NetworkStatus *NetworkStatusContract } -// NotificationClientCreateOrUpdateOptions contains the optional parameters for the NotificationClient.CreateOrUpdate method. -type NotificationClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// NotificationClientGetOptions contains the optional parameters for the NotificationClient.Get method. -type NotificationClientGetOptions struct { - // placeholder for future optional parameters -} - -// NotificationClientListByServiceOptions contains the optional parameters for the NotificationClient.NewListByServicePager -// method. -type NotificationClientListByServiceOptions struct { - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - // NotificationCollection - Paged Notification list representation. type NotificationCollection struct { // Total record count number across all pages. @@ -4180,54 +3111,6 @@ type NotificationContractProperties struct { Recipients *RecipientsContractProperties } -// NotificationRecipientEmailClientCheckEntityExistsOptions contains the optional parameters for the NotificationRecipientEmailClient.CheckEntityExists -// method. -type NotificationRecipientEmailClientCheckEntityExistsOptions struct { - // placeholder for future optional parameters -} - -// NotificationRecipientEmailClientCreateOrUpdateOptions contains the optional parameters for the NotificationRecipientEmailClient.CreateOrUpdate -// method. -type NotificationRecipientEmailClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// NotificationRecipientEmailClientDeleteOptions contains the optional parameters for the NotificationRecipientEmailClient.Delete -// method. -type NotificationRecipientEmailClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// NotificationRecipientEmailClientListByNotificationOptions contains the optional parameters for the NotificationRecipientEmailClient.ListByNotification -// method. -type NotificationRecipientEmailClientListByNotificationOptions struct { - // placeholder for future optional parameters -} - -// NotificationRecipientUserClientCheckEntityExistsOptions contains the optional parameters for the NotificationRecipientUserClient.CheckEntityExists -// method. -type NotificationRecipientUserClientCheckEntityExistsOptions struct { - // placeholder for future optional parameters -} - -// NotificationRecipientUserClientCreateOrUpdateOptions contains the optional parameters for the NotificationRecipientUserClient.CreateOrUpdate -// method. -type NotificationRecipientUserClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// NotificationRecipientUserClientDeleteOptions contains the optional parameters for the NotificationRecipientUserClient.Delete -// method. -type NotificationRecipientUserClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// NotificationRecipientUserClientListByNotificationOptions contains the optional parameters for the NotificationRecipientUserClient.ListByNotification -// method. -type NotificationRecipientUserClientListByNotificationOptions struct { - // placeholder for future optional parameters -} - // OAuth2AuthenticationSettingsContract - API OAuth2 Authentication settings details. type OAuth2AuthenticationSettingsContract struct { // OAuth authorization server identifier. @@ -4246,54 +3129,6 @@ type OpenIDAuthenticationSettingsContract struct { OpenidProviderID *string } -// OpenIDConnectProviderClientCreateOrUpdateOptions contains the optional parameters for the OpenIDConnectProviderClient.CreateOrUpdate -// method. -type OpenIDConnectProviderClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// OpenIDConnectProviderClientDeleteOptions contains the optional parameters for the OpenIDConnectProviderClient.Delete method. -type OpenIDConnectProviderClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// OpenIDConnectProviderClientGetEntityTagOptions contains the optional parameters for the OpenIDConnectProviderClient.GetEntityTag -// method. -type OpenIDConnectProviderClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// OpenIDConnectProviderClientGetOptions contains the optional parameters for the OpenIDConnectProviderClient.Get method. -type OpenIDConnectProviderClientGetOptions struct { - // placeholder for future optional parameters -} - -// OpenIDConnectProviderClientListByServiceOptions contains the optional parameters for the OpenIDConnectProviderClient.NewListByServicePager -// method. -type OpenIDConnectProviderClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// OpenIDConnectProviderClientListSecretsOptions contains the optional parameters for the OpenIDConnectProviderClient.ListSecrets -// method. -type OpenIDConnectProviderClientListSecretsOptions struct { - // placeholder for future optional parameters -} - -// OpenIDConnectProviderClientUpdateOptions contains the optional parameters for the OpenIDConnectProviderClient.Update method. -type OpenIDConnectProviderClientUpdateOptions struct { - // placeholder for future optional parameters -} - // OpenIDConnectProviderCollection - Paged OpenIdProviders list representation. type OpenIDConnectProviderCollection struct { // Total record count number across all pages. @@ -4337,6 +3172,14 @@ type OpenidConnectProviderContractProperties struct { // User-friendly description of OpenID Connect Provider. Description *string + + // If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default if + // no value is provided. + UseInAPIDocumentation *bool + + // If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is + // provided. + UseInTestConsole *bool } // OpenidConnectProviderUpdateContract - Parameters supplied to the Update OpenID Connect Provider operation. @@ -4361,6 +3204,14 @@ type OpenidConnectProviderUpdateContractProperties struct { // Metadata endpoint URI. MetadataEndpoint *string + + // If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default if + // no value is provided. + UseInAPIDocumentation *bool + + // If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is + // provided. + UseInTestConsole *bool } // Operation - REST API operation @@ -4378,25 +3229,6 @@ type Operation struct { Properties any } -// OperationClientListByTagsOptions contains the optional parameters for the OperationClient.NewListByTagsPager method. -type OperationClientListByTagsOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | apiName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Include not tagged Operations. - IncludeNotTaggedOperations *bool - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - // OperationCollection - Paged Operation list representation. type OperationCollection struct { // Total record count number across all pages. @@ -4609,11 +3441,6 @@ type OperationUpdateContractProperties struct { URLTemplate *string } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // OutboundEnvironmentEndpoint - Endpoints accessed for a common purpose that the Api Management Service requires outbound // network access to. type OutboundEnvironmentEndpoint struct { @@ -4633,12 +3460,6 @@ type OutboundEnvironmentEndpointList struct { NextLink *string } -// OutboundNetworkDependenciesEndpointsClientListByServiceOptions contains the optional parameters for the OutboundNetworkDependenciesEndpointsClient.ListByService -// method. -type OutboundNetworkDependenciesEndpointsClientListByServiceOptions struct { - // placeholder for future optional parameters -} - // ParameterContract - Operation parameters details. type ParameterContract struct { // REQUIRED; Parameter name. @@ -4693,33 +3514,6 @@ type PipelineDiagnosticSettings struct { Response *HTTPMessageDiagnostic } -// PolicyClientCreateOrUpdateOptions contains the optional parameters for the PolicyClient.CreateOrUpdate method. -type PolicyClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// PolicyClientDeleteOptions contains the optional parameters for the PolicyClient.Delete method. -type PolicyClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// PolicyClientGetEntityTagOptions contains the optional parameters for the PolicyClient.GetEntityTag method. -type PolicyClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// PolicyClientGetOptions contains the optional parameters for the PolicyClient.Get method. -type PolicyClientGetOptions struct { - // Policy Export Format. - Format *PolicyExportFormat -} - -// PolicyClientListByServiceOptions contains the optional parameters for the PolicyClient.ListByService method. -type PolicyClientListByServiceOptions struct { - // placeholder for future optional parameters -} - // PolicyCollection - The response of the list policy operation. type PolicyCollection struct { // Total record count number. @@ -4756,19 +3550,12 @@ type PolicyContractProperties struct { Format *PolicyContentFormat } -// PolicyDescriptionClientListByServiceOptions contains the optional parameters for the PolicyDescriptionClient.ListByService -// method. -type PolicyDescriptionClientListByServiceOptions struct { - // Policy scope. - Scope *PolicyScopeContract -} - -// PolicyDescriptionCollection - Descriptions of APIM policies. +// PolicyDescriptionCollection - Descriptions of API Management policies. type PolicyDescriptionCollection struct { // Total record count number. Count *int64 - // Descriptions of APIM policies. + // Descriptions of API Management policies. Value []*PolicyDescriptionContract } @@ -4796,13 +3583,25 @@ type PolicyDescriptionContractProperties struct { Scope *int64 } -// PortalDelegationSettings - Delegation settings for a developer portal. -type PortalDelegationSettings struct { - // Delegation settings contract properties. - Properties *PortalDelegationSettingsProperties +// PolicyFragmentCollection - The response of the get policy fragments operation. +type PolicyFragmentCollection struct { + // Total record count number. + Count *int64 - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string + // Next page link if any. + NextLink *string + + // Policy fragment contract value. + Value []*PolicyFragmentContract +} + +// PolicyFragmentContract - Policy fragment contract details. +type PolicyFragmentContract struct { + // Properties of the Policy Fragment. + Properties *PolicyFragmentContractProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string // READ-ONLY; The name of the resource Name *string @@ -4811,55 +3610,138 @@ type PortalDelegationSettings struct { Type *string } -// PortalDelegationSettingsProperties - Delegation settings contract properties. -type PortalDelegationSettingsProperties struct { - // Subscriptions delegation settings. - Subscriptions *SubscriptionsDelegationSettingsProperties +// PolicyFragmentContractProperties - Policy fragment contract properties. +type PolicyFragmentContractProperties struct { + // REQUIRED; Contents of the policy fragment. + Value *string - // A delegation Url. - URL *string + // Policy fragment description. + Description *string - // User registration delegation settings. - UserRegistration *RegistrationDelegationSettingsProperties + // Format of the policy fragment content. + Format *PolicyFragmentContentFormat +} - // A base64-encoded validation key to validate, that a request is coming from Azure API Management. +// PortalConfigCollection - The collection of the developer portal configurations. +type PortalConfigCollection struct { + // The developer portal configurations. + Value []*PortalConfigContract + + // READ-ONLY; Next page link if any. + NextLink *string +} + +// PortalConfigContract - The developer portal configuration contract. +type PortalConfigContract struct { + // The developer portal configuration contract properties. + Properties *PortalConfigProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// PortalConfigCorsProperties - The developer portal Cross-Origin Resource Sharing (CORS) settings. +type PortalConfigCorsProperties struct { + // Allowed origins, e.g. https://trusted.com. + AllowedOrigins []*string +} + +// PortalConfigCspProperties - The developer portal Content Security Policy (CSP) settings. +type PortalConfigCspProperties struct { + // Allowed sources, e.g. *.trusted.com, trusted.com, https://. + AllowedSources []*string + + // The mode of the developer portal Content Security Policy (CSP). + Mode *PortalSettingsCspMode + + // The URLs used by the browser to report CSP violations. + ReportURI []*string +} + +type PortalConfigDelegationProperties struct { + // Enable or disable delegation for user registration. + DelegateRegistration *bool + + // Enable or disable delegation for product subscriptions. + DelegateSubscription *bool + + // A delegation endpoint URL. + DelegationURL *string + + // A base64-encoded validation key to ensure requests originate from Azure API Management service. ValidationKey *string } -// PortalRevisionClientBeginCreateOrUpdateOptions contains the optional parameters for the PortalRevisionClient.BeginCreateOrUpdate -// method. -type PortalRevisionClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// PortalConfigProperties - The developer portal configuration contract properties. +type PortalConfigProperties struct { + // The developer portal Cross-Origin Resource Sharing (CORS) settings. + Cors *PortalConfigCorsProperties + + // The developer portal Content Security Policy (CSP) settings. + Csp *PortalConfigCspProperties + + // The developer portal delegation settings. + Delegation *PortalConfigDelegationProperties + + // Enable or disable Basic authentication method. + EnableBasicAuth *bool + Signin *PortalConfigPropertiesSignin + Signup *PortalConfigPropertiesSignup } -// PortalRevisionClientBeginUpdateOptions contains the optional parameters for the PortalRevisionClient.BeginUpdate method. -type PortalRevisionClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +type PortalConfigPropertiesSignin struct { + // Redirect anonymous users to the sign-in page. + Require *bool } -// PortalRevisionClientGetEntityTagOptions contains the optional parameters for the PortalRevisionClient.GetEntityTag method. -type PortalRevisionClientGetEntityTagOptions struct { - // placeholder for future optional parameters +type PortalConfigPropertiesSignup struct { + // Terms of service settings. + TermsOfService *PortalConfigTermsOfServiceProperties } -// PortalRevisionClientGetOptions contains the optional parameters for the PortalRevisionClient.Get method. -type PortalRevisionClientGetOptions struct { - // placeholder for future optional parameters +// PortalConfigTermsOfServiceProperties - Terms of service contract properties. +type PortalConfigTermsOfServiceProperties struct { + // Ask user for consent to the terms of service. + RequireConsent *bool + + // A terms of service text. + Text *string } -// PortalRevisionClientListByServiceOptions contains the optional parameters for the PortalRevisionClient.NewListByServicePager -// method. -type PortalRevisionClientListByServiceOptions struct { - // FIELD SUPPORTED OPERATORS SUPPORTED FUNCTIONS - // |name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| |description | ge, le, eq, ne, gt, lt | substringof, - // contains, startswith, endswith| |isCurrent | eq, ne | | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 +// PortalDelegationSettings - Delegation settings for a developer portal. +type PortalDelegationSettings struct { + // Delegation settings contract properties. + Properties *PortalDelegationSettingsProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// PortalDelegationSettingsProperties - Delegation settings contract properties. +type PortalDelegationSettingsProperties struct { + // Subscriptions delegation settings. + Subscriptions *SubscriptionsDelegationSettingsProperties + + // A delegation Url. + URL *string + + // User registration delegation settings. + UserRegistration *RegistrationDelegationSettingsProperties + + // A base64-encoded validation key to validate, that a request is coming from Azure API Management. + ValidationKey *string } // PortalRevisionCollection - Paged list of portal revisions. @@ -4912,17 +3794,12 @@ type PortalSettingValidationKeyContract struct { ValidationKey *string } -// PortalSettingsClientListByServiceOptions contains the optional parameters for the PortalSettingsClient.ListByService method. -type PortalSettingsClientListByServiceOptions struct { - // placeholder for future optional parameters -} - -// PortalSettingsCollection - Descriptions of APIM policies. +// PortalSettingsCollection - Descriptions of API Management policies. type PortalSettingsCollection struct { // Total record count number. Count *int64 - // Descriptions of APIM policies. + // Descriptions of API Management policies. Value []*PortalSettingsContract } @@ -5028,44 +3905,6 @@ type PrivateEndpointConnection struct { Type *string } -// PrivateEndpointConnectionClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginCreateOrUpdate -// method. -type PrivateEndpointConnectionClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateEndpointConnectionClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginDelete -// method. -type PrivateEndpointConnectionClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateEndpointConnectionClientGetByNameOptions contains the optional parameters for the PrivateEndpointConnectionClient.GetByName -// method. -type PrivateEndpointConnectionClientGetByNameOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionClientGetPrivateLinkResourceOptions contains the optional parameters for the PrivateEndpointConnectionClient.GetPrivateLinkResource -// method. -type PrivateEndpointConnectionClientGetPrivateLinkResourceOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionClientListByServiceOptions contains the optional parameters for the PrivateEndpointConnectionClient.NewListByServicePager -// method. -type PrivateEndpointConnectionClientListByServiceOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionClientListPrivateLinkResourcesOptions contains the optional parameters for the PrivateEndpointConnectionClient.ListPrivateLinkResources -// method. -type PrivateEndpointConnectionClientListPrivateLinkResourcesOptions struct { - // placeholder for future optional parameters -} - // PrivateEndpointConnectionListResult - List of private endpoint connection associated with the specified storage account type PrivateEndpointConnectionListResult struct { // Array of private endpoint connections @@ -5160,103 +3999,6 @@ type PrivateLinkServiceConnectionState struct { Status *PrivateEndpointServiceConnectionStatus } -// ProductAPIClientCheckEntityExistsOptions contains the optional parameters for the ProductAPIClient.CheckEntityExists method. -type ProductAPIClientCheckEntityExistsOptions struct { - // placeholder for future optional parameters -} - -// ProductAPIClientCreateOrUpdateOptions contains the optional parameters for the ProductAPIClient.CreateOrUpdate method. -type ProductAPIClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ProductAPIClientDeleteOptions contains the optional parameters for the ProductAPIClient.Delete method. -type ProductAPIClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ProductAPIClientListByProductOptions contains the optional parameters for the ProductAPIClient.NewListByProductPager method. -type ProductAPIClientListByProductOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// ProductClientCreateOrUpdateOptions contains the optional parameters for the ProductClient.CreateOrUpdate method. -type ProductClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// ProductClientDeleteOptions contains the optional parameters for the ProductClient.Delete method. -type ProductClientDeleteOptions struct { - // Delete existing subscriptions associated with the product or not. - DeleteSubscriptions *bool -} - -// ProductClientGetEntityTagOptions contains the optional parameters for the ProductClient.GetEntityTag method. -type ProductClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// ProductClientGetOptions contains the optional parameters for the ProductClient.Get method. -type ProductClientGetOptions struct { - // placeholder for future optional parameters -} - -// ProductClientListByServiceOptions contains the optional parameters for the ProductClient.NewListByServicePager method. -type ProductClientListByServiceOptions struct { - // When set to true, the response contains an array of groups that have visibility to the product. The default is false. - ExpandGroups *bool - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | state | filter | eq | | - // | groups | expand | | | - Filter *string - // Number of records to skip. - Skip *int32 - // Products which are part of a specific tag. - Tags *string - // Number of records to return. - Top *int32 -} - -// ProductClientListByTagsOptions contains the optional parameters for the ProductClient.NewListByTagsPager method. -type ProductClientListByTagsOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | state | filter | eq | substringof, contains, startswith, endswith | - Filter *string - // Include not tagged Products. - IncludeNotTaggedProducts *bool - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// ProductClientUpdateOptions contains the optional parameters for the ProductClient.Update method. -type ProductClientUpdateOptions struct { - // placeholder for future optional parameters -} - // ProductCollection - Paged Products list representation. type ProductCollection struct { // Total record count number across all pages. @@ -5353,85 +4095,6 @@ type ProductEntityBaseParameters struct { Terms *string } -// ProductGroupClientCheckEntityExistsOptions contains the optional parameters for the ProductGroupClient.CheckEntityExists -// method. -type ProductGroupClientCheckEntityExistsOptions struct { - // placeholder for future optional parameters -} - -// ProductGroupClientCreateOrUpdateOptions contains the optional parameters for the ProductGroupClient.CreateOrUpdate method. -type ProductGroupClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ProductGroupClientDeleteOptions contains the optional parameters for the ProductGroupClient.Delete method. -type ProductGroupClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ProductGroupClientListByProductOptions contains the optional parameters for the ProductGroupClient.NewListByProductPager -// method. -type ProductGroupClientListByProductOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | | - // | displayName | filter | eq, ne | | - // | description | filter | eq, ne | | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// ProductPolicyClientCreateOrUpdateOptions contains the optional parameters for the ProductPolicyClient.CreateOrUpdate method. -type ProductPolicyClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// ProductPolicyClientDeleteOptions contains the optional parameters for the ProductPolicyClient.Delete method. -type ProductPolicyClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ProductPolicyClientGetEntityTagOptions contains the optional parameters for the ProductPolicyClient.GetEntityTag method. -type ProductPolicyClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// ProductPolicyClientGetOptions contains the optional parameters for the ProductPolicyClient.Get method. -type ProductPolicyClientGetOptions struct { - // Policy Export Format. - Format *PolicyExportFormat -} - -// ProductPolicyClientListByProductOptions contains the optional parameters for the ProductPolicyClient.ListByProduct method. -type ProductPolicyClientListByProductOptions struct { - // placeholder for future optional parameters -} - -// ProductSubscriptionsClientListOptions contains the optional parameters for the ProductSubscriptionsClient.NewListPager -// method. -type ProductSubscriptionsClientListOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | state | filter | eq | | - // | user | expand | | | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - // ProductTagResourceContractProperties - Product profile. type ProductTagResourceContractProperties struct { // REQUIRED; Product name. @@ -5513,25 +4176,17 @@ type ProductUpdateProperties struct { Terms *string } -// QuotaByCounterKeysClientListByServiceOptions contains the optional parameters for the QuotaByCounterKeysClient.ListByService -// method. -type QuotaByCounterKeysClientListByServiceOptions struct { - // placeholder for future optional parameters -} - -// QuotaByCounterKeysClientUpdateOptions contains the optional parameters for the QuotaByCounterKeysClient.Update method. -type QuotaByCounterKeysClientUpdateOptions struct { - // placeholder for future optional parameters -} +// ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a +// location +type ProxyResource struct { + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string -// QuotaByPeriodKeysClientGetOptions contains the optional parameters for the QuotaByPeriodKeysClient.Get method. -type QuotaByPeriodKeysClientGetOptions struct { - // placeholder for future optional parameters -} + // READ-ONLY; The name of the resource + Name *string -// QuotaByPeriodKeysClientUpdateOptions contains the optional parameters for the QuotaByPeriodKeysClient.Update method. -type QuotaByPeriodKeysClientUpdateOptions struct { - // placeholder for future optional parameters + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string } // QuotaCounterCollection - Paged Quota Counter list representation. @@ -5662,11 +4317,6 @@ type RecipientsContractProperties struct { Users []*string } -// RegionClientListByServiceOptions contains the optional parameters for the RegionClient.NewListByServicePager method. -type RegionClientListByServiceOptions struct { - // placeholder for future optional parameters -} - // RegionContract - Region profile. type RegionContract struct { // whether Region is deleted. @@ -5754,7 +4404,7 @@ type ReportRecordContract struct { // and HttpStatusCode.TooManyRequests CallCountBlocked *int32 - // Number of calls failed due to proxy or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) and + // Number of calls failed due to gateway or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) and // any Code between HttpStatusCode.InternalServerError (500) and 600 CallCountFailed *int32 @@ -5809,83 +4459,6 @@ type ReportRecordContract struct { UserID *string } -// ReportsClientListByAPIOptions contains the optional parameters for the ReportsClient.NewListByAPIPager method. -type ReportsClientListByAPIOptions struct { - // OData order by query option. - Orderby *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// ReportsClientListByGeoOptions contains the optional parameters for the ReportsClient.NewListByGeoPager method. -type ReportsClientListByGeoOptions struct { - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// ReportsClientListByOperationOptions contains the optional parameters for the ReportsClient.NewListByOperationPager method. -type ReportsClientListByOperationOptions struct { - // OData order by query option. - Orderby *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// ReportsClientListByProductOptions contains the optional parameters for the ReportsClient.NewListByProductPager method. -type ReportsClientListByProductOptions struct { - // OData order by query option. - Orderby *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// ReportsClientListByRequestOptions contains the optional parameters for the ReportsClient.NewListByRequestPager method. -type ReportsClientListByRequestOptions struct { - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// ReportsClientListBySubscriptionOptions contains the optional parameters for the ReportsClient.NewListBySubscriptionPager -// method. -type ReportsClientListBySubscriptionOptions struct { - // OData order by query option. - Orderby *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// ReportsClientListByTimeOptions contains the optional parameters for the ReportsClient.NewListByTimePager method. -type ReportsClientListByTimeOptions struct { - // OData order by query option. - Orderby *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// ReportsClientListByUserOptions contains the optional parameters for the ReportsClient.NewListByUserPager method. -type ReportsClientListByUserOptions struct { - // OData order by query option. - Orderby *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - // RepresentationContract - Operation request/response representation details. type RepresentationContract struct { // REQUIRED; Specifies a registered or custom content type for this representation, e.g. application/xml. @@ -5988,6 +4561,118 @@ type RequestReportRecordContract struct { UserID *string } +// ResolverCollection - Paged Resolver list representation. +type ResolverCollection struct { + // Total record count number across all pages. + Count *int64 + + // READ-ONLY; Next page link if any. + NextLink *string + + // READ-ONLY; Page values. + Value []*ResolverContract +} + +// ResolverContract - GraphQL API Resolver details. +type ResolverContract struct { + // Properties of the Resolver Contract. + Properties *ResolverEntityBaseContract + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// ResolverEntityBaseContract - GraphQL API Resolver Entity Base Contract details. +type ResolverEntityBaseContract struct { + // Description of the resolver. May include HTML formatting tags. + Description *string + + // Resolver Name. + DisplayName *string + + // Path is type/field being resolved. + Path *string +} + +// ResolverResultContract - Long Running Git Resolver Results. +type ResolverResultContract struct { + // Properties of the Resolver Contract. + Properties *ResolverResultContractProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// ResolverResultContractProperties - Resolver Result. +type ResolverResultContractProperties struct { + // Error Body Contract + Error *ErrorResponseBody + + // Resolver result identifier. + ID *string + + // Optional result info. + ResultInfo *string + + // Start time of an async resolver. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO + // 8601 standard. + Started *time.Time + + // Status of an async resolver. + Status *AsyncResolverStatus + + // Last update time of an async resolver. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by + // the ISO 8601 standard. + Updated *time.Time + + // READ-ONLY; This property if only provided as part of the TenantConfigurationValidate resolver. It contains the log the + // entities which will be updated/created/deleted as part of the TenantConfigurationDeploy + // resolver. + ActionLog []*ResolverResultLogItemContract +} + +// ResolverResultLogItemContract - Log of the entity being created, updated or deleted. +type ResolverResultLogItemContract struct { + // Action like create/update/delete. + Action *string + + // Identifier of the entity being created/updated/deleted. + ObjectKey *string + + // The type of entity contract. + ObjectType *string +} + +// ResolverUpdateContract - GraphQL API Resolver Update Contract details. +type ResolverUpdateContract struct { + // Properties of the GraphQL API Resolver entity that can be updated. + Properties *ResolverUpdateContractProperties +} + +// ResolverUpdateContractProperties - Resolver Update Contract Properties. +type ResolverUpdateContractProperties struct { + // Description of the resolver. May include HTML formatting tags. + Description *string + + // Resolver Name. + DisplayName *string + + // Path is type/field being resolved. + Path *string +} + // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -6000,6 +4685,29 @@ type Resource struct { Type *string } +// ResourceCollection - A collection of resources. +type ResourceCollection struct { + // Total record count number. + Count *int64 + + // Next page link if any. + NextLink *string + + // A collection of resources. + Value []*ResourceCollectionValueItem +} + +type ResourceCollectionValueItem struct { + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + // ResourceLocationDataContract - Resource location data properties. type ResourceLocationDataContract struct { // REQUIRED; A canonical name for the geographic or physical location. @@ -6197,11 +4905,6 @@ type SKUZoneDetails struct { Name []*string } -// SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method. -type SKUsClientListOptions struct { - // placeholder for future optional parameters -} - // SKUsResult - The List Resource Skus operation response. type SKUsResult struct { // REQUIRED; The list of skus available for the subscription. @@ -6274,7 +4977,7 @@ type SchemaContractProperties struct { // - WADL Schema use application/vnd.ms-azure-apim.wadl.grammars+xml. ContentType *string - // Create or update Properties of the API Schema Document. + // REQUIRED; Create or update Properties of the API Schema Document. Document *SchemaDocumentProperties } @@ -6344,15 +5047,15 @@ type ServiceBaseProperties struct { // API Management service. // Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For // all the settings except Http2 the default value is True if the service was - // created on or before April 1st 2018 and False otherwise. Http2 setting's default value is False. - // You can disable any of next ciphers by using settings Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]: - // TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES128CBCSHA, TLS - // ECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES128CBCSHA, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES128CBCSHA256, - // TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES128CBCSHA. For example, - // Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256:false. The default value - // is true for them. Note: next ciphers can't be disabled since they are required by - // Azure CloudService internal components: TLSECDHEECDSAWITHAES256GCMSHA384,TLSECDHEECDSAWITHAES128GCMSHA256,TLSECDHERSAWITHAES256GCMSHA384,TLSECDHERSAWITHAES128GCMSHA256,TLSECDHEECDSAWITHAES256CBC - // SHA384,TLSECDHEECDSAWITHAES128CBCSHA256,TLSECDHERSAWITHAES256CBCSHA384,TLSECDHERSAWITHAES128CBCSHA256,TLSRSAWITHAES256GCMSHA384 + // created on or before April 1, 2018 and False otherwise. Http2 setting's default value is False. + // You can disable any of the following ciphers by using settings Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]: + // TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES128CBC + // SHA, TLSECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES128CBCSHA, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES128CBCSHA256, + // TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES128CBCSHA. For + // example, Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256:false. The default + // value is true for them. + // Note: The following ciphers can't be disabled since they are required by internal platform components: TLSAES256GCMSHA384,TLSAES128GCMSHA256,TLSECDHEECDSAWITHAES256GCMSHA384,TLSECDHEECDSAWITHAES128GCM + // SHA256,TLSECDHERSAWITHAES256GCMSHA384,TLSECDHERSAWITHAES128GCMSHA256,TLSECDHEECDSAWITHAES256CBCSHA384,TLSECDHEECDSAWITHAES128CBCSHA256,TLSECDHERSAWITHAES256CBCSHA384,TLSECDHERSAWITHAES128CBCSHA256 CustomProperties map[string]*string // Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway @@ -6367,6 +5070,9 @@ type ServiceBaseProperties struct { // Custom hostname configuration of the API Management service. HostnameConfigurations []*HostnameConfiguration + // Property can be used to enable NAT Gateway for this API Management service. + NatGatewayState *NatGatewayState + // Email address from which the notification will be sent. NotificationSenderEmail *string @@ -6412,6 +5118,10 @@ type ServiceBaseProperties struct { // READ-ONLY; Management API endpoint URL of the API Management service. ManagementAPIURL *string + // READ-ONLY; Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium + // SKU on stv2 platform. + OutboundPublicIPAddresses []*string + // READ-ONLY; Compute Platform Version running the service in this location. PlatformVersion *PlatformVersion @@ -6444,80 +5154,6 @@ type ServiceCheckNameAvailabilityParameters struct { Name *string } -// ServiceClientBeginApplyNetworkConfigurationUpdatesOptions contains the optional parameters for the ServiceClient.BeginApplyNetworkConfigurationUpdates -// method. -type ServiceClientBeginApplyNetworkConfigurationUpdatesOptions struct { - // Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, all the regions in which - // the Api Management service is deployed will be updated sequentially without - // incurring downtime in the region. - Parameters *ServiceApplyNetworkConfigurationParameters - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServiceClientBeginBackupOptions contains the optional parameters for the ServiceClient.BeginBackup method. -type ServiceClientBeginBackupOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServiceClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceClient.BeginCreateOrUpdate method. -type ServiceClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServiceClientBeginDeleteOptions contains the optional parameters for the ServiceClient.BeginDelete method. -type ServiceClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServiceClientBeginRestoreOptions contains the optional parameters for the ServiceClient.BeginRestore method. -type ServiceClientBeginRestoreOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServiceClientBeginUpdateOptions contains the optional parameters for the ServiceClient.BeginUpdate method. -type ServiceClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServiceClientCheckNameAvailabilityOptions contains the optional parameters for the ServiceClient.CheckNameAvailability -// method. -type ServiceClientCheckNameAvailabilityOptions struct { - // placeholder for future optional parameters -} - -// ServiceClientGetDomainOwnershipIdentifierOptions contains the optional parameters for the ServiceClient.GetDomainOwnershipIdentifier -// method. -type ServiceClientGetDomainOwnershipIdentifierOptions struct { - // placeholder for future optional parameters -} - -// ServiceClientGetOptions contains the optional parameters for the ServiceClient.Get method. -type ServiceClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServiceClientGetSsoTokenOptions contains the optional parameters for the ServiceClient.GetSsoToken method. -type ServiceClientGetSsoTokenOptions struct { - // placeholder for future optional parameters -} - -// ServiceClientListByResourceGroupOptions contains the optional parameters for the ServiceClient.NewListByResourceGroupPager -// method. -type ServiceClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ServiceClientListOptions contains the optional parameters for the ServiceClient.NewListPager method. -type ServiceClientListOptions struct { - // placeholder for future optional parameters -} - // ServiceGetDomainOwnershipIdentifierResult - Response of the GetDomainOwnershipIdentifier operation. type ServiceGetDomainOwnershipIdentifierResult struct { // READ-ONLY; The domain ownership identifier value. @@ -6606,15 +5242,15 @@ type ServiceProperties struct { // API Management service. // Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For // all the settings except Http2 the default value is True if the service was - // created on or before April 1st 2018 and False otherwise. Http2 setting's default value is False. - // You can disable any of next ciphers by using settings Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]: - // TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES128CBCSHA, TLS - // ECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES128CBCSHA, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES128CBCSHA256, - // TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES128CBCSHA. For example, - // Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256:false. The default value - // is true for them. Note: next ciphers can't be disabled since they are required by - // Azure CloudService internal components: TLSECDHEECDSAWITHAES256GCMSHA384,TLSECDHEECDSAWITHAES128GCMSHA256,TLSECDHERSAWITHAES256GCMSHA384,TLSECDHERSAWITHAES128GCMSHA256,TLSECDHEECDSAWITHAES256CBC - // SHA384,TLSECDHEECDSAWITHAES128CBCSHA256,TLSECDHERSAWITHAES256CBCSHA384,TLSECDHERSAWITHAES128CBCSHA256,TLSRSAWITHAES256GCMSHA384 + // created on or before April 1, 2018 and False otherwise. Http2 setting's default value is False. + // You can disable any of the following ciphers by using settings Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]: + // TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES128CBC + // SHA, TLSECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES128CBCSHA, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES128CBCSHA256, + // TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES128CBCSHA. For + // example, Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256:false. The default + // value is true for them. + // Note: The following ciphers can't be disabled since they are required by internal platform components: TLSAES256GCMSHA384,TLSAES128GCMSHA256,TLSECDHEECDSAWITHAES256GCMSHA384,TLSECDHEECDSAWITHAES128GCM + // SHA256,TLSECDHERSAWITHAES256GCMSHA384,TLSECDHERSAWITHAES128GCMSHA256,TLSECDHEECDSAWITHAES256CBCSHA384,TLSECDHEECDSAWITHAES128CBCSHA256,TLSECDHERSAWITHAES256CBCSHA384,TLSECDHERSAWITHAES128CBCSHA256 CustomProperties map[string]*string // Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway @@ -6629,6 +5265,9 @@ type ServiceProperties struct { // Custom hostname configuration of the API Management service. HostnameConfigurations []*HostnameConfiguration + // Property can be used to enable NAT Gateway for this API Management service. + NatGatewayState *NatGatewayState + // Email address from which the notification will be sent. NotificationSenderEmail *string @@ -6674,6 +5313,10 @@ type ServiceProperties struct { // READ-ONLY; Management API endpoint URL of the API Management service. ManagementAPIURL *string + // READ-ONLY; Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium + // SKU on stv2 platform. + OutboundPublicIPAddresses []*string + // READ-ONLY; Compute Platform Version running the service in this location. PlatformVersion *PlatformVersion @@ -6746,12 +5389,6 @@ type ServiceSKUProperties struct { Name *SKUType } -// ServiceSKUsClientListAvailableServiceSKUsOptions contains the optional parameters for the ServiceSKUsClient.NewListAvailableServiceSKUsPager -// method. -type ServiceSKUsClientListAvailableServiceSKUsOptions struct { - // placeholder for future optional parameters -} - // ServiceUpdateParameters - Parameter supplied to Update Api Management Service. type ServiceUpdateParameters struct { // Managed service identity of the Api Management service. @@ -6808,15 +5445,15 @@ type ServiceUpdateProperties struct { // API Management service. // Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For // all the settings except Http2 the default value is True if the service was - // created on or before April 1st 2018 and False otherwise. Http2 setting's default value is False. - // You can disable any of next ciphers by using settings Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]: - // TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES128CBCSHA, TLS - // ECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES128CBCSHA, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES128CBCSHA256, - // TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES128CBCSHA. For example, - // Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256:false. The default value - // is true for them. Note: next ciphers can't be disabled since they are required by - // Azure CloudService internal components: TLSECDHEECDSAWITHAES256GCMSHA384,TLSECDHEECDSAWITHAES128GCMSHA256,TLSECDHERSAWITHAES256GCMSHA384,TLSECDHERSAWITHAES128GCMSHA256,TLSECDHEECDSAWITHAES256CBC - // SHA384,TLSECDHEECDSAWITHAES128CBCSHA256,TLSECDHERSAWITHAES256CBCSHA384,TLSECDHERSAWITHAES128CBCSHA256,TLSRSAWITHAES256GCMSHA384 + // created on or before April 1, 2018 and False otherwise. Http2 setting's default value is False. + // You can disable any of the following ciphers by using settings Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]: + // TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES128CBC + // SHA, TLSECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES128CBCSHA, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES128CBCSHA256, + // TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES128CBCSHA. For + // example, Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256:false. The default + // value is true for them. + // Note: The following ciphers can't be disabled since they are required by internal platform components: TLSAES256GCMSHA384,TLSAES128GCMSHA256,TLSECDHEECDSAWITHAES256GCMSHA384,TLSECDHEECDSAWITHAES128GCM + // SHA256,TLSECDHERSAWITHAES256GCMSHA384,TLSECDHERSAWITHAES128GCMSHA256,TLSECDHEECDSAWITHAES256CBCSHA384,TLSECDHEECDSAWITHAES128CBCSHA256,TLSECDHERSAWITHAES256CBCSHA384,TLSECDHERSAWITHAES128CBCSHA256 CustomProperties map[string]*string // Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway @@ -6831,6 +5468,9 @@ type ServiceUpdateProperties struct { // Custom hostname configuration of the API Management service. HostnameConfigurations []*HostnameConfiguration + // Property can be used to enable NAT Gateway for this API Management service. + NatGatewayState *NatGatewayState + // Email address from which the notification will be sent. NotificationSenderEmail *string @@ -6882,6 +5522,10 @@ type ServiceUpdateProperties struct { // READ-ONLY; Management API endpoint URL of the API Management service. ManagementAPIURL *string + // READ-ONLY; Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium + // SKU on stv2 platform. + OutboundPublicIPAddresses []*string + // READ-ONLY; Compute Platform Version running the service in this location. PlatformVersion *PlatformVersion @@ -6908,124 +5552,6 @@ type ServiceUpdateProperties struct { TargetProvisioningState *string } -// SignInSettingsClientCreateOrUpdateOptions contains the optional parameters for the SignInSettingsClient.CreateOrUpdate -// method. -type SignInSettingsClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// SignInSettingsClientGetEntityTagOptions contains the optional parameters for the SignInSettingsClient.GetEntityTag method. -type SignInSettingsClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// SignInSettingsClientGetOptions contains the optional parameters for the SignInSettingsClient.Get method. -type SignInSettingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SignInSettingsClientUpdateOptions contains the optional parameters for the SignInSettingsClient.Update method. -type SignInSettingsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// SignUpSettingsClientCreateOrUpdateOptions contains the optional parameters for the SignUpSettingsClient.CreateOrUpdate -// method. -type SignUpSettingsClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// SignUpSettingsClientGetEntityTagOptions contains the optional parameters for the SignUpSettingsClient.GetEntityTag method. -type SignUpSettingsClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// SignUpSettingsClientGetOptions contains the optional parameters for the SignUpSettingsClient.Get method. -type SignUpSettingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SignUpSettingsClientUpdateOptions contains the optional parameters for the SignUpSettingsClient.Update method. -type SignUpSettingsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// SubscriptionClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionClient.CreateOrUpdate method. -type SubscriptionClientCreateOrUpdateOptions struct { - // Determines the type of application which send the create user request. Default is legacy publisher portal. - AppType *AppType - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string - // Notify change in Subscription State. - // * If false, do not send any email notification for change of state of subscription - // * If true, send email notification of change of state of subscription - Notify *bool -} - -// SubscriptionClientDeleteOptions contains the optional parameters for the SubscriptionClient.Delete method. -type SubscriptionClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// SubscriptionClientGetEntityTagOptions contains the optional parameters for the SubscriptionClient.GetEntityTag method. -type SubscriptionClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// SubscriptionClientGetOptions contains the optional parameters for the SubscriptionClient.Get method. -type SubscriptionClientGetOptions struct { - // placeholder for future optional parameters -} - -// SubscriptionClientListOptions contains the optional parameters for the SubscriptionClient.NewListPager method. -type SubscriptionClientListOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | state | filter | eq | | - // | user | expand | | | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// SubscriptionClientListSecretsOptions contains the optional parameters for the SubscriptionClient.ListSecrets method. -type SubscriptionClientListSecretsOptions struct { - // placeholder for future optional parameters -} - -// SubscriptionClientRegeneratePrimaryKeyOptions contains the optional parameters for the SubscriptionClient.RegeneratePrimaryKey -// method. -type SubscriptionClientRegeneratePrimaryKeyOptions struct { - // placeholder for future optional parameters -} - -// SubscriptionClientRegenerateSecondaryKeyOptions contains the optional parameters for the SubscriptionClient.RegenerateSecondaryKey -// method. -type SubscriptionClientRegenerateSecondaryKeyOptions struct { - // placeholder for future optional parameters -} - -// SubscriptionClientUpdateOptions contains the optional parameters for the SubscriptionClient.Update method. -type SubscriptionClientUpdateOptions struct { - // Determines the type of application which send the create user request. Default is legacy publisher portal. - AppType *AppType - // Notify change in Subscription State. - // * If false, do not send any email notification for change of state of subscription - // * If true, send email notification of change of state of subscription - Notify *bool -} - // SubscriptionCollection - Paged Subscriptions list representation. type SubscriptionCollection struct { // Total record count number across all pages. @@ -7235,147 +5761,6 @@ type SystemData struct { LastModifiedByType *CreatedByType } -// TagClientAssignToAPIOptions contains the optional parameters for the TagClient.AssignToAPI method. -type TagClientAssignToAPIOptions struct { - // placeholder for future optional parameters -} - -// TagClientAssignToOperationOptions contains the optional parameters for the TagClient.AssignToOperation method. -type TagClientAssignToOperationOptions struct { - // placeholder for future optional parameters -} - -// TagClientAssignToProductOptions contains the optional parameters for the TagClient.AssignToProduct method. -type TagClientAssignToProductOptions struct { - // placeholder for future optional parameters -} - -// TagClientCreateOrUpdateOptions contains the optional parameters for the TagClient.CreateOrUpdate method. -type TagClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string -} - -// TagClientDeleteOptions contains the optional parameters for the TagClient.Delete method. -type TagClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// TagClientDetachFromAPIOptions contains the optional parameters for the TagClient.DetachFromAPI method. -type TagClientDetachFromAPIOptions struct { - // placeholder for future optional parameters -} - -// TagClientDetachFromOperationOptions contains the optional parameters for the TagClient.DetachFromOperation method. -type TagClientDetachFromOperationOptions struct { - // placeholder for future optional parameters -} - -// TagClientDetachFromProductOptions contains the optional parameters for the TagClient.DetachFromProduct method. -type TagClientDetachFromProductOptions struct { - // placeholder for future optional parameters -} - -// TagClientGetByAPIOptions contains the optional parameters for the TagClient.GetByAPI method. -type TagClientGetByAPIOptions struct { - // placeholder for future optional parameters -} - -// TagClientGetByOperationOptions contains the optional parameters for the TagClient.GetByOperation method. -type TagClientGetByOperationOptions struct { - // placeholder for future optional parameters -} - -// TagClientGetByProductOptions contains the optional parameters for the TagClient.GetByProduct method. -type TagClientGetByProductOptions struct { - // placeholder for future optional parameters -} - -// TagClientGetEntityStateByAPIOptions contains the optional parameters for the TagClient.GetEntityStateByAPI method. -type TagClientGetEntityStateByAPIOptions struct { - // placeholder for future optional parameters -} - -// TagClientGetEntityStateByOperationOptions contains the optional parameters for the TagClient.GetEntityStateByOperation -// method. -type TagClientGetEntityStateByOperationOptions struct { - // placeholder for future optional parameters -} - -// TagClientGetEntityStateByProductOptions contains the optional parameters for the TagClient.GetEntityStateByProduct method. -type TagClientGetEntityStateByProductOptions struct { - // placeholder for future optional parameters -} - -// TagClientGetEntityStateOptions contains the optional parameters for the TagClient.GetEntityState method. -type TagClientGetEntityStateOptions struct { - // placeholder for future optional parameters -} - -// TagClientGetOptions contains the optional parameters for the TagClient.Get method. -type TagClientGetOptions struct { - // placeholder for future optional parameters -} - -// TagClientListByAPIOptions contains the optional parameters for the TagClient.NewListByAPIPager method. -type TagClientListByAPIOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// TagClientListByOperationOptions contains the optional parameters for the TagClient.NewListByOperationPager method. -type TagClientListByOperationOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// TagClientListByProductOptions contains the optional parameters for the TagClient.NewListByProductPager method. -type TagClientListByProductOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// TagClientListByServiceOptions contains the optional parameters for the TagClient.NewListByServicePager method. -type TagClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Scope like 'apis', 'products' or 'apis/{apiId} - Scope *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// TagClientUpdateOptions contains the optional parameters for the TagClient.Update method. -type TagClientUpdateOptions struct { - // placeholder for future optional parameters -} - // TagCollection - Paged Tag list representation. type TagCollection struct { // Total record count number across all pages. @@ -7478,31 +5863,6 @@ type TagDescriptionCreateParameters struct { Properties *TagDescriptionBaseProperties } -// TagResourceClientListByServiceOptions contains the optional parameters for the TagResourceClient.NewListByServicePager -// method. -type TagResourceClientListByServiceOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | aid | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | apiName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | state | filter | eq | | - // | isCurrent | filter | eq | | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - // TagResourceCollection - Paged Tag list representation. type TagResourceCollection struct { // Total record count number across all pages. @@ -7539,89 +5899,6 @@ type TagResourceContractProperties struct { Name *string } -// TenantAccessClientCreateOptions contains the optional parameters for the TenantAccessClient.Create method. -type TenantAccessClientCreateOptions struct { - // placeholder for future optional parameters -} - -// TenantAccessClientGetEntityTagOptions contains the optional parameters for the TenantAccessClient.GetEntityTag method. -type TenantAccessClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// TenantAccessClientGetOptions contains the optional parameters for the TenantAccessClient.Get method. -type TenantAccessClientGetOptions struct { - // placeholder for future optional parameters -} - -// TenantAccessClientListByServiceOptions contains the optional parameters for the TenantAccessClient.NewListByServicePager -// method. -type TenantAccessClientListByServiceOptions struct { - // Not used - Filter *string -} - -// TenantAccessClientListSecretsOptions contains the optional parameters for the TenantAccessClient.ListSecrets method. -type TenantAccessClientListSecretsOptions struct { - // placeholder for future optional parameters -} - -// TenantAccessClientRegeneratePrimaryKeyOptions contains the optional parameters for the TenantAccessClient.RegeneratePrimaryKey -// method. -type TenantAccessClientRegeneratePrimaryKeyOptions struct { - // placeholder for future optional parameters -} - -// TenantAccessClientRegenerateSecondaryKeyOptions contains the optional parameters for the TenantAccessClient.RegenerateSecondaryKey -// method. -type TenantAccessClientRegenerateSecondaryKeyOptions struct { - // placeholder for future optional parameters -} - -// TenantAccessClientUpdateOptions contains the optional parameters for the TenantAccessClient.Update method. -type TenantAccessClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// TenantAccessGitClientRegeneratePrimaryKeyOptions contains the optional parameters for the TenantAccessGitClient.RegeneratePrimaryKey -// method. -type TenantAccessGitClientRegeneratePrimaryKeyOptions struct { - // placeholder for future optional parameters -} - -// TenantAccessGitClientRegenerateSecondaryKeyOptions contains the optional parameters for the TenantAccessGitClient.RegenerateSecondaryKey -// method. -type TenantAccessGitClientRegenerateSecondaryKeyOptions struct { - // placeholder for future optional parameters -} - -// TenantConfigurationClientBeginDeployOptions contains the optional parameters for the TenantConfigurationClient.BeginDeploy -// method. -type TenantConfigurationClientBeginDeployOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// TenantConfigurationClientBeginSaveOptions contains the optional parameters for the TenantConfigurationClient.BeginSave -// method. -type TenantConfigurationClientBeginSaveOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// TenantConfigurationClientBeginValidateOptions contains the optional parameters for the TenantConfigurationClient.BeginValidate -// method. -type TenantConfigurationClientBeginValidateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// TenantConfigurationClientGetSyncStateOptions contains the optional parameters for the TenantConfigurationClient.GetSyncState -// method. -type TenantConfigurationClientGetSyncStateOptions struct { - // placeholder for future optional parameters -} - // TenantConfigurationSyncStateContract - Result of Tenant Configuration Sync State. type TenantConfigurationSyncStateContract struct { // Properties returned Tenant Configuration Sync State check. @@ -7666,18 +5943,6 @@ type TenantConfigurationSyncStateContractProperties struct { SyncDate *time.Time } -// TenantSettingsClientGetOptions contains the optional parameters for the TenantSettingsClient.Get method. -type TenantSettingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// TenantSettingsClientListByServiceOptions contains the optional parameters for the TenantSettingsClient.NewListByServicePager -// method. -type TenantSettingsClientListByServiceOptions struct { - // Not used - Filter *string -} - // TenantSettingsCollection - Paged AccessInformation list representation. type TenantSettingsCollection struct { // READ-ONLY; Next page link if any. @@ -7729,70 +5994,6 @@ type TokenBodyParameterContract struct { Value *string } -// UserClientCreateOrUpdateOptions contains the optional parameters for the UserClient.CreateOrUpdate method. -type UserClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string - // Send an Email notification to the User. - Notify *bool -} - -// UserClientDeleteOptions contains the optional parameters for the UserClient.Delete method. -type UserClientDeleteOptions struct { - // Determines the type of application which send the create user request. Default is legacy publisher portal. - AppType *AppType - // Whether to delete user's subscription or not. - DeleteSubscriptions *bool - // Send an Account Closed Email notification to the User. - Notify *bool -} - -// UserClientGenerateSsoURLOptions contains the optional parameters for the UserClient.GenerateSsoURL method. -type UserClientGenerateSsoURLOptions struct { - // placeholder for future optional parameters -} - -// UserClientGetEntityTagOptions contains the optional parameters for the UserClient.GetEntityTag method. -type UserClientGetEntityTagOptions struct { - // placeholder for future optional parameters -} - -// UserClientGetOptions contains the optional parameters for the UserClient.Get method. -type UserClientGetOptions struct { - // placeholder for future optional parameters -} - -// UserClientGetSharedAccessTokenOptions contains the optional parameters for the UserClient.GetSharedAccessToken method. -type UserClientGetSharedAccessTokenOptions struct { - // placeholder for future optional parameters -} - -// UserClientListByServiceOptions contains the optional parameters for the UserClient.NewListByServicePager method. -type UserClientListByServiceOptions struct { - // Detailed Group in response. - ExpandGroups *bool - // | Field | Usage | Supported operators | Supported functions | - // |-------------|-------------|-------------|-------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | firstName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | lastName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | state | filter | eq | | - // | registrationDate | filter | ge, le, eq, ne, gt, lt | | - // | note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | groups | expand | | | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// UserClientUpdateOptions contains the optional parameters for the UserClient.Update method. -type UserClientUpdateOptions struct { - // placeholder for future optional parameters -} - // UserCollection - Paged Users list representation. type UserCollection struct { // Total record count number across all pages. @@ -7805,13 +6006,6 @@ type UserCollection struct { Value []*UserContract } -// UserConfirmationPasswordClientSendOptions contains the optional parameters for the UserConfirmationPasswordClient.Send -// method. -type UserConfirmationPasswordClientSendOptions struct { - // Determines the type of application which send the create user request. Default is legacy publisher portal. - AppType *AppType -} - // UserContract - User details. type UserContract struct { // User entity contract properties. @@ -7906,25 +6100,6 @@ type UserEntityBaseParameters struct { State *UserState } -// UserGroupClientListOptions contains the optional parameters for the UserGroupClient.NewListPager method. -type UserGroupClientListOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|------------------------|-----------------------------------| - // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - -// UserIdentitiesClientListOptions contains the optional parameters for the UserIdentitiesClient.NewListPager method. -type UserIdentitiesClientListOptions struct { - // placeholder for future optional parameters -} - // UserIdentityCollection - List of Users Identity list representation. type UserIdentityCollection struct { // Total record count number across all pages. @@ -7954,29 +6129,6 @@ type UserIdentityProperties struct { PrincipalID *string } -// UserSubscriptionClientGetOptions contains the optional parameters for the UserSubscriptionClient.Get method. -type UserSubscriptionClientGetOptions struct { - // placeholder for future optional parameters -} - -// UserSubscriptionClientListOptions contains the optional parameters for the UserSubscriptionClient.NewListPager method. -type UserSubscriptionClientListOptions struct { - // | Field | Usage | Supported operators | Supported functions | - // |-------------|------------------------|-----------------------------------| - // |name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // |displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // |stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // |ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // |scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // |userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - // |productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | - Filter *string - // Number of records to skip. - Skip *int32 - // Number of records to return. - Top *int32 -} - // UserTokenParameterProperties - Parameters supplied to the Get User Token operation. type UserTokenParameterProperties struct { // REQUIRED; The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following @@ -8042,6 +6194,48 @@ type VirtualNetworkConfiguration struct { Vnetid *string } +// WikiCollection - Paged Wiki list representation. +type WikiCollection struct { + // READ-ONLY; Next page link if any. + NextLink *string + + // READ-ONLY; Page values. + Value []*WikiContract +} + +// WikiContract - Wiki properties +type WikiContract struct { + // Wiki details. + Properties *WikiContractProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// WikiContractProperties - Wiki contract details +type WikiContractProperties struct { + // Collection wiki documents included into this wiki. + Documents []*WikiDocumentationContract +} + +// WikiDocumentationContract - Wiki documentation details. +type WikiDocumentationContract struct { + // Documentation Identifier + DocumentationID *string +} + +// WikiUpdateContract - Wiki update contract details. +type WikiUpdateContract struct { + // Wiki details. + Properties *WikiContractProperties +} + // X509CertificateName - Properties of server X509Names. type X509CertificateName struct { // Thumbprint for the Issuer of the Certificate. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/models_serde.go b/sdk/resourcemanager/apimanagement/armapimanagement/models_serde.go index 7aa96a7f0f21..86f2810464d7 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/models_serde.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/models_serde.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -384,6 +383,7 @@ func (a APICreateOrUpdateProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "subscriptionKeyParameterNames", a.SubscriptionKeyParameterNames) populate(objectMap, "subscriptionRequired", a.SubscriptionRequired) populate(objectMap, "termsOfServiceUrl", a.TermsOfServiceURL) + populate(objectMap, "translateRequiredQueryParameters", a.TranslateRequiredQueryParametersConduct) populate(objectMap, "value", a.Value) populate(objectMap, "wsdlSelector", a.WsdlSelector) return json.Marshal(objectMap) @@ -467,6 +467,9 @@ func (a *APICreateOrUpdateProperties) UnmarshalJSON(data []byte) error { case "termsOfServiceUrl": err = unpopulate(val, "TermsOfServiceURL", &a.TermsOfServiceURL) delete(rawMsg, key) + case "translateRequiredQueryParameters": + err = unpopulate(val, "TranslateRequiredQueryParametersConduct", &a.TranslateRequiredQueryParametersConduct) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) @@ -1634,6 +1637,8 @@ func (a AdditionalLocation) MarshalJSON() ([]byte, error) { populate(objectMap, "disableGateway", a.DisableGateway) populate(objectMap, "gatewayRegionalUrl", a.GatewayRegionalURL) populate(objectMap, "location", a.Location) + populate(objectMap, "natGatewayState", a.NatGatewayState) + populate(objectMap, "outboundPublicIPAddresses", a.OutboundPublicIPAddresses) populate(objectMap, "platformVersion", a.PlatformVersion) populate(objectMap, "privateIPAddresses", a.PrivateIPAddresses) populate(objectMap, "publicIpAddressId", a.PublicIPAddressID) @@ -1662,6 +1667,12 @@ func (a *AdditionalLocation) UnmarshalJSON(data []byte) error { case "location": err = unpopulate(val, "Location", &a.Location) delete(rawMsg, key) + case "natGatewayState": + err = unpopulate(val, "NatGatewayState", &a.NatGatewayState) + delete(rawMsg, key) + case "outboundPublicIPAddresses": + err = unpopulate(val, "OutboundPublicIPAddresses", &a.OutboundPublicIPAddresses) + delete(rawMsg, key) case "platformVersion": err = unpopulate(val, "PlatformVersion", &a.PlatformVersion) delete(rawMsg, key) @@ -1827,7 +1838,9 @@ func (a *AssociationContractProperties) UnmarshalJSON(data []byte) error { func (a AuthenticationSettingsContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "oAuth2", a.OAuth2) + populate(objectMap, "oAuth2AuthenticationSettings", a.OAuth2AuthenticationSettings) populate(objectMap, "openid", a.Openid) + populate(objectMap, "openidAuthenticationSettings", a.OpenidAuthenticationSettings) return json.Marshal(objectMap) } @@ -1843,9 +1856,15 @@ func (a *AuthenticationSettingsContract) UnmarshalJSON(data []byte) error { case "oAuth2": err = unpopulate(val, "OAuth2", &a.OAuth2) delete(rawMsg, key) + case "oAuth2AuthenticationSettings": + err = unpopulate(val, "OAuth2AuthenticationSettings", &a.OAuth2AuthenticationSettings) + delete(rawMsg, key) case "openid": err = unpopulate(val, "Openid", &a.Openid) delete(rawMsg, key) + case "openidAuthenticationSettings": + err = unpopulate(val, "OpenidAuthenticationSettings", &a.OpenidAuthenticationSettings) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -1854,8 +1873,8 @@ func (a *AuthenticationSettingsContract) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerCollection. -func (a AuthorizationServerCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationAccessPolicyCollection. +func (a AuthorizationAccessPolicyCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "count", a.Count) populate(objectMap, "nextLink", a.NextLink) @@ -1863,8 +1882,8 @@ func (a AuthorizationServerCollection) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerCollection. -func (a *AuthorizationServerCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationAccessPolicyCollection. +func (a *AuthorizationAccessPolicyCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -1889,8 +1908,8 @@ func (a *AuthorizationServerCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerContract. -func (a AuthorizationServerContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationAccessPolicyContract. +func (a AuthorizationAccessPolicyContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) @@ -1899,8 +1918,8 @@ func (a AuthorizationServerContract) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerContract. -func (a *AuthorizationServerContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationAccessPolicyContract. +func (a *AuthorizationAccessPolicyContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -1928,24 +1947,16 @@ func (a *AuthorizationServerContract) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerContractBaseProperties. -func (a AuthorizationServerContractBaseProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationAccessPolicyContractProperties. +func (a AuthorizationAccessPolicyContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "authorizationMethods", a.AuthorizationMethods) - populate(objectMap, "bearerTokenSendingMethods", a.BearerTokenSendingMethods) - populate(objectMap, "clientAuthenticationMethod", a.ClientAuthenticationMethod) - populate(objectMap, "defaultScope", a.DefaultScope) - populate(objectMap, "description", a.Description) - populate(objectMap, "resourceOwnerPassword", a.ResourceOwnerPassword) - populate(objectMap, "resourceOwnerUsername", a.ResourceOwnerUsername) - populate(objectMap, "supportState", a.SupportState) - populate(objectMap, "tokenBodyParameters", a.TokenBodyParameters) - populate(objectMap, "tokenEndpoint", a.TokenEndpoint) + populate(objectMap, "objectId", a.ObjectID) + populate(objectMap, "tenantId", a.TenantID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerContractBaseProperties. -func (a *AuthorizationServerContractBaseProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationAccessPolicyContractProperties. +func (a *AuthorizationAccessPolicyContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -1953,35 +1964,11 @@ func (a *AuthorizationServerContractBaseProperties) UnmarshalJSON(data []byte) e for key, val := range rawMsg { var err error switch key { - case "authorizationMethods": - err = unpopulate(val, "AuthorizationMethods", &a.AuthorizationMethods) - delete(rawMsg, key) - case "bearerTokenSendingMethods": - err = unpopulate(val, "BearerTokenSendingMethods", &a.BearerTokenSendingMethods) + case "objectId": + err = unpopulate(val, "ObjectID", &a.ObjectID) delete(rawMsg, key) - case "clientAuthenticationMethod": - err = unpopulate(val, "ClientAuthenticationMethod", &a.ClientAuthenticationMethod) - delete(rawMsg, key) - case "defaultScope": - err = unpopulate(val, "DefaultScope", &a.DefaultScope) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "resourceOwnerPassword": - err = unpopulate(val, "ResourceOwnerPassword", &a.ResourceOwnerPassword) - delete(rawMsg, key) - case "resourceOwnerUsername": - err = unpopulate(val, "ResourceOwnerUsername", &a.ResourceOwnerUsername) - delete(rawMsg, key) - case "supportState": - err = unpopulate(val, "SupportState", &a.SupportState) - delete(rawMsg, key) - case "tokenBodyParameters": - err = unpopulate(val, "TokenBodyParameters", &a.TokenBodyParameters) - delete(rawMsg, key) - case "tokenEndpoint": - err = unpopulate(val, "TokenEndpoint", &a.TokenEndpoint) + case "tenantId": + err = unpopulate(val, "TenantID", &a.TenantID) delete(rawMsg, key) } if err != nil { @@ -1991,30 +1978,17 @@ func (a *AuthorizationServerContractBaseProperties) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerContractProperties. -func (a AuthorizationServerContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationCollection. +func (a AuthorizationCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "authorizationEndpoint", a.AuthorizationEndpoint) - populate(objectMap, "authorizationMethods", a.AuthorizationMethods) - populate(objectMap, "bearerTokenSendingMethods", a.BearerTokenSendingMethods) - populate(objectMap, "clientAuthenticationMethod", a.ClientAuthenticationMethod) - populate(objectMap, "clientId", a.ClientID) - populate(objectMap, "clientRegistrationEndpoint", a.ClientRegistrationEndpoint) - populate(objectMap, "clientSecret", a.ClientSecret) - populate(objectMap, "defaultScope", a.DefaultScope) - populate(objectMap, "description", a.Description) - populate(objectMap, "displayName", a.DisplayName) - populate(objectMap, "grantTypes", a.GrantTypes) - populate(objectMap, "resourceOwnerPassword", a.ResourceOwnerPassword) - populate(objectMap, "resourceOwnerUsername", a.ResourceOwnerUsername) - populate(objectMap, "supportState", a.SupportState) - populate(objectMap, "tokenBodyParameters", a.TokenBodyParameters) - populate(objectMap, "tokenEndpoint", a.TokenEndpoint) + populate(objectMap, "count", a.Count) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerContractProperties. -func (a *AuthorizationServerContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationCollection. +func (a *AuthorizationCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -2022,53 +1996,14 @@ func (a *AuthorizationServerContractProperties) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "authorizationEndpoint": - err = unpopulate(val, "AuthorizationEndpoint", &a.AuthorizationEndpoint) - delete(rawMsg, key) - case "authorizationMethods": - err = unpopulate(val, "AuthorizationMethods", &a.AuthorizationMethods) - delete(rawMsg, key) - case "bearerTokenSendingMethods": - err = unpopulate(val, "BearerTokenSendingMethods", &a.BearerTokenSendingMethods) - delete(rawMsg, key) - case "clientAuthenticationMethod": - err = unpopulate(val, "ClientAuthenticationMethod", &a.ClientAuthenticationMethod) - delete(rawMsg, key) - case "clientId": - err = unpopulate(val, "ClientID", &a.ClientID) - delete(rawMsg, key) - case "clientRegistrationEndpoint": - err = unpopulate(val, "ClientRegistrationEndpoint", &a.ClientRegistrationEndpoint) - delete(rawMsg, key) - case "clientSecret": - err = unpopulate(val, "ClientSecret", &a.ClientSecret) - delete(rawMsg, key) - case "defaultScope": - err = unpopulate(val, "DefaultScope", &a.DefaultScope) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &a.DisplayName) - delete(rawMsg, key) - case "grantTypes": - err = unpopulate(val, "GrantTypes", &a.GrantTypes) - delete(rawMsg, key) - case "resourceOwnerPassword": - err = unpopulate(val, "ResourceOwnerPassword", &a.ResourceOwnerPassword) - delete(rawMsg, key) - case "resourceOwnerUsername": - err = unpopulate(val, "ResourceOwnerUsername", &a.ResourceOwnerUsername) - delete(rawMsg, key) - case "supportState": - err = unpopulate(val, "SupportState", &a.SupportState) + case "count": + err = unpopulate(val, "Count", &a.Count) delete(rawMsg, key) - case "tokenBodyParameters": - err = unpopulate(val, "TokenBodyParameters", &a.TokenBodyParameters) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) - case "tokenEndpoint": - err = unpopulate(val, "TokenEndpoint", &a.TokenEndpoint) + case "value": + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { @@ -2078,17 +2013,15 @@ func (a *AuthorizationServerContractProperties) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerSecretsContract. -func (a AuthorizationServerSecretsContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationConfirmConsentCodeRequestContract. +func (a AuthorizationConfirmConsentCodeRequestContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientSecret", a.ClientSecret) - populate(objectMap, "resourceOwnerPassword", a.ResourceOwnerPassword) - populate(objectMap, "resourceOwnerUsername", a.ResourceOwnerUsername) + populate(objectMap, "consentCode", a.ConsentCode) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerSecretsContract. -func (a *AuthorizationServerSecretsContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationConfirmConsentCodeRequestContract. +func (a *AuthorizationConfirmConsentCodeRequestContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -2096,14 +2029,8 @@ func (a *AuthorizationServerSecretsContract) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "clientSecret": - err = unpopulate(val, "ClientSecret", &a.ClientSecret) - delete(rawMsg, key) - case "resourceOwnerPassword": - err = unpopulate(val, "ResourceOwnerPassword", &a.ResourceOwnerPassword) - delete(rawMsg, key) - case "resourceOwnerUsername": - err = unpopulate(val, "ResourceOwnerUsername", &a.ResourceOwnerUsername) + case "consentCode": + err = unpopulate(val, "ConsentCode", &a.ConsentCode) delete(rawMsg, key) } if err != nil { @@ -2113,8 +2040,8 @@ func (a *AuthorizationServerSecretsContract) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerUpdateContract. -func (a AuthorizationServerUpdateContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationContract. +func (a AuthorizationContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) @@ -2123,8 +2050,8 @@ func (a AuthorizationServerUpdateContract) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerUpdateContract. -func (a *AuthorizationServerUpdateContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationContract. +func (a *AuthorizationContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -2152,30 +2079,19 @@ func (a *AuthorizationServerUpdateContract) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerUpdateContractProperties. -func (a AuthorizationServerUpdateContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationContractProperties. +func (a AuthorizationContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "authorizationEndpoint", a.AuthorizationEndpoint) - populate(objectMap, "authorizationMethods", a.AuthorizationMethods) - populate(objectMap, "bearerTokenSendingMethods", a.BearerTokenSendingMethods) - populate(objectMap, "clientAuthenticationMethod", a.ClientAuthenticationMethod) - populate(objectMap, "clientId", a.ClientID) - populate(objectMap, "clientRegistrationEndpoint", a.ClientRegistrationEndpoint) - populate(objectMap, "clientSecret", a.ClientSecret) - populate(objectMap, "defaultScope", a.DefaultScope) - populate(objectMap, "description", a.Description) - populate(objectMap, "displayName", a.DisplayName) - populate(objectMap, "grantTypes", a.GrantTypes) - populate(objectMap, "resourceOwnerPassword", a.ResourceOwnerPassword) - populate(objectMap, "resourceOwnerUsername", a.ResourceOwnerUsername) - populate(objectMap, "supportState", a.SupportState) - populate(objectMap, "tokenBodyParameters", a.TokenBodyParameters) - populate(objectMap, "tokenEndpoint", a.TokenEndpoint) + populate(objectMap, "authorizationType", a.AuthorizationType) + populate(objectMap, "error", a.Error) + populate(objectMap, "oauth2grantType", a.OAuth2GrantType) + populate(objectMap, "parameters", a.Parameters) + populate(objectMap, "status", a.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerUpdateContractProperties. -func (a *AuthorizationServerUpdateContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationContractProperties. +func (a *AuthorizationContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -2183,53 +2099,20 @@ func (a *AuthorizationServerUpdateContractProperties) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "authorizationEndpoint": - err = unpopulate(val, "AuthorizationEndpoint", &a.AuthorizationEndpoint) - delete(rawMsg, key) - case "authorizationMethods": - err = unpopulate(val, "AuthorizationMethods", &a.AuthorizationMethods) - delete(rawMsg, key) - case "bearerTokenSendingMethods": - err = unpopulate(val, "BearerTokenSendingMethods", &a.BearerTokenSendingMethods) - delete(rawMsg, key) - case "clientAuthenticationMethod": - err = unpopulate(val, "ClientAuthenticationMethod", &a.ClientAuthenticationMethod) - delete(rawMsg, key) - case "clientId": - err = unpopulate(val, "ClientID", &a.ClientID) - delete(rawMsg, key) - case "clientRegistrationEndpoint": - err = unpopulate(val, "ClientRegistrationEndpoint", &a.ClientRegistrationEndpoint) - delete(rawMsg, key) - case "clientSecret": - err = unpopulate(val, "ClientSecret", &a.ClientSecret) - delete(rawMsg, key) - case "defaultScope": - err = unpopulate(val, "DefaultScope", &a.DefaultScope) + case "authorizationType": + err = unpopulate(val, "AuthorizationType", &a.AuthorizationType) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &a.DisplayName) - delete(rawMsg, key) - case "grantTypes": - err = unpopulate(val, "GrantTypes", &a.GrantTypes) - delete(rawMsg, key) - case "resourceOwnerPassword": - err = unpopulate(val, "ResourceOwnerPassword", &a.ResourceOwnerPassword) - delete(rawMsg, key) - case "resourceOwnerUsername": - err = unpopulate(val, "ResourceOwnerUsername", &a.ResourceOwnerUsername) + case "error": + err = unpopulate(val, "Error", &a.Error) delete(rawMsg, key) - case "supportState": - err = unpopulate(val, "SupportState", &a.SupportState) + case "oauth2grantType": + err = unpopulate(val, "OAuth2GrantType", &a.OAuth2GrantType) delete(rawMsg, key) - case "tokenBodyParameters": - err = unpopulate(val, "TokenBodyParameters", &a.TokenBodyParameters) + case "parameters": + err = unpopulate(val, "Parameters", &a.Parameters) delete(rawMsg, key) - case "tokenEndpoint": - err = unpopulate(val, "TokenEndpoint", &a.TokenEndpoint) + case "status": + err = unpopulate(val, "Status", &a.Status) delete(rawMsg, key) } if err != nil { @@ -2239,594 +2122,2126 @@ func (a *AuthorizationServerUpdateContractProperties) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type BackendAuthorizationHeaderCredentials. -func (b BackendAuthorizationHeaderCredentials) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationError. +func (a AuthorizationError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "parameter", b.Parameter) - populate(objectMap, "scheme", b.Scheme) + populate(objectMap, "code", a.Code) + populate(objectMap, "message", a.Message) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackendAuthorizationHeaderCredentials. -func (b *BackendAuthorizationHeaderCredentials) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationError. +func (a *AuthorizationError) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "parameter": - err = unpopulate(val, "Parameter", &b.Parameter) + case "code": + err = unpopulate(val, "Code", &a.Code) delete(rawMsg, key) - case "scheme": - err = unpopulate(val, "Scheme", &b.Scheme) + case "message": + err = unpopulate(val, "Message", &a.Message) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackendBaseParameters. -func (b BackendBaseParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationLoginRequestContract. +func (a AuthorizationLoginRequestContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "credentials", b.Credentials) - populate(objectMap, "description", b.Description) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "proxy", b.Proxy) - populate(objectMap, "resourceId", b.ResourceID) - populate(objectMap, "tls", b.TLS) - populate(objectMap, "title", b.Title) + populate(objectMap, "postLoginRedirectUrl", a.PostLoginRedirectURL) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackendBaseParameters. -func (b *BackendBaseParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationLoginRequestContract. +func (a *AuthorizationLoginRequestContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "credentials": - err = unpopulate(val, "Credentials", &b.Credentials) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &b.Description) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &b.Properties) - delete(rawMsg, key) - case "proxy": - err = unpopulate(val, "Proxy", &b.Proxy) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &b.ResourceID) - delete(rawMsg, key) - case "tls": - err = unpopulate(val, "TLS", &b.TLS) - delete(rawMsg, key) - case "title": - err = unpopulate(val, "Title", &b.Title) + case "postLoginRedirectUrl": + err = unpopulate(val, "PostLoginRedirectURL", &a.PostLoginRedirectURL) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackendCollection. -func (b BackendCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationLoginResponseContract. +func (a AuthorizationLoginResponseContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", b.Count) - populate(objectMap, "nextLink", b.NextLink) - populate(objectMap, "value", b.Value) + populate(objectMap, "loginLink", a.LoginLink) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackendCollection. -func (b *BackendCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationLoginResponseContract. +func (a *AuthorizationLoginResponseContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &b.Count) - delete(rawMsg, key) - case "nextLink": - err = unpopulate(val, "NextLink", &b.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &b.Value) + case "loginLink": + err = unpopulate(val, "LoginLink", &a.LoginLink) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackendContract. -func (b BackendContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationProviderCollection. +func (a AuthorizationProviderCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", b.ID) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "type", b.Type) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackendContract. -func (b *BackendContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationProviderCollection. +func (a *AuthorizationProviderCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &b.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &b.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) + case "value": + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackendContractProperties. -func (b BackendContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationProviderContract. +func (a AuthorizationProviderContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "credentials", b.Credentials) - populate(objectMap, "description", b.Description) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "protocol", b.Protocol) - populate(objectMap, "proxy", b.Proxy) - populate(objectMap, "resourceId", b.ResourceID) - populate(objectMap, "tls", b.TLS) - populate(objectMap, "title", b.Title) - populate(objectMap, "url", b.URL) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackendContractProperties. -func (b *BackendContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationProviderContract. +func (a *AuthorizationProviderContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "credentials": - err = unpopulate(val, "Credentials", &b.Credentials) + case "id": + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &b.Description) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &b.Properties) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &b.Protocol) - delete(rawMsg, key) - case "proxy": - err = unpopulate(val, "Proxy", &b.Proxy) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &b.ResourceID) - delete(rawMsg, key) - case "tls": - err = unpopulate(val, "TLS", &b.TLS) - delete(rawMsg, key) - case "title": - err = unpopulate(val, "Title", &b.Title) + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) - case "url": - err = unpopulate(val, "URL", &b.URL) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackendCredentialsContract. -func (b BackendCredentialsContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationProviderContractProperties. +func (a AuthorizationProviderContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "authorization", b.Authorization) - populate(objectMap, "certificate", b.Certificate) - populate(objectMap, "certificateIds", b.CertificateIDs) - populate(objectMap, "header", b.Header) - populate(objectMap, "query", b.Query) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "identityProvider", a.IdentityProvider) + populate(objectMap, "oauth2", a.Oauth2) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackendCredentialsContract. -func (b *BackendCredentialsContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationProviderContractProperties. +func (a *AuthorizationProviderContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "authorization": - err = unpopulate(val, "Authorization", &b.Authorization) - delete(rawMsg, key) - case "certificate": - err = unpopulate(val, "Certificate", &b.Certificate) - delete(rawMsg, key) - case "certificateIds": - err = unpopulate(val, "CertificateIDs", &b.CertificateIDs) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) delete(rawMsg, key) - case "header": - err = unpopulate(val, "Header", &b.Header) + case "identityProvider": + err = unpopulate(val, "IdentityProvider", &a.IdentityProvider) delete(rawMsg, key) - case "query": - err = unpopulate(val, "Query", &b.Query) + case "oauth2": + err = unpopulate(val, "Oauth2", &a.Oauth2) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackendProperties. -func (b BackendProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationProviderOAuth2GrantTypes. +func (a AuthorizationProviderOAuth2GrantTypes) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "serviceFabricCluster", b.ServiceFabricCluster) + populate(objectMap, "authorizationCode", a.AuthorizationCode) + populate(objectMap, "clientCredentials", a.ClientCredentials) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackendProperties. -func (b *BackendProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationProviderOAuth2GrantTypes. +func (a *AuthorizationProviderOAuth2GrantTypes) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "serviceFabricCluster": - err = unpopulate(val, "ServiceFabricCluster", &b.ServiceFabricCluster) + case "authorizationCode": + err = unpopulate(val, "AuthorizationCode", &a.AuthorizationCode) + delete(rawMsg, key) + case "clientCredentials": + err = unpopulate(val, "ClientCredentials", &a.ClientCredentials) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackendProxyContract. -func (b BackendProxyContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationProviderOAuth2Settings. +func (a AuthorizationProviderOAuth2Settings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "password", b.Password) - populate(objectMap, "url", b.URL) - populate(objectMap, "username", b.Username) + populate(objectMap, "grantTypes", a.GrantTypes) + populate(objectMap, "redirectUrl", a.RedirectURL) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackendProxyContract. -func (b *BackendProxyContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationProviderOAuth2Settings. +func (a *AuthorizationProviderOAuth2Settings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "password": - err = unpopulate(val, "Password", &b.Password) - delete(rawMsg, key) - case "url": - err = unpopulate(val, "URL", &b.URL) + case "grantTypes": + err = unpopulate(val, "GrantTypes", &a.GrantTypes) delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &b.Username) + case "redirectUrl": + err = unpopulate(val, "RedirectURL", &a.RedirectURL) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackendReconnectContract. -func (b BackendReconnectContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerCollection. +func (a AuthorizationServerCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", b.ID) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "type", b.Type) + populate(objectMap, "count", a.Count) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackendReconnectContract. -func (b *BackendReconnectContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerCollection. +func (a *AuthorizationServerCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &b.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) + case "count": + err = unpopulate(val, "Count", &a.Count) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &b.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) + case "value": + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackendReconnectProperties. -func (b BackendReconnectProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerContract. +func (a AuthorizationServerContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "after", b.After) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackendReconnectProperties. -func (b *BackendReconnectProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerContract. +func (a *AuthorizationServerContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "after": - err = unpopulate(val, "After", &b.After) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackendServiceFabricClusterProperties. -func (b BackendServiceFabricClusterProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerContractBaseProperties. +func (a AuthorizationServerContractBaseProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientCertificateId", b.ClientCertificateID) - populate(objectMap, "clientCertificatethumbprint", b.ClientCertificatethumbprint) - populate(objectMap, "managementEndpoints", b.ManagementEndpoints) - populate(objectMap, "maxPartitionResolutionRetries", b.MaxPartitionResolutionRetries) - populate(objectMap, "serverCertificateThumbprints", b.ServerCertificateThumbprints) - populate(objectMap, "serverX509Names", b.ServerX509Names) + populate(objectMap, "authorizationMethods", a.AuthorizationMethods) + populate(objectMap, "bearerTokenSendingMethods", a.BearerTokenSendingMethods) + populate(objectMap, "clientAuthenticationMethod", a.ClientAuthenticationMethod) + populate(objectMap, "defaultScope", a.DefaultScope) + populate(objectMap, "description", a.Description) + populate(objectMap, "resourceOwnerPassword", a.ResourceOwnerPassword) + populate(objectMap, "resourceOwnerUsername", a.ResourceOwnerUsername) + populate(objectMap, "supportState", a.SupportState) + populate(objectMap, "tokenBodyParameters", a.TokenBodyParameters) + populate(objectMap, "tokenEndpoint", a.TokenEndpoint) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackendServiceFabricClusterProperties. -func (b *BackendServiceFabricClusterProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerContractBaseProperties. +func (a *AuthorizationServerContractBaseProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "clientCertificateId": - err = unpopulate(val, "ClientCertificateID", &b.ClientCertificateID) + case "authorizationMethods": + err = unpopulate(val, "AuthorizationMethods", &a.AuthorizationMethods) delete(rawMsg, key) - case "clientCertificatethumbprint": - err = unpopulate(val, "ClientCertificatethumbprint", &b.ClientCertificatethumbprint) + case "bearerTokenSendingMethods": + err = unpopulate(val, "BearerTokenSendingMethods", &a.BearerTokenSendingMethods) delete(rawMsg, key) - case "managementEndpoints": - err = unpopulate(val, "ManagementEndpoints", &b.ManagementEndpoints) + case "clientAuthenticationMethod": + err = unpopulate(val, "ClientAuthenticationMethod", &a.ClientAuthenticationMethod) delete(rawMsg, key) - case "maxPartitionResolutionRetries": - err = unpopulate(val, "MaxPartitionResolutionRetries", &b.MaxPartitionResolutionRetries) + case "defaultScope": + err = unpopulate(val, "DefaultScope", &a.DefaultScope) delete(rawMsg, key) - case "serverCertificateThumbprints": - err = unpopulate(val, "ServerCertificateThumbprints", &b.ServerCertificateThumbprints) + case "description": + err = unpopulate(val, "Description", &a.Description) delete(rawMsg, key) - case "serverX509Names": - err = unpopulate(val, "ServerX509Names", &b.ServerX509Names) + case "resourceOwnerPassword": + err = unpopulate(val, "ResourceOwnerPassword", &a.ResourceOwnerPassword) + delete(rawMsg, key) + case "resourceOwnerUsername": + err = unpopulate(val, "ResourceOwnerUsername", &a.ResourceOwnerUsername) + delete(rawMsg, key) + case "supportState": + err = unpopulate(val, "SupportState", &a.SupportState) + delete(rawMsg, key) + case "tokenBodyParameters": + err = unpopulate(val, "TokenBodyParameters", &a.TokenBodyParameters) + delete(rawMsg, key) + case "tokenEndpoint": + err = unpopulate(val, "TokenEndpoint", &a.TokenEndpoint) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackendTLSProperties. -func (b BackendTLSProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerContractProperties. +func (a AuthorizationServerContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "validateCertificateChain", b.ValidateCertificateChain) - populate(objectMap, "validateCertificateName", b.ValidateCertificateName) + populate(objectMap, "authorizationEndpoint", a.AuthorizationEndpoint) + populate(objectMap, "authorizationMethods", a.AuthorizationMethods) + populate(objectMap, "bearerTokenSendingMethods", a.BearerTokenSendingMethods) + populate(objectMap, "clientAuthenticationMethod", a.ClientAuthenticationMethod) + populate(objectMap, "clientId", a.ClientID) + populate(objectMap, "clientRegistrationEndpoint", a.ClientRegistrationEndpoint) + populate(objectMap, "clientSecret", a.ClientSecret) + populate(objectMap, "defaultScope", a.DefaultScope) + populate(objectMap, "description", a.Description) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "grantTypes", a.GrantTypes) + populate(objectMap, "resourceOwnerPassword", a.ResourceOwnerPassword) + populate(objectMap, "resourceOwnerUsername", a.ResourceOwnerUsername) + populate(objectMap, "supportState", a.SupportState) + populate(objectMap, "tokenBodyParameters", a.TokenBodyParameters) + populate(objectMap, "tokenEndpoint", a.TokenEndpoint) + populate(objectMap, "useInApiDocumentation", a.UseInAPIDocumentation) + populate(objectMap, "useInTestConsole", a.UseInTestConsole) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackendTLSProperties. -func (b *BackendTLSProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerContractProperties. +func (a *AuthorizationServerContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "validateCertificateChain": - err = unpopulate(val, "ValidateCertificateChain", &b.ValidateCertificateChain) + case "authorizationEndpoint": + err = unpopulate(val, "AuthorizationEndpoint", &a.AuthorizationEndpoint) delete(rawMsg, key) - case "validateCertificateName": - err = unpopulate(val, "ValidateCertificateName", &b.ValidateCertificateName) + case "authorizationMethods": + err = unpopulate(val, "AuthorizationMethods", &a.AuthorizationMethods) + delete(rawMsg, key) + case "bearerTokenSendingMethods": + err = unpopulate(val, "BearerTokenSendingMethods", &a.BearerTokenSendingMethods) + delete(rawMsg, key) + case "clientAuthenticationMethod": + err = unpopulate(val, "ClientAuthenticationMethod", &a.ClientAuthenticationMethod) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &a.ClientID) + delete(rawMsg, key) + case "clientRegistrationEndpoint": + err = unpopulate(val, "ClientRegistrationEndpoint", &a.ClientRegistrationEndpoint) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &a.ClientSecret) + delete(rawMsg, key) + case "defaultScope": + err = unpopulate(val, "DefaultScope", &a.DefaultScope) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "grantTypes": + err = unpopulate(val, "GrantTypes", &a.GrantTypes) + delete(rawMsg, key) + case "resourceOwnerPassword": + err = unpopulate(val, "ResourceOwnerPassword", &a.ResourceOwnerPassword) + delete(rawMsg, key) + case "resourceOwnerUsername": + err = unpopulate(val, "ResourceOwnerUsername", &a.ResourceOwnerUsername) + delete(rawMsg, key) + case "supportState": + err = unpopulate(val, "SupportState", &a.SupportState) + delete(rawMsg, key) + case "tokenBodyParameters": + err = unpopulate(val, "TokenBodyParameters", &a.TokenBodyParameters) + delete(rawMsg, key) + case "tokenEndpoint": + err = unpopulate(val, "TokenEndpoint", &a.TokenEndpoint) + delete(rawMsg, key) + case "useInApiDocumentation": + err = unpopulate(val, "UseInAPIDocumentation", &a.UseInAPIDocumentation) + delete(rawMsg, key) + case "useInTestConsole": + err = unpopulate(val, "UseInTestConsole", &a.UseInTestConsole) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackendUpdateParameterProperties. -func (b BackendUpdateParameterProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerSecretsContract. +func (a AuthorizationServerSecretsContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "credentials", b.Credentials) - populate(objectMap, "description", b.Description) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "protocol", b.Protocol) - populate(objectMap, "proxy", b.Proxy) - populate(objectMap, "resourceId", b.ResourceID) - populate(objectMap, "tls", b.TLS) - populate(objectMap, "title", b.Title) - populate(objectMap, "url", b.URL) + populate(objectMap, "clientSecret", a.ClientSecret) + populate(objectMap, "resourceOwnerPassword", a.ResourceOwnerPassword) + populate(objectMap, "resourceOwnerUsername", a.ResourceOwnerUsername) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackendUpdateParameterProperties. -func (b *BackendUpdateParameterProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerSecretsContract. +func (a *AuthorizationServerSecretsContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "credentials": - err = unpopulate(val, "Credentials", &b.Credentials) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &a.ClientSecret) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &b.Description) + case "resourceOwnerPassword": + err = unpopulate(val, "ResourceOwnerPassword", &a.ResourceOwnerPassword) + delete(rawMsg, key) + case "resourceOwnerUsername": + err = unpopulate(val, "ResourceOwnerUsername", &a.ResourceOwnerUsername) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerUpdateContract. +func (a AuthorizationServerUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerUpdateContract. +func (a *AuthorizationServerUpdateContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &b.Properties) + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerUpdateContractProperties. +func (a AuthorizationServerUpdateContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorizationEndpoint", a.AuthorizationEndpoint) + populate(objectMap, "authorizationMethods", a.AuthorizationMethods) + populate(objectMap, "bearerTokenSendingMethods", a.BearerTokenSendingMethods) + populate(objectMap, "clientAuthenticationMethod", a.ClientAuthenticationMethod) + populate(objectMap, "clientId", a.ClientID) + populate(objectMap, "clientRegistrationEndpoint", a.ClientRegistrationEndpoint) + populate(objectMap, "clientSecret", a.ClientSecret) + populate(objectMap, "defaultScope", a.DefaultScope) + populate(objectMap, "description", a.Description) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "grantTypes", a.GrantTypes) + populate(objectMap, "resourceOwnerPassword", a.ResourceOwnerPassword) + populate(objectMap, "resourceOwnerUsername", a.ResourceOwnerUsername) + populate(objectMap, "supportState", a.SupportState) + populate(objectMap, "tokenBodyParameters", a.TokenBodyParameters) + populate(objectMap, "tokenEndpoint", a.TokenEndpoint) + populate(objectMap, "useInApiDocumentation", a.UseInAPIDocumentation) + populate(objectMap, "useInTestConsole", a.UseInTestConsole) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerUpdateContractProperties. +func (a *AuthorizationServerUpdateContractProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authorizationEndpoint": + err = unpopulate(val, "AuthorizationEndpoint", &a.AuthorizationEndpoint) + delete(rawMsg, key) + case "authorizationMethods": + err = unpopulate(val, "AuthorizationMethods", &a.AuthorizationMethods) + delete(rawMsg, key) + case "bearerTokenSendingMethods": + err = unpopulate(val, "BearerTokenSendingMethods", &a.BearerTokenSendingMethods) + delete(rawMsg, key) + case "clientAuthenticationMethod": + err = unpopulate(val, "ClientAuthenticationMethod", &a.ClientAuthenticationMethod) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &a.ClientID) + delete(rawMsg, key) + case "clientRegistrationEndpoint": + err = unpopulate(val, "ClientRegistrationEndpoint", &a.ClientRegistrationEndpoint) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &a.ClientSecret) + delete(rawMsg, key) + case "defaultScope": + err = unpopulate(val, "DefaultScope", &a.DefaultScope) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "grantTypes": + err = unpopulate(val, "GrantTypes", &a.GrantTypes) + delete(rawMsg, key) + case "resourceOwnerPassword": + err = unpopulate(val, "ResourceOwnerPassword", &a.ResourceOwnerPassword) + delete(rawMsg, key) + case "resourceOwnerUsername": + err = unpopulate(val, "ResourceOwnerUsername", &a.ResourceOwnerUsername) + delete(rawMsg, key) + case "supportState": + err = unpopulate(val, "SupportState", &a.SupportState) + delete(rawMsg, key) + case "tokenBodyParameters": + err = unpopulate(val, "TokenBodyParameters", &a.TokenBodyParameters) + delete(rawMsg, key) + case "tokenEndpoint": + err = unpopulate(val, "TokenEndpoint", &a.TokenEndpoint) + delete(rawMsg, key) + case "useInApiDocumentation": + err = unpopulate(val, "UseInAPIDocumentation", &a.UseInAPIDocumentation) + delete(rawMsg, key) + case "useInTestConsole": + err = unpopulate(val, "UseInTestConsole", &a.UseInTestConsole) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackendAuthorizationHeaderCredentials. +func (b BackendAuthorizationHeaderCredentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "parameter", b.Parameter) + populate(objectMap, "scheme", b.Scheme) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendAuthorizationHeaderCredentials. +func (b *BackendAuthorizationHeaderCredentials) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "parameter": + err = unpopulate(val, "Parameter", &b.Parameter) + delete(rawMsg, key) + case "scheme": + err = unpopulate(val, "Scheme", &b.Scheme) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackendBaseParameters. +func (b BackendBaseParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "credentials", b.Credentials) + populate(objectMap, "description", b.Description) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "proxy", b.Proxy) + populate(objectMap, "resourceId", b.ResourceID) + populate(objectMap, "tls", b.TLS) + populate(objectMap, "title", b.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendBaseParameters. +func (b *BackendBaseParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "credentials": + err = unpopulate(val, "Credentials", &b.Credentials) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &b.Description) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "proxy": + err = unpopulate(val, "Proxy", &b.Proxy) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &b.ResourceID) + delete(rawMsg, key) + case "tls": + err = unpopulate(val, "TLS", &b.TLS) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &b.Title) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackendCollection. +func (b BackendCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", b.Count) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendCollection. +func (b *BackendCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &b.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &b.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackendContract. +func (b BackendContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendContract. +func (b *BackendContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackendContractProperties. +func (b BackendContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "credentials", b.Credentials) + populate(objectMap, "description", b.Description) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "protocol", b.Protocol) + populate(objectMap, "proxy", b.Proxy) + populate(objectMap, "resourceId", b.ResourceID) + populate(objectMap, "tls", b.TLS) + populate(objectMap, "title", b.Title) + populate(objectMap, "url", b.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendContractProperties. +func (b *BackendContractProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "credentials": + err = unpopulate(val, "Credentials", &b.Credentials) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &b.Description) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &b.Protocol) + delete(rawMsg, key) + case "proxy": + err = unpopulate(val, "Proxy", &b.Proxy) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &b.ResourceID) + delete(rawMsg, key) + case "tls": + err = unpopulate(val, "TLS", &b.TLS) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &b.Title) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &b.URL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackendCredentialsContract. +func (b BackendCredentialsContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorization", b.Authorization) + populate(objectMap, "certificate", b.Certificate) + populate(objectMap, "certificateIds", b.CertificateIDs) + populate(objectMap, "header", b.Header) + populate(objectMap, "query", b.Query) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendCredentialsContract. +func (b *BackendCredentialsContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authorization": + err = unpopulate(val, "Authorization", &b.Authorization) + delete(rawMsg, key) + case "certificate": + err = unpopulate(val, "Certificate", &b.Certificate) + delete(rawMsg, key) + case "certificateIds": + err = unpopulate(val, "CertificateIDs", &b.CertificateIDs) + delete(rawMsg, key) + case "header": + err = unpopulate(val, "Header", &b.Header) + delete(rawMsg, key) + case "query": + err = unpopulate(val, "Query", &b.Query) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackendProperties. +func (b BackendProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceFabricCluster", b.ServiceFabricCluster) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendProperties. +func (b *BackendProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceFabricCluster": + err = unpopulate(val, "ServiceFabricCluster", &b.ServiceFabricCluster) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackendProxyContract. +func (b BackendProxyContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "password", b.Password) + populate(objectMap, "url", b.URL) + populate(objectMap, "username", b.Username) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendProxyContract. +func (b *BackendProxyContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "password": + err = unpopulate(val, "Password", &b.Password) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &b.URL) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &b.Username) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackendReconnectContract. +func (b BackendReconnectContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendReconnectContract. +func (b *BackendReconnectContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackendReconnectProperties. +func (b BackendReconnectProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "after", b.After) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendReconnectProperties. +func (b *BackendReconnectProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "after": + err = unpopulate(val, "After", &b.After) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackendServiceFabricClusterProperties. +func (b BackendServiceFabricClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientCertificateId", b.ClientCertificateID) + populate(objectMap, "clientCertificatethumbprint", b.ClientCertificatethumbprint) + populate(objectMap, "managementEndpoints", b.ManagementEndpoints) + populate(objectMap, "maxPartitionResolutionRetries", b.MaxPartitionResolutionRetries) + populate(objectMap, "serverCertificateThumbprints", b.ServerCertificateThumbprints) + populate(objectMap, "serverX509Names", b.ServerX509Names) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendServiceFabricClusterProperties. +func (b *BackendServiceFabricClusterProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientCertificateId": + err = unpopulate(val, "ClientCertificateID", &b.ClientCertificateID) + delete(rawMsg, key) + case "clientCertificatethumbprint": + err = unpopulate(val, "ClientCertificatethumbprint", &b.ClientCertificatethumbprint) + delete(rawMsg, key) + case "managementEndpoints": + err = unpopulate(val, "ManagementEndpoints", &b.ManagementEndpoints) + delete(rawMsg, key) + case "maxPartitionResolutionRetries": + err = unpopulate(val, "MaxPartitionResolutionRetries", &b.MaxPartitionResolutionRetries) + delete(rawMsg, key) + case "serverCertificateThumbprints": + err = unpopulate(val, "ServerCertificateThumbprints", &b.ServerCertificateThumbprints) + delete(rawMsg, key) + case "serverX509Names": + err = unpopulate(val, "ServerX509Names", &b.ServerX509Names) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackendTLSProperties. +func (b BackendTLSProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "validateCertificateChain", b.ValidateCertificateChain) + populate(objectMap, "validateCertificateName", b.ValidateCertificateName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendTLSProperties. +func (b *BackendTLSProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "validateCertificateChain": + err = unpopulate(val, "ValidateCertificateChain", &b.ValidateCertificateChain) + delete(rawMsg, key) + case "validateCertificateName": + err = unpopulate(val, "ValidateCertificateName", &b.ValidateCertificateName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackendUpdateParameterProperties. +func (b BackendUpdateParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "credentials", b.Credentials) + populate(objectMap, "description", b.Description) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "protocol", b.Protocol) + populate(objectMap, "proxy", b.Proxy) + populate(objectMap, "resourceId", b.ResourceID) + populate(objectMap, "tls", b.TLS) + populate(objectMap, "title", b.Title) + populate(objectMap, "url", b.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendUpdateParameterProperties. +func (b *BackendUpdateParameterProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "credentials": + err = unpopulate(val, "Credentials", &b.Credentials) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &b.Description) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &b.Protocol) + delete(rawMsg, key) + case "proxy": + err = unpopulate(val, "Proxy", &b.Proxy) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &b.ResourceID) + delete(rawMsg, key) + case "tls": + err = unpopulate(val, "TLS", &b.TLS) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &b.Title) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &b.URL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackendUpdateParameters. +func (b BackendUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", b.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendUpdateParameters. +func (b *BackendUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BodyDiagnosticSettings. +func (b BodyDiagnosticSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bytes", b.Bytes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BodyDiagnosticSettings. +func (b *BodyDiagnosticSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bytes": + err = unpopulate(val, "Bytes", &b.Bytes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CacheCollection. +func (c CacheCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", c.Count) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheCollection. +func (c *CacheCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &c.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CacheContract. +func (c CacheContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheContract. +func (c *CacheContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CacheContractProperties. +func (c CacheContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionString", c.ConnectionString) + populate(objectMap, "description", c.Description) + populate(objectMap, "resourceId", c.ResourceID) + populate(objectMap, "useFromLocation", c.UseFromLocation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheContractProperties. +func (c *CacheContractProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "connectionString": + err = unpopulate(val, "ConnectionString", &c.ConnectionString) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) + delete(rawMsg, key) + case "useFromLocation": + err = unpopulate(val, "UseFromLocation", &c.UseFromLocation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CacheUpdateParameters. +func (c CacheUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheUpdateParameters. +func (c *CacheUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CacheUpdateProperties. +func (c CacheUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionString", c.ConnectionString) + populate(objectMap, "description", c.Description) + populate(objectMap, "resourceId", c.ResourceID) + populate(objectMap, "useFromLocation", c.UseFromLocation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheUpdateProperties. +func (c *CacheUpdateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "connectionString": + err = unpopulate(val, "ConnectionString", &c.ConnectionString) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) + delete(rawMsg, key) + case "useFromLocation": + err = unpopulate(val, "UseFromLocation", &c.UseFromLocation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateCollection. +func (c CertificateCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", c.Count) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateCollection. +func (c *CertificateCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &c.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateConfiguration. +func (c CertificateConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certificate", c.Certificate) + populate(objectMap, "certificatePassword", c.CertificatePassword) + populate(objectMap, "encodedCertificate", c.EncodedCertificate) + populate(objectMap, "storeName", c.StoreName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateConfiguration. +func (c *CertificateConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificate": + err = unpopulate(val, "Certificate", &c.Certificate) + delete(rawMsg, key) + case "certificatePassword": + err = unpopulate(val, "CertificatePassword", &c.CertificatePassword) + delete(rawMsg, key) + case "encodedCertificate": + err = unpopulate(val, "EncodedCertificate", &c.EncodedCertificate) + delete(rawMsg, key) + case "storeName": + err = unpopulate(val, "StoreName", &c.StoreName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateContract. +func (c CertificateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateContract. +func (c *CertificateContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateContractProperties. +func (c CertificateContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "expirationDate", c.ExpirationDate) + populate(objectMap, "keyVault", c.KeyVault) + populate(objectMap, "subject", c.Subject) + populate(objectMap, "thumbprint", c.Thumbprint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateContractProperties. +func (c *CertificateContractProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expirationDate": + err = unpopulateTimeRFC3339(val, "ExpirationDate", &c.ExpirationDate) + delete(rawMsg, key) + case "keyVault": + err = unpopulate(val, "KeyVault", &c.KeyVault) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &c.Subject) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &c.Thumbprint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateCreateOrUpdateParameters. +func (c CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateCreateOrUpdateParameters. +func (c *CertificateCreateOrUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateCreateOrUpdateProperties. +func (c CertificateCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "data", c.Data) + populate(objectMap, "keyVault", c.KeyVault) + populate(objectMap, "password", c.Password) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateCreateOrUpdateProperties. +func (c *CertificateCreateOrUpdateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "data": + err = unpopulate(val, "Data", &c.Data) + delete(rawMsg, key) + case "keyVault": + err = unpopulate(val, "KeyVault", &c.KeyVault) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &c.Password) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateInformation. +func (c CertificateInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "expiry", c.Expiry) + populate(objectMap, "subject", c.Subject) + populate(objectMap, "thumbprint", c.Thumbprint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateInformation. +func (c *CertificateInformation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expiry": + err = unpopulateTimeRFC3339(val, "Expiry", &c.Expiry) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &c.Subject) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &c.Thumbprint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClientSecretContract. +func (c ClientSecretContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientSecret", c.ClientSecret) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientSecretContract. +func (c *ClientSecretContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientSecret": + err = unpopulate(val, "ClientSecret", &c.ClientSecret) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequest. +func (c ConnectivityCheckRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destination", c.Destination) + populate(objectMap, "preferredIPVersion", c.PreferredIPVersion) + populate(objectMap, "protocol", c.Protocol) + populate(objectMap, "protocolConfiguration", c.ProtocolConfiguration) + populate(objectMap, "source", c.Source) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequest. +func (c *ConnectivityCheckRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "destination": + err = unpopulate(val, "Destination", &c.Destination) + delete(rawMsg, key) + case "preferredIPVersion": + err = unpopulate(val, "PreferredIPVersion", &c.PreferredIPVersion) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &c.Protocol) + delete(rawMsg, key) + case "protocolConfiguration": + err = unpopulate(val, "ProtocolConfiguration", &c.ProtocolConfiguration) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &c.Source) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequestDestination. +func (c ConnectivityCheckRequestDestination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address", c.Address) + populate(objectMap, "port", c.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequestDestination. +func (c *ConnectivityCheckRequestDestination) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "address": + err = unpopulate(val, "Address", &c.Address) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &c.Port) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequestProtocolConfiguration. +func (c ConnectivityCheckRequestProtocolConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "HTTPConfiguration", c.HTTPConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequestProtocolConfiguration. +func (c *ConnectivityCheckRequestProtocolConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "HTTPConfiguration": + err = unpopulate(val, "HTTPConfiguration", &c.HTTPConfiguration) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration. +func (c ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "headers", c.Headers) + populate(objectMap, "method", c.Method) + populate(objectMap, "validStatusCodes", c.ValidStatusCodes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration. +func (c *ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "headers": + err = unpopulate(val, "Headers", &c.Headers) + delete(rawMsg, key) + case "method": + err = unpopulate(val, "Method", &c.Method) + delete(rawMsg, key) + case "validStatusCodes": + err = unpopulate(val, "ValidStatusCodes", &c.ValidStatusCodes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequestSource. +func (c ConnectivityCheckRequestSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "instance", c.Instance) + populate(objectMap, "region", c.Region) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequestSource. +func (c *ConnectivityCheckRequestSource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "instance": + err = unpopulate(val, "Instance", &c.Instance) + delete(rawMsg, key) + case "region": + err = unpopulate(val, "Region", &c.Region) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckResponse. +func (c ConnectivityCheckResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "avgLatencyInMs", c.AvgLatencyInMs) + populate(objectMap, "connectionStatus", c.ConnectionStatus) + populate(objectMap, "hops", c.Hops) + populate(objectMap, "maxLatencyInMs", c.MaxLatencyInMs) + populate(objectMap, "minLatencyInMs", c.MinLatencyInMs) + populate(objectMap, "probesFailed", c.ProbesFailed) + populate(objectMap, "probesSent", c.ProbesSent) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckResponse. +func (c *ConnectivityCheckResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "avgLatencyInMs": + err = unpopulate(val, "AvgLatencyInMs", &c.AvgLatencyInMs) + delete(rawMsg, key) + case "connectionStatus": + err = unpopulate(val, "ConnectionStatus", &c.ConnectionStatus) + delete(rawMsg, key) + case "hops": + err = unpopulate(val, "Hops", &c.Hops) + delete(rawMsg, key) + case "maxLatencyInMs": + err = unpopulate(val, "MaxLatencyInMs", &c.MaxLatencyInMs) + delete(rawMsg, key) + case "minLatencyInMs": + err = unpopulate(val, "MinLatencyInMs", &c.MinLatencyInMs) + delete(rawMsg, key) + case "probesFailed": + err = unpopulate(val, "ProbesFailed", &c.ProbesFailed) + delete(rawMsg, key) + case "probesSent": + err = unpopulate(val, "ProbesSent", &c.ProbesSent) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityHop. +func (c ConnectivityHop) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address", c.Address) + populate(objectMap, "id", c.ID) + populate(objectMap, "issues", c.Issues) + populate(objectMap, "nextHopIds", c.NextHopIDs) + populate(objectMap, "resourceId", c.ResourceID) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityHop. +func (c *ConnectivityHop) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "address": + err = unpopulate(val, "Address", &c.Address) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "issues": + err = unpopulate(val, "Issues", &c.Issues) + delete(rawMsg, key) + case "nextHopIds": + err = unpopulate(val, "NextHopIDs", &c.NextHopIDs) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityIssue. +func (c ConnectivityIssue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "context", c.Context) + populate(objectMap, "origin", c.Origin) + populate(objectMap, "severity", c.Severity) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityIssue. +func (c *ConnectivityIssue) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "context": + err = unpopulate(val, "Context", &c.Context) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &c.Origin) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &c.Severity) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityStatusContract. +func (c ConnectivityStatusContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", c.Error) + populate(objectMap, "isOptional", c.IsOptional) + populateTimeRFC3339(objectMap, "lastStatusChange", c.LastStatusChange) + populateTimeRFC3339(objectMap, "lastUpdated", c.LastUpdated) + populate(objectMap, "name", c.Name) + populate(objectMap, "resourceType", c.ResourceType) + populate(objectMap, "status", c.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityStatusContract. +func (c *ConnectivityStatusContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &c.Error) delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &b.Protocol) + case "isOptional": + err = unpopulate(val, "IsOptional", &c.IsOptional) delete(rawMsg, key) - case "proxy": - err = unpopulate(val, "Proxy", &b.Proxy) + case "lastStatusChange": + err = unpopulateTimeRFC3339(val, "LastStatusChange", &c.LastStatusChange) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &b.ResourceID) + case "lastUpdated": + err = unpopulateTimeRFC3339(val, "LastUpdated", &c.LastUpdated) delete(rawMsg, key) - case "tls": - err = unpopulate(val, "TLS", &b.TLS) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "title": - err = unpopulate(val, "Title", &b.Title) + case "resourceType": + err = unpopulate(val, "ResourceType", &c.ResourceType) delete(rawMsg, key) - case "url": - err = unpopulate(val, "URL", &b.URL) + case "status": + err = unpopulate(val, "Status", &c.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BackendUpdateParameters. -func (b BackendUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContentItemCollection. +func (c ContentItemCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", b.Properties) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackendUpdateParameters. -func (b *BackendUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContentItemCollection. +func (c *ContentItemCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &b.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BodyDiagnosticSettings. -func (b BodyDiagnosticSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContentItemContract. +func (c ContentItemContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "bytes", b.Bytes) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BodyDiagnosticSettings. -func (b *BodyDiagnosticSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContentItemContract. +func (c *ContentItemContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "bytes": - err = unpopulate(val, "Bytes", &b.Bytes) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CacheCollection. -func (c CacheCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContentTypeCollection. +func (c ContentTypeCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", c.Count) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CacheCollection. -func (c *CacheCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContentTypeCollection. +func (c *ContentTypeCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2834,9 +4249,6 @@ func (c *CacheCollection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &c.Count) - delete(rawMsg, key) case "nextLink": err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) @@ -2851,8 +4263,8 @@ func (c *CacheCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CacheContract. -func (c CacheContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContentTypeContract. +func (c ContentTypeContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) @@ -2861,8 +4273,8 @@ func (c CacheContract) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CacheContract. -func (c *CacheContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContentTypeContract. +func (c *ContentTypeContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2890,18 +4302,19 @@ func (c *CacheContract) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CacheContractProperties. -func (c CacheContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContentTypeContractProperties. +func (c ContentTypeContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "connectionString", c.ConnectionString) populate(objectMap, "description", c.Description) - populate(objectMap, "resourceId", c.ResourceID) - populate(objectMap, "useFromLocation", c.UseFromLocation) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populateAny(objectMap, "schema", c.Schema) + populate(objectMap, "version", c.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CacheContractProperties. -func (c *CacheContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContentTypeContractProperties. +func (c *ContentTypeContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -2909,17 +4322,20 @@ func (c *CacheContractProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "connectionString": - err = unpopulate(val, "ConnectionString", &c.ConnectionString) - delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &c.Description) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &c.ResourceID) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "useFromLocation": - err = unpopulate(val, "UseFromLocation", &c.UseFromLocation) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "schema": + err = unpopulate(val, "Schema", &c.Schema) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &c.Version) delete(rawMsg, key) } if err != nil { @@ -2929,1643 +4345,1616 @@ func (c *CacheContractProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CacheUpdateParameters. -func (c CacheUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataMasking. +func (d DataMasking) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) + populate(objectMap, "headers", d.Headers) + populate(objectMap, "queryParams", d.QueryParams) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CacheUpdateParameters. -func (c *CacheUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataMasking. +func (d *DataMasking) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "headers": + err = unpopulate(val, "Headers", &d.Headers) + delete(rawMsg, key) + case "queryParams": + err = unpopulate(val, "QueryParams", &d.QueryParams) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CacheUpdateProperties. -func (c CacheUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataMaskingEntity. +func (d DataMaskingEntity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "connectionString", c.ConnectionString) - populate(objectMap, "description", c.Description) - populate(objectMap, "resourceId", c.ResourceID) - populate(objectMap, "useFromLocation", c.UseFromLocation) + populate(objectMap, "mode", d.Mode) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CacheUpdateProperties. -func (c *CacheUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataMaskingEntity. +func (d *DataMaskingEntity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "connectionString": - err = unpopulate(val, "ConnectionString", &c.ConnectionString) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &c.Description) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &c.ResourceID) + case "mode": + err = unpopulate(val, "Mode", &d.Mode) delete(rawMsg, key) - case "useFromLocation": - err = unpopulate(val, "UseFromLocation", &c.UseFromLocation) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CertificateCollection. -func (c CertificateCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeletedServiceContract. +func (d DeletedServiceContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", c.Count) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "id", d.ID) + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateCollection. -func (c *CertificateCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServiceContract. +func (d *DeletedServiceContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &c.Count) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "location": + err = unpopulate(val, "Location", &d.Location) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CertificateConfiguration. -func (c CertificateConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeletedServiceContractProperties. +func (d DeletedServiceContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "certificate", c.Certificate) - populate(objectMap, "certificatePassword", c.CertificatePassword) - populate(objectMap, "encodedCertificate", c.EncodedCertificate) - populate(objectMap, "storeName", c.StoreName) + populateTimeRFC3339(objectMap, "deletionDate", d.DeletionDate) + populateTimeRFC3339(objectMap, "scheduledPurgeDate", d.ScheduledPurgeDate) + populate(objectMap, "serviceId", d.ServiceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateConfiguration. -func (c *CertificateConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServiceContractProperties. +func (d *DeletedServiceContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "certificate": - err = unpopulate(val, "Certificate", &c.Certificate) - delete(rawMsg, key) - case "certificatePassword": - err = unpopulate(val, "CertificatePassword", &c.CertificatePassword) - delete(rawMsg, key) - case "encodedCertificate": - err = unpopulate(val, "EncodedCertificate", &c.EncodedCertificate) + case "deletionDate": + err = unpopulateTimeRFC3339(val, "DeletionDate", &d.DeletionDate) delete(rawMsg, key) - case "storeName": - err = unpopulate(val, "StoreName", &c.StoreName) + case "scheduledPurgeDate": + err = unpopulateTimeRFC3339(val, "ScheduledPurgeDate", &d.ScheduledPurgeDate) + delete(rawMsg, key) + case "serviceId": + err = unpopulate(val, "ServiceID", &d.ServiceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CertificateContract. -func (c CertificateContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeletedServicesCollection. +func (d DeletedServicesCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "type", c.Type) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateContract. -func (c *CertificateContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServicesCollection. +func (d *DeletedServicesCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CertificateContractProperties. -func (c CertificateContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeployConfigurationParameterProperties. +func (d DeployConfigurationParameterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "expirationDate", c.ExpirationDate) - populate(objectMap, "keyVault", c.KeyVault) - populate(objectMap, "subject", c.Subject) - populate(objectMap, "thumbprint", c.Thumbprint) + populate(objectMap, "branch", d.Branch) + populate(objectMap, "force", d.Force) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateContractProperties. -func (c *CertificateContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DeployConfigurationParameterProperties. +func (d *DeployConfigurationParameterProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "expirationDate": - err = unpopulateTimeRFC3339(val, "ExpirationDate", &c.ExpirationDate) - delete(rawMsg, key) - case "keyVault": - err = unpopulate(val, "KeyVault", &c.KeyVault) - delete(rawMsg, key) - case "subject": - err = unpopulate(val, "Subject", &c.Subject) + case "branch": + err = unpopulate(val, "Branch", &d.Branch) delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &c.Thumbprint) + case "force": + err = unpopulate(val, "Force", &d.Force) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CertificateCreateOrUpdateParameters. -func (c CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DeployConfigurationParameters. +func (d DeployConfigurationParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) + populate(objectMap, "properties", d.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateCreateOrUpdateParameters. -func (c *CertificateCreateOrUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DeployConfigurationParameters. +func (d *DeployConfigurationParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "properties": - err = unpopulate(val, "Properties", &c.Properties) + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CertificateCreateOrUpdateProperties. -func (c CertificateCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnosticCollection. +func (d DiagnosticCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "data", c.Data) - populate(objectMap, "keyVault", c.KeyVault) - populate(objectMap, "password", c.Password) + populate(objectMap, "count", d.Count) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateCreateOrUpdateProperties. -func (c *CertificateCreateOrUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticCollection. +func (d *DiagnosticCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "data": - err = unpopulate(val, "Data", &c.Data) + case "count": + err = unpopulate(val, "Count", &d.Count) delete(rawMsg, key) - case "keyVault": - err = unpopulate(val, "KeyVault", &c.KeyVault) + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &c.Password) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CertificateInformation. -func (c CertificateInformation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnosticContract. +func (d DiagnosticContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "expiry", c.Expiry) - populate(objectMap, "subject", c.Subject) - populate(objectMap, "thumbprint", c.Thumbprint) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateInformation. -func (c *CertificateInformation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticContract. +func (d *DiagnosticContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "expiry": - err = unpopulateTimeRFC3339(val, "Expiry", &c.Expiry) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "subject": - err = unpopulate(val, "Subject", &c.Subject) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &c.Thumbprint) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ClientSecretContract. -func (c ClientSecretContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnosticContractProperties. +func (d DiagnosticContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientSecret", c.ClientSecret) + populate(objectMap, "alwaysLog", d.AlwaysLog) + populate(objectMap, "backend", d.Backend) + populate(objectMap, "frontend", d.Frontend) + populate(objectMap, "httpCorrelationProtocol", d.HTTPCorrelationProtocol) + populate(objectMap, "logClientIp", d.LogClientIP) + populate(objectMap, "loggerId", d.LoggerID) + populate(objectMap, "metrics", d.Metrics) + populate(objectMap, "operationNameFormat", d.OperationNameFormat) + populate(objectMap, "sampling", d.Sampling) + populate(objectMap, "verbosity", d.Verbosity) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClientSecretContract. -func (c *ClientSecretContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticContractProperties. +func (d *DiagnosticContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "clientSecret": - err = unpopulate(val, "ClientSecret", &c.ClientSecret) + case "alwaysLog": + err = unpopulate(val, "AlwaysLog", &d.AlwaysLog) + delete(rawMsg, key) + case "backend": + err = unpopulate(val, "Backend", &d.Backend) + delete(rawMsg, key) + case "frontend": + err = unpopulate(val, "Frontend", &d.Frontend) + delete(rawMsg, key) + case "httpCorrelationProtocol": + err = unpopulate(val, "HTTPCorrelationProtocol", &d.HTTPCorrelationProtocol) + delete(rawMsg, key) + case "logClientIp": + err = unpopulate(val, "LogClientIP", &d.LogClientIP) + delete(rawMsg, key) + case "loggerId": + err = unpopulate(val, "LoggerID", &d.LoggerID) + delete(rawMsg, key) + case "metrics": + err = unpopulate(val, "Metrics", &d.Metrics) + delete(rawMsg, key) + case "operationNameFormat": + err = unpopulate(val, "OperationNameFormat", &d.OperationNameFormat) + delete(rawMsg, key) + case "sampling": + err = unpopulate(val, "Sampling", &d.Sampling) + delete(rawMsg, key) + case "verbosity": + err = unpopulate(val, "Verbosity", &d.Verbosity) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequest. -func (c ConnectivityCheckRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DocumentationCollection. +func (d DocumentationCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "destination", c.Destination) - populate(objectMap, "preferredIPVersion", c.PreferredIPVersion) - populate(objectMap, "protocol", c.Protocol) - populate(objectMap, "protocolConfiguration", c.ProtocolConfiguration) - populate(objectMap, "source", c.Source) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequest. -func (c *ConnectivityCheckRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DocumentationCollection. +func (d *DocumentationCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "destination": - err = unpopulate(val, "Destination", &c.Destination) - delete(rawMsg, key) - case "preferredIPVersion": - err = unpopulate(val, "PreferredIPVersion", &c.PreferredIPVersion) - delete(rawMsg, key) - case "protocol": - err = unpopulate(val, "Protocol", &c.Protocol) - delete(rawMsg, key) - case "protocolConfiguration": - err = unpopulate(val, "ProtocolConfiguration", &c.ProtocolConfiguration) + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &c.Source) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequestDestination. -func (c ConnectivityCheckRequestDestination) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DocumentationContract. +func (d DocumentationContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "address", c.Address) - populate(objectMap, "port", c.Port) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequestDestination. -func (c *ConnectivityCheckRequestDestination) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DocumentationContract. +func (d *DocumentationContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "address": - err = unpopulate(val, "Address", &c.Address) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &c.Port) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequestProtocolConfiguration. -func (c ConnectivityCheckRequestProtocolConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DocumentationContractProperties. +func (d DocumentationContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "HTTPConfiguration", c.HTTPConfiguration) + populate(objectMap, "content", d.Content) + populate(objectMap, "title", d.Title) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequestProtocolConfiguration. -func (c *ConnectivityCheckRequestProtocolConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DocumentationContractProperties. +func (d *DocumentationContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "HTTPConfiguration": - err = unpopulate(val, "HTTPConfiguration", &c.HTTPConfiguration) + case "content": + err = unpopulate(val, "Content", &d.Content) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &d.Title) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration. -func (c ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DocumentationUpdateContract. +func (d DocumentationUpdateContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "headers", c.Headers) - populate(objectMap, "method", c.Method) - populate(objectMap, "validStatusCodes", c.ValidStatusCodes) + populate(objectMap, "properties", d.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration. -func (c *ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DocumentationUpdateContract. +func (d *DocumentationUpdateContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "headers": - err = unpopulate(val, "Headers", &c.Headers) - delete(rawMsg, key) - case "method": - err = unpopulate(val, "Method", &c.Method) - delete(rawMsg, key) - case "validStatusCodes": - err = unpopulate(val, "ValidStatusCodes", &c.ValidStatusCodes) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequestSource. -func (c ConnectivityCheckRequestSource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EmailTemplateCollection. +func (e EmailTemplateCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "instance", c.Instance) - populate(objectMap, "region", c.Region) + populate(objectMap, "count", e.Count) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequestSource. -func (c *ConnectivityCheckRequestSource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateCollection. +func (e *EmailTemplateCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "instance": - err = unpopulate(val, "Instance", &c.Instance) + case "count": + err = unpopulate(val, "Count", &e.Count) delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &c.Region) + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckResponse. -func (c ConnectivityCheckResponse) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EmailTemplateContract. +func (e EmailTemplateContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "avgLatencyInMs", c.AvgLatencyInMs) - populate(objectMap, "connectionStatus", c.ConnectionStatus) - populate(objectMap, "hops", c.Hops) - populate(objectMap, "maxLatencyInMs", c.MaxLatencyInMs) - populate(objectMap, "minLatencyInMs", c.MinLatencyInMs) - populate(objectMap, "probesFailed", c.ProbesFailed) - populate(objectMap, "probesSent", c.ProbesSent) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckResponse. -func (c *ConnectivityCheckResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateContract. +func (e *EmailTemplateContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "avgLatencyInMs": - err = unpopulate(val, "AvgLatencyInMs", &c.AvgLatencyInMs) - delete(rawMsg, key) - case "connectionStatus": - err = unpopulate(val, "ConnectionStatus", &c.ConnectionStatus) - delete(rawMsg, key) - case "hops": - err = unpopulate(val, "Hops", &c.Hops) - delete(rawMsg, key) - case "maxLatencyInMs": - err = unpopulate(val, "MaxLatencyInMs", &c.MaxLatencyInMs) + case "id": + err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) - case "minLatencyInMs": - err = unpopulate(val, "MinLatencyInMs", &c.MinLatencyInMs) + case "name": + err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) - case "probesFailed": - err = unpopulate(val, "ProbesFailed", &c.ProbesFailed) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) - case "probesSent": - err = unpopulate(val, "ProbesSent", &c.ProbesSent) + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectivityHop. -func (c ConnectivityHop) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EmailTemplateContractProperties. +func (e EmailTemplateContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "address", c.Address) - populate(objectMap, "id", c.ID) - populate(objectMap, "issues", c.Issues) - populate(objectMap, "nextHopIds", c.NextHopIDs) - populate(objectMap, "resourceId", c.ResourceID) - populate(objectMap, "type", c.Type) + populate(objectMap, "body", e.Body) + populate(objectMap, "description", e.Description) + populate(objectMap, "isDefault", e.IsDefault) + populate(objectMap, "parameters", e.Parameters) + populate(objectMap, "subject", e.Subject) + populate(objectMap, "title", e.Title) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityHop. -func (c *ConnectivityHop) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateContractProperties. +func (e *EmailTemplateContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "address": - err = unpopulate(val, "Address", &c.Address) + case "body": + err = unpopulate(val, "Body", &e.Body) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) + case "description": + err = unpopulate(val, "Description", &e.Description) delete(rawMsg, key) - case "issues": - err = unpopulate(val, "Issues", &c.Issues) + case "isDefault": + err = unpopulate(val, "IsDefault", &e.IsDefault) delete(rawMsg, key) - case "nextHopIds": - err = unpopulate(val, "NextHopIDs", &c.NextHopIDs) + case "parameters": + err = unpopulate(val, "Parameters", &e.Parameters) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &c.ResourceID) + case "subject": + err = unpopulate(val, "Subject", &e.Subject) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "title": + err = unpopulate(val, "Title", &e.Title) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectivityIssue. -func (c ConnectivityIssue) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EmailTemplateParametersContractProperties. +func (e EmailTemplateParametersContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "context", c.Context) - populate(objectMap, "origin", c.Origin) - populate(objectMap, "severity", c.Severity) - populate(objectMap, "type", c.Type) + populate(objectMap, "description", e.Description) + populate(objectMap, "name", e.Name) + populate(objectMap, "title", e.Title) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityIssue. -func (c *ConnectivityIssue) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateParametersContractProperties. +func (e *EmailTemplateParametersContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "context": - err = unpopulate(val, "Context", &c.Context) - delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &c.Origin) + case "description": + err = unpopulate(val, "Description", &e.Description) delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &c.Severity) + case "name": + err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "title": + err = unpopulate(val, "Title", &e.Title) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectivityStatusContract. -func (c ConnectivityStatusContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EmailTemplateUpdateParameterProperties. +func (e EmailTemplateUpdateParameterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "error", c.Error) - populate(objectMap, "isOptional", c.IsOptional) - populateTimeRFC3339(objectMap, "lastStatusChange", c.LastStatusChange) - populateTimeRFC3339(objectMap, "lastUpdated", c.LastUpdated) - populate(objectMap, "name", c.Name) - populate(objectMap, "resourceType", c.ResourceType) - populate(objectMap, "status", c.Status) + populate(objectMap, "body", e.Body) + populate(objectMap, "description", e.Description) + populate(objectMap, "parameters", e.Parameters) + populate(objectMap, "subject", e.Subject) + populate(objectMap, "title", e.Title) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityStatusContract. -func (c *ConnectivityStatusContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateUpdateParameterProperties. +func (e *EmailTemplateUpdateParameterProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "error": - err = unpopulate(val, "Error", &c.Error) - delete(rawMsg, key) - case "isOptional": - err = unpopulate(val, "IsOptional", &c.IsOptional) - delete(rawMsg, key) - case "lastStatusChange": - err = unpopulateTimeRFC3339(val, "LastStatusChange", &c.LastStatusChange) + case "body": + err = unpopulate(val, "Body", &e.Body) delete(rawMsg, key) - case "lastUpdated": - err = unpopulateTimeRFC3339(val, "LastUpdated", &c.LastUpdated) + case "description": + err = unpopulate(val, "Description", &e.Description) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "parameters": + err = unpopulate(val, "Parameters", &e.Parameters) delete(rawMsg, key) - case "resourceType": - err = unpopulate(val, "ResourceType", &c.ResourceType) + case "subject": + err = unpopulate(val, "Subject", &e.Subject) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &c.Status) + case "title": + err = unpopulate(val, "Title", &e.Title) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ContentItemCollection. -func (c ContentItemCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EmailTemplateUpdateParameters. +func (e EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "properties", e.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContentItemCollection. -func (c *ContentItemCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateUpdateParameters. +func (e *EmailTemplateUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ContentItemContract. -func (c ContentItemContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EndpointDependency. +func (e EndpointDependency) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "type", c.Type) + populate(objectMap, "domainName", e.DomainName) + populate(objectMap, "endpointDetails", e.EndpointDetails) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContentItemContract. -func (c *ContentItemContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDependency. +func (e *EndpointDependency) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "domainName": + err = unpopulate(val, "DomainName", &e.DomainName) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "endpointDetails": + err = unpopulate(val, "EndpointDetails", &e.EndpointDetails) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ContentTypeCollection. -func (c ContentTypeCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EndpointDetail. +func (e EndpointDetail) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "port", e.Port) + populate(objectMap, "region", e.Region) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContentTypeCollection. -func (c *ContentTypeCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDetail. +func (e *EndpointDetail) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "port": + err = unpopulate(val, "Port", &e.Port) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "region": + err = unpopulate(val, "Region", &e.Region) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ContentTypeContract. -func (c ContentTypeContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorFieldContract. +func (e ErrorFieldContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "type", c.Type) + populate(objectMap, "code", e.Code) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContentTypeContract. -func (c *ContentTypeContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorFieldContract. +func (e *ErrorFieldContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "code": + err = unpopulate(val, "Code", &e.Code) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "message": + err = unpopulate(val, "Message", &e.Message) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "target": + err = unpopulate(val, "Target", &e.Target) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ContentTypeContractProperties. -func (c ContentTypeContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", c.Description) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populateAny(objectMap, "schema", c.Schema) - populate(objectMap, "version", c.Version) + populate(objectMap, "error", e.Error) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContentTypeContractProperties. -func (c *ContentTypeContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &c.Description) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "schema": - err = unpopulate(val, "Schema", &c.Schema) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &c.Version) + case "error": + err = unpopulate(val, "Error", &e.Error) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DataMasking. -func (d DataMasking) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorResponseBody. +func (e ErrorResponseBody) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "headers", d.Headers) - populate(objectMap, "queryParams", d.QueryParams) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataMasking. -func (d *DataMasking) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseBody. +func (e *ErrorResponseBody) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "headers": - err = unpopulate(val, "Headers", &d.Headers) + case "code": + err = unpopulate(val, "Code", &e.Code) delete(rawMsg, key) - case "queryParams": - err = unpopulate(val, "QueryParams", &d.QueryParams) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DataMaskingEntity. -func (d DataMaskingEntity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayCertificateAuthorityCollection. +func (g GatewayCertificateAuthorityCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "mode", d.Mode) - populate(objectMap, "value", d.Value) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataMaskingEntity. -func (d *DataMaskingEntity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCertificateAuthorityCollection. +func (g *GatewayCertificateAuthorityCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "mode": - err = unpopulate(val, "Mode", &d.Mode) + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &d.Value) + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DeletedServiceContract. -func (d DeletedServiceContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayCertificateAuthorityContract. +func (g GatewayCertificateAuthorityContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "type", d.Type) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServiceContract. -func (d *DeletedServiceContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCertificateAuthorityContract. +func (g *GatewayCertificateAuthorityContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &d.Name) + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &d.Properties) + err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &d.Type) + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DeletedServiceContractProperties. -func (d DeletedServiceContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayCertificateAuthorityContractProperties. +func (g GatewayCertificateAuthorityContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "deletionDate", d.DeletionDate) - populateTimeRFC3339(objectMap, "scheduledPurgeDate", d.ScheduledPurgeDate) - populate(objectMap, "serviceId", d.ServiceID) + populate(objectMap, "isTrusted", g.IsTrusted) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServiceContractProperties. -func (d *DeletedServiceContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCertificateAuthorityContractProperties. +func (g *GatewayCertificateAuthorityContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "deletionDate": - err = unpopulateTimeRFC3339(val, "DeletionDate", &d.DeletionDate) - delete(rawMsg, key) - case "scheduledPurgeDate": - err = unpopulateTimeRFC3339(val, "ScheduledPurgeDate", &d.ScheduledPurgeDate) - delete(rawMsg, key) - case "serviceId": - err = unpopulate(val, "ServiceID", &d.ServiceID) + case "isTrusted": + err = unpopulate(val, "IsTrusted", &g.IsTrusted) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DeletedServicesCollection. -func (d DeletedServicesCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayCollection. +func (g GatewayCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "count", g.Count) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServicesCollection. -func (d *DeletedServicesCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCollection. +func (g *GatewayCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { + case "count": + err = unpopulate(val, "Count", &g.Count) + delete(rawMsg, key) case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) + err = unpopulate(val, "NextLink", &g.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &d.Value) + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DeployConfigurationParameterProperties. -func (d DeployConfigurationParameterProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayContract. +func (g GatewayContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "branch", d.Branch) - populate(objectMap, "force", d.Force) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeployConfigurationParameterProperties. -func (d *DeployConfigurationParameterProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayContract. +func (g *GatewayContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "branch": - err = unpopulate(val, "Branch", &d.Branch) + case "id": + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) - case "force": - err = unpopulate(val, "Force", &d.Force) + case "name": + err = unpopulate(val, "Name", &g.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DeployConfigurationParameters. -func (d DeployConfigurationParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayContractProperties. +func (g GatewayContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", d.Properties) + populate(objectMap, "description", g.Description) + populate(objectMap, "locationData", g.LocationData) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeployConfigurationParameters. -func (d *DeployConfigurationParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayContractProperties. +func (g *GatewayContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "description": + err = unpopulate(val, "Description", &g.Description) + delete(rawMsg, key) + case "locationData": + err = unpopulate(val, "LocationData", &g.LocationData) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DiagnosticCollection. -func (d DiagnosticCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayHostnameConfigurationCollection. +func (g GatewayHostnameConfigurationCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", d.Count) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticCollection. -func (d *DiagnosticCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayHostnameConfigurationCollection. +func (g *GatewayHostnameConfigurationCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &d.Count) - delete(rawMsg, key) case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) + err = unpopulate(val, "NextLink", &g.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &d.Value) + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DiagnosticContract. -func (d DiagnosticContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayHostnameConfigurationContract. +func (g GatewayHostnameConfigurationContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "type", d.Type) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticContract. -func (d *DiagnosticContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayHostnameConfigurationContract. +func (g *GatewayHostnameConfigurationContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &d.ID) + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &d.Name) + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &d.Properties) + err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &d.Type) + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DiagnosticContractProperties. -func (d DiagnosticContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayHostnameConfigurationContractProperties. +func (g GatewayHostnameConfigurationContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "alwaysLog", d.AlwaysLog) - populate(objectMap, "backend", d.Backend) - populate(objectMap, "frontend", d.Frontend) - populate(objectMap, "httpCorrelationProtocol", d.HTTPCorrelationProtocol) - populate(objectMap, "logClientIp", d.LogClientIP) - populate(objectMap, "loggerId", d.LoggerID) - populate(objectMap, "operationNameFormat", d.OperationNameFormat) - populate(objectMap, "sampling", d.Sampling) - populate(objectMap, "verbosity", d.Verbosity) + populate(objectMap, "certificateId", g.CertificateID) + populate(objectMap, "http2Enabled", g.HTTP2Enabled) + populate(objectMap, "hostname", g.Hostname) + populate(objectMap, "negotiateClientCertificate", g.NegotiateClientCertificate) + populate(objectMap, "tls10Enabled", g.Tls10Enabled) + populate(objectMap, "tls11Enabled", g.Tls11Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticContractProperties. -func (d *DiagnosticContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayHostnameConfigurationContractProperties. +func (g *GatewayHostnameConfigurationContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "alwaysLog": - err = unpopulate(val, "AlwaysLog", &d.AlwaysLog) - delete(rawMsg, key) - case "backend": - err = unpopulate(val, "Backend", &d.Backend) - delete(rawMsg, key) - case "frontend": - err = unpopulate(val, "Frontend", &d.Frontend) - delete(rawMsg, key) - case "httpCorrelationProtocol": - err = unpopulate(val, "HTTPCorrelationProtocol", &d.HTTPCorrelationProtocol) + case "certificateId": + err = unpopulate(val, "CertificateID", &g.CertificateID) delete(rawMsg, key) - case "logClientIp": - err = unpopulate(val, "LogClientIP", &d.LogClientIP) + case "http2Enabled": + err = unpopulate(val, "HTTP2Enabled", &g.HTTP2Enabled) delete(rawMsg, key) - case "loggerId": - err = unpopulate(val, "LoggerID", &d.LoggerID) + case "hostname": + err = unpopulate(val, "Hostname", &g.Hostname) delete(rawMsg, key) - case "operationNameFormat": - err = unpopulate(val, "OperationNameFormat", &d.OperationNameFormat) + case "negotiateClientCertificate": + err = unpopulate(val, "NegotiateClientCertificate", &g.NegotiateClientCertificate) delete(rawMsg, key) - case "sampling": - err = unpopulate(val, "Sampling", &d.Sampling) + case "tls10Enabled": + err = unpopulate(val, "Tls10Enabled", &g.Tls10Enabled) delete(rawMsg, key) - case "verbosity": - err = unpopulate(val, "Verbosity", &d.Verbosity) + case "tls11Enabled": + err = unpopulate(val, "Tls11Enabled", &g.Tls11Enabled) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EmailTemplateCollection. -func (e EmailTemplateCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayKeyRegenerationRequestContract. +func (g GatewayKeyRegenerationRequestContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", e.Count) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) + populate(objectMap, "keyType", g.KeyType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateCollection. -func (e *EmailTemplateCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayKeyRegenerationRequestContract. +func (g *GatewayKeyRegenerationRequestContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &e.Count) - delete(rawMsg, key) - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) + case "keyType": + err = unpopulate(val, "KeyType", &g.KeyType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EmailTemplateContract. -func (e EmailTemplateContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayKeysContract. +func (g GatewayKeysContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "type", e.Type) + populate(objectMap, "primary", g.Primary) + populate(objectMap, "secondary", g.Secondary) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateContract. -func (e *EmailTemplateContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayKeysContract. +func (g *GatewayKeysContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) + case "primary": + err = unpopulate(val, "Primary", &g.Primary) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) + case "secondary": + err = unpopulate(val, "Secondary", &g.Secondary) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayTokenContract. +func (g GatewayTokenContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayTokenContract. +func (g *GatewayTokenContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EmailTemplateContractProperties. -func (e EmailTemplateContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayTokenRequestContract. +func (g GatewayTokenRequestContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "body", e.Body) - populate(objectMap, "description", e.Description) - populate(objectMap, "isDefault", e.IsDefault) - populate(objectMap, "parameters", e.Parameters) - populate(objectMap, "subject", e.Subject) - populate(objectMap, "title", e.Title) + populateTimeRFC3339(objectMap, "expiry", g.Expiry) + populate(objectMap, "keyType", g.KeyType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateContractProperties. -func (e *EmailTemplateContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayTokenRequestContract. +func (g *GatewayTokenRequestContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "body": - err = unpopulate(val, "Body", &e.Body) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &e.Description) - delete(rawMsg, key) - case "isDefault": - err = unpopulate(val, "IsDefault", &e.IsDefault) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &e.Parameters) - delete(rawMsg, key) - case "subject": - err = unpopulate(val, "Subject", &e.Subject) + case "expiry": + err = unpopulateTimeRFC3339(val, "Expiry", &g.Expiry) delete(rawMsg, key) - case "title": - err = unpopulate(val, "Title", &e.Title) + case "keyType": + err = unpopulate(val, "KeyType", &g.KeyType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EmailTemplateParametersContractProperties. -func (e EmailTemplateParametersContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GenerateSsoURLResult. +func (g GenerateSsoURLResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", e.Description) - populate(objectMap, "name", e.Name) - populate(objectMap, "title", e.Title) + populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateParametersContractProperties. -func (e *EmailTemplateParametersContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateSsoURLResult. +func (g *GenerateSsoURLResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &e.Description) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "title": - err = unpopulate(val, "Title", &e.Title) + case "value": + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EmailTemplateUpdateParameterProperties. -func (e EmailTemplateUpdateParameterProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GlobalSchemaCollection. +func (g GlobalSchemaCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "body", e.Body) - populate(objectMap, "description", e.Description) - populate(objectMap, "parameters", e.Parameters) - populate(objectMap, "subject", e.Subject) - populate(objectMap, "title", e.Title) + populate(objectMap, "count", g.Count) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateUpdateParameterProperties. -func (e *EmailTemplateUpdateParameterProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GlobalSchemaCollection. +func (g *GlobalSchemaCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "body": - err = unpopulate(val, "Body", &e.Body) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &e.Description) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &e.Parameters) + case "count": + err = unpopulate(val, "Count", &g.Count) delete(rawMsg, key) - case "subject": - err = unpopulate(val, "Subject", &e.Subject) + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) delete(rawMsg, key) - case "title": - err = unpopulate(val, "Title", &e.Title) + case "value": + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EmailTemplateUpdateParameters. -func (e EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GlobalSchemaContract. +func (g GlobalSchemaContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", e.Properties) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateUpdateParameters. -func (e *EmailTemplateUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GlobalSchemaContract. +func (g *GlobalSchemaContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &g.Name) + delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &e.Properties) + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EndpointDependency. -func (e EndpointDependency) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GlobalSchemaContractProperties. +func (g GlobalSchemaContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "domainName", e.DomainName) - populate(objectMap, "endpointDetails", e.EndpointDetails) + populate(objectMap, "description", g.Description) + populateAny(objectMap, "document", g.Document) + populate(objectMap, "schemaType", g.SchemaType) + populateAny(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDependency. -func (e *EndpointDependency) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GlobalSchemaContractProperties. +func (g *GlobalSchemaContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "domainName": - err = unpopulate(val, "DomainName", &e.DomainName) + case "description": + err = unpopulate(val, "Description", &g.Description) delete(rawMsg, key) - case "endpointDetails": - err = unpopulate(val, "EndpointDetails", &e.EndpointDetails) + case "document": + err = unpopulate(val, "Document", &g.Document) + delete(rawMsg, key) + case "schemaType": + err = unpopulate(val, "SchemaType", &g.SchemaType) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EndpointDetail. -func (e EndpointDetail) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GroupCollection. +func (g GroupCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "port", e.Port) - populate(objectMap, "region", e.Region) + populate(objectMap, "count", g.Count) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDetail. -func (e *EndpointDetail) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupCollection. +func (g *GroupCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "port": - err = unpopulate(val, "Port", &e.Port) + case "count": + err = unpopulate(val, "Count", &g.Count) delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &e.Region) + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorFieldContract. -func (e ErrorFieldContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GroupContract. +func (g GroupContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "code", e.Code) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorFieldContract. -func (e *ErrorFieldContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupContract. +func (g *GroupContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "code": - err = unpopulate(val, "Code", &e.Code) + case "id": + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) + case "name": + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. -func (e ErrorResponse) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GroupContractProperties. +func (g GroupContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "error", e.Error) + populate(objectMap, "builtIn", g.BuiltIn) + populate(objectMap, "description", g.Description) + populate(objectMap, "displayName", g.DisplayName) + populate(objectMap, "externalId", g.ExternalID) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. -func (e *ErrorResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupContractProperties. +func (g *GroupContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error - switch key { - case "error": - err = unpopulate(val, "Error", &e.Error) + switch key { + case "builtIn": + err = unpopulate(val, "BuiltIn", &g.BuiltIn) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &g.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &g.DisplayName) + delete(rawMsg, key) + case "externalId": + err = unpopulate(val, "ExternalID", &g.ExternalID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorResponseBody. -func (e ErrorResponseBody) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GroupCreateParameters. +func (g GroupCreateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "message", e.Message) + populate(objectMap, "properties", g.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseBody. -func (e *ErrorResponseBody) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupCreateParameters. +func (g *GroupCreateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "code": - err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &e.Details) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayCertificateAuthorityCollection. -func (g GatewayCertificateAuthorityCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GroupCreateParametersProperties. +func (g GroupCreateParametersProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) + populate(objectMap, "description", g.Description) + populate(objectMap, "displayName", g.DisplayName) + populate(objectMap, "externalId", g.ExternalID) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCertificateAuthorityCollection. -func (g *GatewayCertificateAuthorityCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupCreateParametersProperties. +func (g *GroupCreateParametersProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -4573,11 +5962,17 @@ func (g *GatewayCertificateAuthorityCollection) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) + case "description": + err = unpopulate(val, "Description", &g.Description) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) + case "displayName": + err = unpopulate(val, "DisplayName", &g.DisplayName) + delete(rawMsg, key) + case "externalId": + err = unpopulate(val, "ExternalID", &g.ExternalID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { @@ -4587,18 +5982,15 @@ func (g *GatewayCertificateAuthorityCollection) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayCertificateAuthorityContract. -func (g GatewayCertificateAuthorityContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GroupUpdateParameters. +func (g GroupUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) populate(objectMap, "properties", g.Properties) - populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCertificateAuthorityContract. -func (g *GatewayCertificateAuthorityContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupUpdateParameters. +func (g *GroupUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -4606,18 +5998,9 @@ func (g *GatewayCertificateAuthorityContract) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -4626,15 +6009,18 @@ func (g *GatewayCertificateAuthorityContract) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayCertificateAuthorityContractProperties. -func (g GatewayCertificateAuthorityContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GroupUpdateParametersProperties. +func (g GroupUpdateParametersProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "isTrusted", g.IsTrusted) + populate(objectMap, "description", g.Description) + populate(objectMap, "displayName", g.DisplayName) + populate(objectMap, "externalId", g.ExternalID) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCertificateAuthorityContractProperties. -func (g *GatewayCertificateAuthorityContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupUpdateParametersProperties. +func (g *GroupUpdateParametersProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -4642,8 +6028,17 @@ func (g *GatewayCertificateAuthorityContractProperties) UnmarshalJSON(data []byt for key, val := range rawMsg { var err error switch key { - case "isTrusted": - err = unpopulate(val, "IsTrusted", &g.IsTrusted) + case "description": + err = unpopulate(val, "Description", &g.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &g.DisplayName) + delete(rawMsg, key) + case "externalId": + err = unpopulate(val, "ExternalID", &g.ExternalID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { @@ -4653,3385 +6048,3526 @@ func (g *GatewayCertificateAuthorityContractProperties) UnmarshalJSON(data []byt return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayCollection. -func (g GatewayCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type HTTPHeader. +func (h HTTPHeader) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", g.Count) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) + populate(objectMap, "name", h.Name) + populate(objectMap, "value", h.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCollection. -func (g *GatewayCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPHeader. +func (h *HTTPHeader) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &g.Count) - delete(rawMsg, key) - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) + case "name": + err = unpopulate(val, "Name", &h.Name) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &g.Value) + err = unpopulate(val, "Value", &h.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayContract. -func (g GatewayContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type HTTPMessageDiagnostic. +func (h HTTPMessageDiagnostic) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "type", g.Type) + populate(objectMap, "body", h.Body) + populate(objectMap, "dataMasking", h.DataMasking) + populate(objectMap, "headers", h.Headers) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayContract. -func (g *GatewayContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPMessageDiagnostic. +func (h *HTTPMessageDiagnostic) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) + case "body": + err = unpopulate(val, "Body", &h.Body) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) + case "dataMasking": + err = unpopulate(val, "DataMasking", &h.DataMasking) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) + case "headers": + err = unpopulate(val, "Headers", &h.Headers) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayContractProperties. -func (g GatewayContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type HostnameConfiguration. +func (h HostnameConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", g.Description) - populate(objectMap, "locationData", g.LocationData) + populate(objectMap, "certificate", h.Certificate) + populate(objectMap, "certificatePassword", h.CertificatePassword) + populate(objectMap, "certificateSource", h.CertificateSource) + populate(objectMap, "certificateStatus", h.CertificateStatus) + populate(objectMap, "defaultSslBinding", h.DefaultSSLBinding) + populate(objectMap, "encodedCertificate", h.EncodedCertificate) + populate(objectMap, "hostName", h.HostName) + populate(objectMap, "identityClientId", h.IdentityClientID) + populate(objectMap, "keyVaultId", h.KeyVaultID) + populate(objectMap, "negotiateClientCertificate", h.NegotiateClientCertificate) + populate(objectMap, "type", h.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayContractProperties. -func (g *GatewayContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type HostnameConfiguration. +func (h *HostnameConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &g.Description) + case "certificate": + err = unpopulate(val, "Certificate", &h.Certificate) delete(rawMsg, key) - case "locationData": - err = unpopulate(val, "LocationData", &g.LocationData) + case "certificatePassword": + err = unpopulate(val, "CertificatePassword", &h.CertificatePassword) + delete(rawMsg, key) + case "certificateSource": + err = unpopulate(val, "CertificateSource", &h.CertificateSource) + delete(rawMsg, key) + case "certificateStatus": + err = unpopulate(val, "CertificateStatus", &h.CertificateStatus) + delete(rawMsg, key) + case "defaultSslBinding": + err = unpopulate(val, "DefaultSSLBinding", &h.DefaultSSLBinding) + delete(rawMsg, key) + case "encodedCertificate": + err = unpopulate(val, "EncodedCertificate", &h.EncodedCertificate) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &h.HostName) + delete(rawMsg, key) + case "identityClientId": + err = unpopulate(val, "IdentityClientID", &h.IdentityClientID) + delete(rawMsg, key) + case "keyVaultId": + err = unpopulate(val, "KeyVaultID", &h.KeyVaultID) + delete(rawMsg, key) + case "negotiateClientCertificate": + err = unpopulate(val, "NegotiateClientCertificate", &h.NegotiateClientCertificate) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &h.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayHostnameConfigurationCollection. -func (g GatewayHostnameConfigurationCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IdentityProviderBaseParameters. +func (i IdentityProviderBaseParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) + populate(objectMap, "allowedTenants", i.AllowedTenants) + populate(objectMap, "authority", i.Authority) + populate(objectMap, "clientLibrary", i.ClientLibrary) + populate(objectMap, "passwordResetPolicyName", i.PasswordResetPolicyName) + populate(objectMap, "profileEditingPolicyName", i.ProfileEditingPolicyName) + populate(objectMap, "signinPolicyName", i.SigninPolicyName) + populate(objectMap, "signinTenant", i.SigninTenant) + populate(objectMap, "signupPolicyName", i.SignupPolicyName) + populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayHostnameConfigurationCollection. -func (g *GatewayHostnameConfigurationCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderBaseParameters. +func (i *IdentityProviderBaseParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) + case "allowedTenants": + err = unpopulate(val, "AllowedTenants", &i.AllowedTenants) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) + case "authority": + err = unpopulate(val, "Authority", &i.Authority) + delete(rawMsg, key) + case "clientLibrary": + err = unpopulate(val, "ClientLibrary", &i.ClientLibrary) + delete(rawMsg, key) + case "passwordResetPolicyName": + err = unpopulate(val, "PasswordResetPolicyName", &i.PasswordResetPolicyName) + delete(rawMsg, key) + case "profileEditingPolicyName": + err = unpopulate(val, "ProfileEditingPolicyName", &i.ProfileEditingPolicyName) + delete(rawMsg, key) + case "signinPolicyName": + err = unpopulate(val, "SigninPolicyName", &i.SigninPolicyName) + delete(rawMsg, key) + case "signinTenant": + err = unpopulate(val, "SigninTenant", &i.SigninTenant) + delete(rawMsg, key) + case "signupPolicyName": + err = unpopulate(val, "SignupPolicyName", &i.SignupPolicyName) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayHostnameConfigurationContract. -func (g GatewayHostnameConfigurationContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IdentityProviderContract. +func (i IdentityProviderContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "type", g.Type) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayHostnameConfigurationContract. -func (g *GatewayHostnameConfigurationContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderContract. +func (i *IdentityProviderContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &g.ID) + err = unpopulate(val, "ID", &i.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &g.Name) + err = unpopulate(val, "Name", &i.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &g.Properties) + err = unpopulate(val, "Properties", &i.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &g.Type) + err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayHostnameConfigurationContractProperties. -func (g GatewayHostnameConfigurationContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IdentityProviderContractProperties. +func (i IdentityProviderContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "certificateId", g.CertificateID) - populate(objectMap, "http2Enabled", g.HTTP2Enabled) - populate(objectMap, "hostname", g.Hostname) - populate(objectMap, "negotiateClientCertificate", g.NegotiateClientCertificate) - populate(objectMap, "tls10Enabled", g.Tls10Enabled) - populate(objectMap, "tls11Enabled", g.Tls11Enabled) + populate(objectMap, "allowedTenants", i.AllowedTenants) + populate(objectMap, "authority", i.Authority) + populate(objectMap, "clientId", i.ClientID) + populate(objectMap, "clientLibrary", i.ClientLibrary) + populate(objectMap, "clientSecret", i.ClientSecret) + populate(objectMap, "passwordResetPolicyName", i.PasswordResetPolicyName) + populate(objectMap, "profileEditingPolicyName", i.ProfileEditingPolicyName) + populate(objectMap, "signinPolicyName", i.SigninPolicyName) + populate(objectMap, "signinTenant", i.SigninTenant) + populate(objectMap, "signupPolicyName", i.SignupPolicyName) + populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayHostnameConfigurationContractProperties. -func (g *GatewayHostnameConfigurationContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderContractProperties. +func (i *IdentityProviderContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "certificateId": - err = unpopulate(val, "CertificateID", &g.CertificateID) + case "allowedTenants": + err = unpopulate(val, "AllowedTenants", &i.AllowedTenants) delete(rawMsg, key) - case "http2Enabled": - err = unpopulate(val, "HTTP2Enabled", &g.HTTP2Enabled) + case "authority": + err = unpopulate(val, "Authority", &i.Authority) delete(rawMsg, key) - case "hostname": - err = unpopulate(val, "Hostname", &g.Hostname) + case "clientId": + err = unpopulate(val, "ClientID", &i.ClientID) delete(rawMsg, key) - case "negotiateClientCertificate": - err = unpopulate(val, "NegotiateClientCertificate", &g.NegotiateClientCertificate) + case "clientLibrary": + err = unpopulate(val, "ClientLibrary", &i.ClientLibrary) delete(rawMsg, key) - case "tls10Enabled": - err = unpopulate(val, "Tls10Enabled", &g.Tls10Enabled) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &i.ClientSecret) delete(rawMsg, key) - case "tls11Enabled": - err = unpopulate(val, "Tls11Enabled", &g.Tls11Enabled) + case "passwordResetPolicyName": + err = unpopulate(val, "PasswordResetPolicyName", &i.PasswordResetPolicyName) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GatewayKeyRegenerationRequestContract. -func (g GatewayKeyRegenerationRequestContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "keyType", g.KeyType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayKeyRegenerationRequestContract. -func (g *GatewayKeyRegenerationRequestContract) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "keyType": - err = unpopulate(val, "KeyType", &g.KeyType) + case "profileEditingPolicyName": + err = unpopulate(val, "ProfileEditingPolicyName", &i.ProfileEditingPolicyName) + delete(rawMsg, key) + case "signinPolicyName": + err = unpopulate(val, "SigninPolicyName", &i.SigninPolicyName) + delete(rawMsg, key) + case "signinTenant": + err = unpopulate(val, "SigninTenant", &i.SigninTenant) + delete(rawMsg, key) + case "signupPolicyName": + err = unpopulate(val, "SignupPolicyName", &i.SignupPolicyName) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayKeysContract. -func (g GatewayKeysContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IdentityProviderCreateContract. +func (i IdentityProviderCreateContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "primary", g.Primary) - populate(objectMap, "secondary", g.Secondary) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayKeysContract. -func (g *GatewayKeysContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderCreateContract. +func (i *IdentityProviderCreateContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "primary": - err = unpopulate(val, "Primary", &g.Primary) + case "id": + err = unpopulate(val, "ID", &i.ID) delete(rawMsg, key) - case "secondary": - err = unpopulate(val, "Secondary", &g.Secondary) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayTokenContract. -func (g GatewayTokenContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IdentityProviderCreateContractProperties. +func (i IdentityProviderCreateContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", g.Value) + populate(objectMap, "allowedTenants", i.AllowedTenants) + populate(objectMap, "authority", i.Authority) + populate(objectMap, "clientId", i.ClientID) + populate(objectMap, "clientLibrary", i.ClientLibrary) + populate(objectMap, "clientSecret", i.ClientSecret) + populate(objectMap, "passwordResetPolicyName", i.PasswordResetPolicyName) + populate(objectMap, "profileEditingPolicyName", i.ProfileEditingPolicyName) + populate(objectMap, "signinPolicyName", i.SigninPolicyName) + populate(objectMap, "signinTenant", i.SigninTenant) + populate(objectMap, "signupPolicyName", i.SignupPolicyName) + populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayTokenContract. -func (g *GatewayTokenContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderCreateContractProperties. +func (i *IdentityProviderCreateContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &g.Value) + case "allowedTenants": + err = unpopulate(val, "AllowedTenants", &i.AllowedTenants) + delete(rawMsg, key) + case "authority": + err = unpopulate(val, "Authority", &i.Authority) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &i.ClientID) + delete(rawMsg, key) + case "clientLibrary": + err = unpopulate(val, "ClientLibrary", &i.ClientLibrary) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &i.ClientSecret) + delete(rawMsg, key) + case "passwordResetPolicyName": + err = unpopulate(val, "PasswordResetPolicyName", &i.PasswordResetPolicyName) + delete(rawMsg, key) + case "profileEditingPolicyName": + err = unpopulate(val, "ProfileEditingPolicyName", &i.ProfileEditingPolicyName) + delete(rawMsg, key) + case "signinPolicyName": + err = unpopulate(val, "SigninPolicyName", &i.SigninPolicyName) + delete(rawMsg, key) + case "signinTenant": + err = unpopulate(val, "SigninTenant", &i.SigninTenant) + delete(rawMsg, key) + case "signupPolicyName": + err = unpopulate(val, "SignupPolicyName", &i.SignupPolicyName) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GatewayTokenRequestContract. -func (g GatewayTokenRequestContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IdentityProviderList. +func (i IdentityProviderList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "expiry", g.Expiry) - populate(objectMap, "keyType", g.KeyType) + populate(objectMap, "count", i.Count) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayTokenRequestContract. -func (g *GatewayTokenRequestContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderList. +func (i *IdentityProviderList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "expiry": - err = unpopulateTimeRFC3339(val, "Expiry", &g.Expiry) + case "count": + err = unpopulate(val, "Count", &i.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) delete(rawMsg, key) - case "keyType": - err = unpopulate(val, "KeyType", &g.KeyType) + case "value": + err = unpopulate(val, "Value", &i.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GenerateSsoURLResult. -func (g GenerateSsoURLResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IdentityProviderUpdateParameters. +func (i IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", g.Value) + populate(objectMap, "properties", i.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateSsoURLResult. -func (g *GenerateSsoURLResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderUpdateParameters. +func (i *IdentityProviderUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &g.Value) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GlobalSchemaCollection. -func (g GlobalSchemaCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IdentityProviderUpdateProperties. +func (i IdentityProviderUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", g.Count) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) + populate(objectMap, "allowedTenants", i.AllowedTenants) + populate(objectMap, "authority", i.Authority) + populate(objectMap, "clientId", i.ClientID) + populate(objectMap, "clientLibrary", i.ClientLibrary) + populate(objectMap, "clientSecret", i.ClientSecret) + populate(objectMap, "passwordResetPolicyName", i.PasswordResetPolicyName) + populate(objectMap, "profileEditingPolicyName", i.ProfileEditingPolicyName) + populate(objectMap, "signinPolicyName", i.SigninPolicyName) + populate(objectMap, "signinTenant", i.SigninTenant) + populate(objectMap, "signupPolicyName", i.SignupPolicyName) + populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GlobalSchemaCollection. -func (g *GlobalSchemaCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderUpdateProperties. +func (i *IdentityProviderUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &g.Count) + case "allowedTenants": + err = unpopulate(val, "AllowedTenants", &i.AllowedTenants) delete(rawMsg, key) - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) + case "authority": + err = unpopulate(val, "Authority", &i.Authority) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) + case "clientId": + err = unpopulate(val, "ClientID", &i.ClientID) + delete(rawMsg, key) + case "clientLibrary": + err = unpopulate(val, "ClientLibrary", &i.ClientLibrary) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &i.ClientSecret) + delete(rawMsg, key) + case "passwordResetPolicyName": + err = unpopulate(val, "PasswordResetPolicyName", &i.PasswordResetPolicyName) + delete(rawMsg, key) + case "profileEditingPolicyName": + err = unpopulate(val, "ProfileEditingPolicyName", &i.ProfileEditingPolicyName) + delete(rawMsg, key) + case "signinPolicyName": + err = unpopulate(val, "SigninPolicyName", &i.SigninPolicyName) + delete(rawMsg, key) + case "signinTenant": + err = unpopulate(val, "SigninTenant", &i.SigninTenant) + delete(rawMsg, key) + case "signupPolicyName": + err = unpopulate(val, "SignupPolicyName", &i.SignupPolicyName) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GlobalSchemaContract. -func (g GlobalSchemaContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IssueAttachmentCollection. +func (i IssueAttachmentCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "type", g.Type) + populate(objectMap, "count", i.Count) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GlobalSchemaContract. -func (g *GlobalSchemaContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueAttachmentCollection. +func (i *IssueAttachmentCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) + case "count": + err = unpopulate(val, "Count", &i.Count) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) + case "value": + err = unpopulate(val, "Value", &i.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GlobalSchemaContractProperties. -func (g GlobalSchemaContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IssueAttachmentContract. +func (i IssueAttachmentContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", g.Description) - populateAny(objectMap, "document", g.Document) - populate(objectMap, "schemaType", g.SchemaType) - populateAny(objectMap, "value", g.Value) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GlobalSchemaContractProperties. -func (g *GlobalSchemaContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueAttachmentContract. +func (i *IssueAttachmentContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &g.Description) + case "id": + err = unpopulate(val, "ID", &i.ID) delete(rawMsg, key) - case "document": - err = unpopulate(val, "Document", &g.Document) + case "name": + err = unpopulate(val, "Name", &i.Name) delete(rawMsg, key) - case "schemaType": - err = unpopulate(val, "SchemaType", &g.SchemaType) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) + case "type": + err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GroupCollection. -func (g GroupCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IssueAttachmentContractProperties. +func (i IssueAttachmentContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", g.Count) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) + populate(objectMap, "content", i.Content) + populate(objectMap, "contentFormat", i.ContentFormat) + populate(objectMap, "title", i.Title) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GroupCollection. -func (g *GroupCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueAttachmentContractProperties. +func (i *IssueAttachmentContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &g.Count) + case "content": + err = unpopulate(val, "Content", &i.Content) delete(rawMsg, key) - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) + case "contentFormat": + err = unpopulate(val, "ContentFormat", &i.ContentFormat) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) + case "title": + err = unpopulate(val, "Title", &i.Title) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GroupContract. -func (g GroupContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IssueCollection. +func (i IssueCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "type", g.Type) + populate(objectMap, "count", i.Count) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GroupContract. -func (g *GroupContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueCollection. +func (i *IssueCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) + case "count": + err = unpopulate(val, "Count", &i.Count) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) + case "value": + err = unpopulate(val, "Value", &i.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GroupContractProperties. -func (g GroupContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IssueCommentCollection. +func (i IssueCommentCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "builtIn", g.BuiltIn) - populate(objectMap, "description", g.Description) - populate(objectMap, "displayName", g.DisplayName) - populate(objectMap, "externalId", g.ExternalID) - populate(objectMap, "type", g.Type) + populate(objectMap, "count", i.Count) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GroupContractProperties. -func (g *GroupContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueCommentCollection. +func (i *IssueCommentCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "builtIn": - err = unpopulate(val, "BuiltIn", &g.BuiltIn) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &g.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &g.DisplayName) + case "count": + err = unpopulate(val, "Count", &i.Count) delete(rawMsg, key) - case "externalId": - err = unpopulate(val, "ExternalID", &g.ExternalID) + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) + case "value": + err = unpopulate(val, "Value", &i.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GroupCreateParameters. -func (g GroupCreateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IssueCommentContract. +func (i IssueCommentContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", g.Properties) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GroupCreateParameters. -func (g *GroupCreateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueCommentContract. +func (i *IssueCommentContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &g.Properties) + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GroupCreateParametersProperties. -func (g GroupCreateParametersProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IssueCommentContractProperties. +func (i IssueCommentContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", g.Description) - populate(objectMap, "displayName", g.DisplayName) - populate(objectMap, "externalId", g.ExternalID) - populate(objectMap, "type", g.Type) + populateTimeRFC3339(objectMap, "createdDate", i.CreatedDate) + populate(objectMap, "text", i.Text) + populate(objectMap, "userId", i.UserID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GroupCreateParametersProperties. -func (g *GroupCreateParametersProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueCommentContractProperties. +func (i *IssueCommentContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &g.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &g.DisplayName) + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &i.CreatedDate) delete(rawMsg, key) - case "externalId": - err = unpopulate(val, "ExternalID", &g.ExternalID) + case "text": + err = unpopulate(val, "Text", &i.Text) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) + case "userId": + err = unpopulate(val, "UserID", &i.UserID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GroupUpdateParameters. -func (g GroupUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IssueContract. +func (i IssueContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", g.Properties) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GroupUpdateParameters. -func (g *GroupUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueContract. +func (i *IssueContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &g.Properties) + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GroupUpdateParametersProperties. -func (g GroupUpdateParametersProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IssueContractBaseProperties. +func (i IssueContractBaseProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", g.Description) - populate(objectMap, "displayName", g.DisplayName) - populate(objectMap, "externalId", g.ExternalID) - populate(objectMap, "type", g.Type) + populate(objectMap, "apiId", i.APIID) + populateTimeRFC3339(objectMap, "createdDate", i.CreatedDate) + populate(objectMap, "state", i.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GroupUpdateParametersProperties. -func (g *GroupUpdateParametersProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueContractBaseProperties. +func (i *IssueContractBaseProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &g.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &g.DisplayName) + case "apiId": + err = unpopulate(val, "APIID", &i.APIID) delete(rawMsg, key) - case "externalId": - err = unpopulate(val, "ExternalID", &g.ExternalID) + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &i.CreatedDate) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) + case "state": + err = unpopulate(val, "State", &i.State) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HTTPHeader. -func (h HTTPHeader) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IssueContractProperties. +func (i IssueContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", h.Name) - populate(objectMap, "value", h.Value) + populate(objectMap, "apiId", i.APIID) + populateTimeRFC3339(objectMap, "createdDate", i.CreatedDate) + populate(objectMap, "description", i.Description) + populate(objectMap, "state", i.State) + populate(objectMap, "title", i.Title) + populate(objectMap, "userId", i.UserID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPHeader. -func (h *HTTPHeader) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueContractProperties. +func (i *IssueContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &h.Name) + case "apiId": + err = unpopulate(val, "APIID", &i.APIID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &h.Value) + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &i.CreatedDate) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &i.Description) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &i.State) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &i.Title) + delete(rawMsg, key) + case "userId": + err = unpopulate(val, "UserID", &i.UserID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HTTPMessageDiagnostic. -func (h HTTPMessageDiagnostic) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IssueUpdateContract. +func (i IssueUpdateContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "body", h.Body) - populate(objectMap, "dataMasking", h.DataMasking) - populate(objectMap, "headers", h.Headers) + populate(objectMap, "properties", i.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPMessageDiagnostic. -func (h *HTTPMessageDiagnostic) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueUpdateContract. +func (i *IssueUpdateContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "body": - err = unpopulate(val, "Body", &h.Body) - delete(rawMsg, key) - case "dataMasking": - err = unpopulate(val, "DataMasking", &h.DataMasking) - delete(rawMsg, key) - case "headers": - err = unpopulate(val, "Headers", &h.Headers) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HostnameConfiguration. -func (h HostnameConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IssueUpdateContractProperties. +func (i IssueUpdateContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "certificate", h.Certificate) - populate(objectMap, "certificatePassword", h.CertificatePassword) - populate(objectMap, "certificateSource", h.CertificateSource) - populate(objectMap, "certificateStatus", h.CertificateStatus) - populate(objectMap, "defaultSslBinding", h.DefaultSSLBinding) - populate(objectMap, "encodedCertificate", h.EncodedCertificate) - populate(objectMap, "hostName", h.HostName) - populate(objectMap, "identityClientId", h.IdentityClientID) - populate(objectMap, "keyVaultId", h.KeyVaultID) - populate(objectMap, "negotiateClientCertificate", h.NegotiateClientCertificate) - populate(objectMap, "type", h.Type) + populate(objectMap, "apiId", i.APIID) + populateTimeRFC3339(objectMap, "createdDate", i.CreatedDate) + populate(objectMap, "description", i.Description) + populate(objectMap, "state", i.State) + populate(objectMap, "title", i.Title) + populate(objectMap, "userId", i.UserID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HostnameConfiguration. -func (h *HostnameConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueUpdateContractProperties. +func (i *IssueUpdateContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "certificate": - err = unpopulate(val, "Certificate", &h.Certificate) - delete(rawMsg, key) - case "certificatePassword": - err = unpopulate(val, "CertificatePassword", &h.CertificatePassword) + case "apiId": + err = unpopulate(val, "APIID", &i.APIID) delete(rawMsg, key) - case "certificateSource": - err = unpopulate(val, "CertificateSource", &h.CertificateSource) + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &i.CreatedDate) delete(rawMsg, key) - case "certificateStatus": - err = unpopulate(val, "CertificateStatus", &h.CertificateStatus) + case "description": + err = unpopulate(val, "Description", &i.Description) delete(rawMsg, key) - case "defaultSslBinding": - err = unpopulate(val, "DefaultSSLBinding", &h.DefaultSSLBinding) + case "state": + err = unpopulate(val, "State", &i.State) delete(rawMsg, key) - case "encodedCertificate": - err = unpopulate(val, "EncodedCertificate", &h.EncodedCertificate) + case "title": + err = unpopulate(val, "Title", &i.Title) delete(rawMsg, key) - case "hostName": - err = unpopulate(val, "HostName", &h.HostName) + case "userId": + err = unpopulate(val, "UserID", &i.UserID) delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KeyVaultContractCreateProperties. +func (k KeyVaultContractCreateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identityClientId", k.IdentityClientID) + populate(objectMap, "secretIdentifier", k.SecretIdentifier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultContractCreateProperties. +func (k *KeyVaultContractCreateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { case "identityClientId": - err = unpopulate(val, "IdentityClientID", &h.IdentityClientID) - delete(rawMsg, key) - case "keyVaultId": - err = unpopulate(val, "KeyVaultID", &h.KeyVaultID) - delete(rawMsg, key) - case "negotiateClientCertificate": - err = unpopulate(val, "NegotiateClientCertificate", &h.NegotiateClientCertificate) + err = unpopulate(val, "IdentityClientID", &k.IdentityClientID) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &h.Type) + case "secretIdentifier": + err = unpopulate(val, "SecretIdentifier", &k.SecretIdentifier) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IdentityProviderBaseParameters. -func (i IdentityProviderBaseParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type KeyVaultContractProperties. +func (k KeyVaultContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowedTenants", i.AllowedTenants) - populate(objectMap, "authority", i.Authority) - populate(objectMap, "passwordResetPolicyName", i.PasswordResetPolicyName) - populate(objectMap, "profileEditingPolicyName", i.ProfileEditingPolicyName) - populate(objectMap, "signinPolicyName", i.SigninPolicyName) - populate(objectMap, "signinTenant", i.SigninTenant) - populate(objectMap, "signupPolicyName", i.SignupPolicyName) - populate(objectMap, "type", i.Type) + populate(objectMap, "identityClientId", k.IdentityClientID) + populate(objectMap, "lastStatus", k.LastStatus) + populate(objectMap, "secretIdentifier", k.SecretIdentifier) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderBaseParameters. -func (i *IdentityProviderBaseParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultContractProperties. +func (k *KeyVaultContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } for key, val := range rawMsg { var err error switch key { - case "allowedTenants": - err = unpopulate(val, "AllowedTenants", &i.AllowedTenants) - delete(rawMsg, key) - case "authority": - err = unpopulate(val, "Authority", &i.Authority) - delete(rawMsg, key) - case "passwordResetPolicyName": - err = unpopulate(val, "PasswordResetPolicyName", &i.PasswordResetPolicyName) - delete(rawMsg, key) - case "profileEditingPolicyName": - err = unpopulate(val, "ProfileEditingPolicyName", &i.ProfileEditingPolicyName) - delete(rawMsg, key) - case "signinPolicyName": - err = unpopulate(val, "SigninPolicyName", &i.SigninPolicyName) - delete(rawMsg, key) - case "signinTenant": - err = unpopulate(val, "SigninTenant", &i.SigninTenant) + case "identityClientId": + err = unpopulate(val, "IdentityClientID", &k.IdentityClientID) delete(rawMsg, key) - case "signupPolicyName": - err = unpopulate(val, "SignupPolicyName", &i.SignupPolicyName) + case "lastStatus": + err = unpopulate(val, "LastStatus", &k.LastStatus) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) + case "secretIdentifier": + err = unpopulate(val, "SecretIdentifier", &k.SecretIdentifier) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IdentityProviderContract. -func (i IdentityProviderContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type KeyVaultLastAccessStatusContractProperties. +func (k KeyVaultLastAccessStatusContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) + populate(objectMap, "code", k.Code) + populate(objectMap, "message", k.Message) + populateTimeRFC3339(objectMap, "timeStampUtc", k.TimeStampUTC) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderContract. -func (i *IdentityProviderContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultLastAccessStatusContractProperties. +func (k *KeyVaultLastAccessStatusContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) + case "code": + err = unpopulate(val, "Code", &k.Code) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) + case "message": + err = unpopulate(val, "Message", &k.Message) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) + case "timeStampUtc": + err = unpopulateTimeRFC3339(val, "TimeStampUTC", &k.TimeStampUTC) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IdentityProviderContractProperties. -func (i IdentityProviderContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LoggerCollection. +func (l LoggerCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowedTenants", i.AllowedTenants) - populate(objectMap, "authority", i.Authority) - populate(objectMap, "clientId", i.ClientID) - populate(objectMap, "clientSecret", i.ClientSecret) - populate(objectMap, "passwordResetPolicyName", i.PasswordResetPolicyName) - populate(objectMap, "profileEditingPolicyName", i.ProfileEditingPolicyName) - populate(objectMap, "signinPolicyName", i.SigninPolicyName) - populate(objectMap, "signinTenant", i.SigninTenant) - populate(objectMap, "signupPolicyName", i.SignupPolicyName) - populate(objectMap, "type", i.Type) + populate(objectMap, "count", l.Count) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderContractProperties. -func (i *IdentityProviderContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LoggerCollection. +func (l *LoggerCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "allowedTenants": - err = unpopulate(val, "AllowedTenants", &i.AllowedTenants) - delete(rawMsg, key) - case "authority": - err = unpopulate(val, "Authority", &i.Authority) - delete(rawMsg, key) - case "clientId": - err = unpopulate(val, "ClientID", &i.ClientID) - delete(rawMsg, key) - case "clientSecret": - err = unpopulate(val, "ClientSecret", &i.ClientSecret) - delete(rawMsg, key) - case "passwordResetPolicyName": - err = unpopulate(val, "PasswordResetPolicyName", &i.PasswordResetPolicyName) - delete(rawMsg, key) - case "profileEditingPolicyName": - err = unpopulate(val, "ProfileEditingPolicyName", &i.ProfileEditingPolicyName) - delete(rawMsg, key) - case "signinPolicyName": - err = unpopulate(val, "SigninPolicyName", &i.SigninPolicyName) - delete(rawMsg, key) - case "signinTenant": - err = unpopulate(val, "SigninTenant", &i.SigninTenant) + case "count": + err = unpopulate(val, "Count", &l.Count) delete(rawMsg, key) - case "signupPolicyName": - err = unpopulate(val, "SignupPolicyName", &i.SignupPolicyName) + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) + case "value": + err = unpopulate(val, "Value", &l.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IdentityProviderCreateContract. -func (i IdentityProviderCreateContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LoggerContract. +func (l LoggerContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "type", l.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderCreateContract. -func (i *IdentityProviderCreateContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LoggerContract. +func (l *LoggerContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &i.ID) + err = unpopulate(val, "ID", &l.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &i.Name) + err = unpopulate(val, "Name", &l.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &i.Properties) + err = unpopulate(val, "Properties", &l.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &i.Type) + err = unpopulate(val, "Type", &l.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IdentityProviderCreateContractProperties. -func (i IdentityProviderCreateContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LoggerContractProperties. +func (l LoggerContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowedTenants", i.AllowedTenants) - populate(objectMap, "authority", i.Authority) - populate(objectMap, "clientId", i.ClientID) - populate(objectMap, "clientSecret", i.ClientSecret) - populate(objectMap, "passwordResetPolicyName", i.PasswordResetPolicyName) - populate(objectMap, "profileEditingPolicyName", i.ProfileEditingPolicyName) - populate(objectMap, "signinPolicyName", i.SigninPolicyName) - populate(objectMap, "signinTenant", i.SigninTenant) - populate(objectMap, "signupPolicyName", i.SignupPolicyName) - populate(objectMap, "type", i.Type) + populate(objectMap, "credentials", l.Credentials) + populate(objectMap, "description", l.Description) + populate(objectMap, "isBuffered", l.IsBuffered) + populate(objectMap, "loggerType", l.LoggerType) + populate(objectMap, "resourceId", l.ResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderCreateContractProperties. -func (i *IdentityProviderCreateContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LoggerContractProperties. +func (l *LoggerContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "allowedTenants": - err = unpopulate(val, "AllowedTenants", &i.AllowedTenants) - delete(rawMsg, key) - case "authority": - err = unpopulate(val, "Authority", &i.Authority) - delete(rawMsg, key) - case "clientId": - err = unpopulate(val, "ClientID", &i.ClientID) - delete(rawMsg, key) - case "clientSecret": - err = unpopulate(val, "ClientSecret", &i.ClientSecret) - delete(rawMsg, key) - case "passwordResetPolicyName": - err = unpopulate(val, "PasswordResetPolicyName", &i.PasswordResetPolicyName) - delete(rawMsg, key) - case "profileEditingPolicyName": - err = unpopulate(val, "ProfileEditingPolicyName", &i.ProfileEditingPolicyName) + case "credentials": + err = unpopulate(val, "Credentials", &l.Credentials) delete(rawMsg, key) - case "signinPolicyName": - err = unpopulate(val, "SigninPolicyName", &i.SigninPolicyName) + case "description": + err = unpopulate(val, "Description", &l.Description) delete(rawMsg, key) - case "signinTenant": - err = unpopulate(val, "SigninTenant", &i.SigninTenant) + case "isBuffered": + err = unpopulate(val, "IsBuffered", &l.IsBuffered) delete(rawMsg, key) - case "signupPolicyName": - err = unpopulate(val, "SignupPolicyName", &i.SignupPolicyName) + case "loggerType": + err = unpopulate(val, "LoggerType", &l.LoggerType) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) + case "resourceId": + err = unpopulate(val, "ResourceID", &l.ResourceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IdentityProviderList. -func (i IdentityProviderList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LoggerUpdateContract. +func (l LoggerUpdateContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", i.Count) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) + populate(objectMap, "properties", l.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderList. -func (i *IdentityProviderList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LoggerUpdateContract. +func (l *LoggerUpdateContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &i.Count) - delete(rawMsg, key) - case "nextLink": - err = unpopulate(val, "NextLink", &i.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &i.Value) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IdentityProviderUpdateParameters. -func (i IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LoggerUpdateParameters. +func (l LoggerUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", i.Properties) + populate(objectMap, "credentials", l.Credentials) + populate(objectMap, "description", l.Description) + populate(objectMap, "isBuffered", l.IsBuffered) + populate(objectMap, "loggerType", l.LoggerType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderUpdateParameters. -func (i *IdentityProviderUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LoggerUpdateParameters. +func (l *LoggerUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &i.Properties) + case "credentials": + err = unpopulate(val, "Credentials", &l.Credentials) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &l.Description) + delete(rawMsg, key) + case "isBuffered": + err = unpopulate(val, "IsBuffered", &l.IsBuffered) + delete(rawMsg, key) + case "loggerType": + err = unpopulate(val, "LoggerType", &l.LoggerType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IdentityProviderUpdateProperties. -func (i IdentityProviderUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NamedValueCollection. +func (n NamedValueCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowedTenants", i.AllowedTenants) - populate(objectMap, "authority", i.Authority) - populate(objectMap, "clientId", i.ClientID) - populate(objectMap, "clientSecret", i.ClientSecret) - populate(objectMap, "passwordResetPolicyName", i.PasswordResetPolicyName) - populate(objectMap, "profileEditingPolicyName", i.ProfileEditingPolicyName) - populate(objectMap, "signinPolicyName", i.SigninPolicyName) - populate(objectMap, "signinTenant", i.SigninTenant) - populate(objectMap, "signupPolicyName", i.SignupPolicyName) - populate(objectMap, "type", i.Type) + populate(objectMap, "count", n.Count) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderUpdateProperties. -func (i *IdentityProviderUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueCollection. +func (n *NamedValueCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "allowedTenants": - err = unpopulate(val, "AllowedTenants", &i.AllowedTenants) - delete(rawMsg, key) - case "authority": - err = unpopulate(val, "Authority", &i.Authority) - delete(rawMsg, key) - case "clientId": - err = unpopulate(val, "ClientID", &i.ClientID) - delete(rawMsg, key) - case "clientSecret": - err = unpopulate(val, "ClientSecret", &i.ClientSecret) - delete(rawMsg, key) - case "passwordResetPolicyName": - err = unpopulate(val, "PasswordResetPolicyName", &i.PasswordResetPolicyName) - delete(rawMsg, key) - case "profileEditingPolicyName": - err = unpopulate(val, "ProfileEditingPolicyName", &i.ProfileEditingPolicyName) - delete(rawMsg, key) - case "signinPolicyName": - err = unpopulate(val, "SigninPolicyName", &i.SigninPolicyName) - delete(rawMsg, key) - case "signinTenant": - err = unpopulate(val, "SigninTenant", &i.SigninTenant) + case "count": + err = unpopulate(val, "Count", &n.Count) delete(rawMsg, key) - case "signupPolicyName": - err = unpopulate(val, "SignupPolicyName", &i.SignupPolicyName) + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) + case "value": + err = unpopulate(val, "Value", &n.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IssueAttachmentCollection. -func (i IssueAttachmentCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NamedValueContract. +func (n NamedValueContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", i.Count) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IssueAttachmentCollection. -func (i *IssueAttachmentCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueContract. +func (n *NamedValueContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &i.Count) + case "id": + err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) - case "nextLink": - err = unpopulate(val, "NextLink", &i.NextLink) + case "name": + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &i.Value) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IssueAttachmentContract. -func (i IssueAttachmentContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NamedValueContractProperties. +func (n NamedValueContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) + populate(objectMap, "displayName", n.DisplayName) + populate(objectMap, "keyVault", n.KeyVault) + populate(objectMap, "secret", n.Secret) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IssueAttachmentContract. -func (i *IssueAttachmentContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueContractProperties. +func (n *NamedValueContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &i.ID) + case "displayName": + err = unpopulate(val, "DisplayName", &n.DisplayName) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) + case "keyVault": + err = unpopulate(val, "KeyVault", &n.KeyVault) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) + case "secret": + err = unpopulate(val, "Secret", &n.Secret) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IssueAttachmentContractProperties. -func (i IssueAttachmentContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NamedValueCreateContract. +func (n NamedValueCreateContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "content", i.Content) - populate(objectMap, "contentFormat", i.ContentFormat) - populate(objectMap, "title", i.Title) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IssueAttachmentContractProperties. -func (i *IssueAttachmentContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueCreateContract. +func (n *NamedValueCreateContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "content": - err = unpopulate(val, "Content", &i.Content) + case "id": + err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) - case "contentFormat": - err = unpopulate(val, "ContentFormat", &i.ContentFormat) + case "name": + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) - case "title": - err = unpopulate(val, "Title", &i.Title) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IssueCollection. -func (i IssueCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NamedValueCreateContractProperties. +func (n NamedValueCreateContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", i.Count) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) + populate(objectMap, "displayName", n.DisplayName) + populate(objectMap, "keyVault", n.KeyVault) + populate(objectMap, "secret", n.Secret) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IssueCollection. -func (i *IssueCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueCreateContractProperties. +func (n *NamedValueCreateContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &i.Count) + case "displayName": + err = unpopulate(val, "DisplayName", &n.DisplayName) delete(rawMsg, key) - case "nextLink": - err = unpopulate(val, "NextLink", &i.NextLink) + case "keyVault": + err = unpopulate(val, "KeyVault", &n.KeyVault) + delete(rawMsg, key) + case "secret": + err = unpopulate(val, "Secret", &n.Secret) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &i.Value) + err = unpopulate(val, "Value", &n.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IssueCommentCollection. -func (i IssueCommentCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NamedValueEntityBaseParameters. +func (n NamedValueEntityBaseParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", i.Count) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) + populate(objectMap, "secret", n.Secret) + populate(objectMap, "tags", n.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IssueCommentCollection. -func (i *IssueCommentCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueEntityBaseParameters. +func (n *NamedValueEntityBaseParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &i.Count) - delete(rawMsg, key) - case "nextLink": - err = unpopulate(val, "NextLink", &i.NextLink) + case "secret": + err = unpopulate(val, "Secret", &n.Secret) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &i.Value) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IssueCommentContract. -func (i IssueCommentContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NamedValueSecretContract. +func (n NamedValueSecretContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) + populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IssueCommentContract. -func (i *IssueCommentContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueSecretContract. +func (n *NamedValueSecretContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) + case "value": + err = unpopulate(val, "Value", &n.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IssueCommentContractProperties. -func (i IssueCommentContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NamedValueUpdateParameterProperties. +func (n NamedValueUpdateParameterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "createdDate", i.CreatedDate) - populate(objectMap, "text", i.Text) - populate(objectMap, "userId", i.UserID) + populate(objectMap, "displayName", n.DisplayName) + populate(objectMap, "keyVault", n.KeyVault) + populate(objectMap, "secret", n.Secret) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IssueCommentContractProperties. -func (i *IssueCommentContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueUpdateParameterProperties. +func (n *NamedValueUpdateParameterProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &i.CreatedDate) + case "displayName": + err = unpopulate(val, "DisplayName", &n.DisplayName) delete(rawMsg, key) - case "text": - err = unpopulate(val, "Text", &i.Text) + case "keyVault": + err = unpopulate(val, "KeyVault", &n.KeyVault) delete(rawMsg, key) - case "userId": - err = unpopulate(val, "UserID", &i.UserID) + case "secret": + err = unpopulate(val, "Secret", &n.Secret) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IssueContract. -func (i IssueContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NamedValueUpdateParameters. +func (n NamedValueUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) + populate(objectMap, "properties", n.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IssueContract. -func (i *IssueContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueUpdateParameters. +func (n *NamedValueUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) + err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IssueContractBaseProperties. -func (i IssueContractBaseProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkStatusContract. +func (n NetworkStatusContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "apiId", i.APIID) - populateTimeRFC3339(objectMap, "createdDate", i.CreatedDate) - populate(objectMap, "state", i.State) + populate(objectMap, "connectivityStatus", n.ConnectivityStatus) + populate(objectMap, "dnsServers", n.DNSServers) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IssueContractBaseProperties. -func (i *IssueContractBaseProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkStatusContract. +func (n *NetworkStatusContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "apiId": - err = unpopulate(val, "APIID", &i.APIID) - delete(rawMsg, key) - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &i.CreatedDate) + case "connectivityStatus": + err = unpopulate(val, "ConnectivityStatus", &n.ConnectivityStatus) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &i.State) + case "dnsServers": + err = unpopulate(val, "DNSServers", &n.DNSServers) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IssueContractProperties. -func (i IssueContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NetworkStatusContractByLocation. +func (n NetworkStatusContractByLocation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "apiId", i.APIID) - populateTimeRFC3339(objectMap, "createdDate", i.CreatedDate) - populate(objectMap, "description", i.Description) - populate(objectMap, "state", i.State) - populate(objectMap, "title", i.Title) - populate(objectMap, "userId", i.UserID) + populate(objectMap, "location", n.Location) + populate(objectMap, "networkStatus", n.NetworkStatus) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IssueContractProperties. -func (i *IssueContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkStatusContractByLocation. +func (n *NetworkStatusContractByLocation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "apiId": - err = unpopulate(val, "APIID", &i.APIID) - delete(rawMsg, key) - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &i.CreatedDate) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &i.Description) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &i.State) - delete(rawMsg, key) - case "title": - err = unpopulate(val, "Title", &i.Title) + case "location": + err = unpopulate(val, "Location", &n.Location) delete(rawMsg, key) - case "userId": - err = unpopulate(val, "UserID", &i.UserID) + case "networkStatus": + err = unpopulate(val, "NetworkStatus", &n.NetworkStatus) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IssueUpdateContract. -func (i IssueUpdateContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotificationCollection. +func (n NotificationCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", i.Properties) + populate(objectMap, "count", n.Count) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IssueUpdateContract. -func (i *IssueUpdateContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationCollection. +func (n *NotificationCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &i.Properties) + case "count": + err = unpopulate(val, "Count", &n.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IssueUpdateContractProperties. -func (i IssueUpdateContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotificationContract. +func (n NotificationContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "apiId", i.APIID) - populateTimeRFC3339(objectMap, "createdDate", i.CreatedDate) - populate(objectMap, "description", i.Description) - populate(objectMap, "state", i.State) - populate(objectMap, "title", i.Title) - populate(objectMap, "userId", i.UserID) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IssueUpdateContractProperties. -func (i *IssueUpdateContractProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "apiId": - err = unpopulate(val, "APIID", &i.APIID) - delete(rawMsg, key) - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &i.CreatedDate) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &i.Description) +// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationContract. +func (n *NotificationContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &i.State) + case "name": + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) - case "title": - err = unpopulate(val, "Title", &i.Title) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) - case "userId": - err = unpopulate(val, "UserID", &i.UserID) + case "type": + err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type KeyVaultContractCreateProperties. -func (k KeyVaultContractCreateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NotificationContractProperties. +func (n NotificationContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identityClientId", k.IdentityClientID) - populate(objectMap, "secretIdentifier", k.SecretIdentifier) + populate(objectMap, "description", n.Description) + populate(objectMap, "recipients", n.Recipients) + populate(objectMap, "title", n.Title) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultContractCreateProperties. -func (k *KeyVaultContractCreateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationContractProperties. +func (n *NotificationContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "identityClientId": - err = unpopulate(val, "IdentityClientID", &k.IdentityClientID) + case "description": + err = unpopulate(val, "Description", &n.Description) delete(rawMsg, key) - case "secretIdentifier": - err = unpopulate(val, "SecretIdentifier", &k.SecretIdentifier) + case "recipients": + err = unpopulate(val, "Recipients", &n.Recipients) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &n.Title) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type KeyVaultContractProperties. -func (k KeyVaultContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OAuth2AuthenticationSettingsContract. +func (o OAuth2AuthenticationSettingsContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identityClientId", k.IdentityClientID) - populate(objectMap, "lastStatus", k.LastStatus) - populate(objectMap, "secretIdentifier", k.SecretIdentifier) + populate(objectMap, "authorizationServerId", o.AuthorizationServerID) + populate(objectMap, "scope", o.Scope) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultContractProperties. -func (k *KeyVaultContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OAuth2AuthenticationSettingsContract. +func (o *OAuth2AuthenticationSettingsContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "identityClientId": - err = unpopulate(val, "IdentityClientID", &k.IdentityClientID) - delete(rawMsg, key) - case "lastStatus": - err = unpopulate(val, "LastStatus", &k.LastStatus) + case "authorizationServerId": + err = unpopulate(val, "AuthorizationServerID", &o.AuthorizationServerID) delete(rawMsg, key) - case "secretIdentifier": - err = unpopulate(val, "SecretIdentifier", &k.SecretIdentifier) + case "scope": + err = unpopulate(val, "Scope", &o.Scope) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type KeyVaultLastAccessStatusContractProperties. -func (k KeyVaultLastAccessStatusContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OpenIDAuthenticationSettingsContract. +func (o OpenIDAuthenticationSettingsContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "code", k.Code) - populate(objectMap, "message", k.Message) - populateTimeRFC3339(objectMap, "timeStampUtc", k.TimeStampUTC) + populate(objectMap, "bearerTokenSendingMethods", o.BearerTokenSendingMethods) + populate(objectMap, "openidProviderId", o.OpenidProviderID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultLastAccessStatusContractProperties. -func (k *KeyVaultLastAccessStatusContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenIDAuthenticationSettingsContract. +func (o *OpenIDAuthenticationSettingsContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "code": - err = unpopulate(val, "Code", &k.Code) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &k.Message) + case "bearerTokenSendingMethods": + err = unpopulate(val, "BearerTokenSendingMethods", &o.BearerTokenSendingMethods) delete(rawMsg, key) - case "timeStampUtc": - err = unpopulateTimeRFC3339(val, "TimeStampUTC", &k.TimeStampUTC) + case "openidProviderId": + err = unpopulate(val, "OpenidProviderID", &o.OpenidProviderID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LoggerCollection. -func (l LoggerCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OpenIDConnectProviderCollection. +func (o OpenIDConnectProviderCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", l.Count) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) + populate(objectMap, "count", o.Count) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LoggerCollection. -func (l *LoggerCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenIDConnectProviderCollection. +func (o *OpenIDConnectProviderCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "count": - err = unpopulate(val, "Count", &l.Count) + err = unpopulate(val, "Count", &o.Count) delete(rawMsg, key) case "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &l.Value) + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LoggerContract. -func (l LoggerContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OpenidConnectProviderContract. +func (o OpenidConnectProviderContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", l.ID) - populate(objectMap, "name", l.Name) - populate(objectMap, "properties", l.Properties) - populate(objectMap, "type", l.Type) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "type", o.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LoggerContract. -func (l *LoggerContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenidConnectProviderContract. +func (o *OpenidConnectProviderContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &l.ID) + err = unpopulate(val, "ID", &o.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &l.Name) + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &l.Properties) + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &l.Type) + err = unpopulate(val, "Type", &o.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LoggerContractProperties. -func (l LoggerContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OpenidConnectProviderContractProperties. +func (o OpenidConnectProviderContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "credentials", l.Credentials) - populate(objectMap, "description", l.Description) - populate(objectMap, "isBuffered", l.IsBuffered) - populate(objectMap, "loggerType", l.LoggerType) - populate(objectMap, "resourceId", l.ResourceID) + populate(objectMap, "clientId", o.ClientID) + populate(objectMap, "clientSecret", o.ClientSecret) + populate(objectMap, "description", o.Description) + populate(objectMap, "displayName", o.DisplayName) + populate(objectMap, "metadataEndpoint", o.MetadataEndpoint) + populate(objectMap, "useInApiDocumentation", o.UseInAPIDocumentation) + populate(objectMap, "useInTestConsole", o.UseInTestConsole) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LoggerContractProperties. -func (l *LoggerContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenidConnectProviderContractProperties. +func (o *OpenidConnectProviderContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "credentials": - err = unpopulate(val, "Credentials", &l.Credentials) + case "clientId": + err = unpopulate(val, "ClientID", &o.ClientID) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &o.ClientSecret) delete(rawMsg, key) case "description": - err = unpopulate(val, "Description", &l.Description) + err = unpopulate(val, "Description", &o.Description) delete(rawMsg, key) - case "isBuffered": - err = unpopulate(val, "IsBuffered", &l.IsBuffered) + case "displayName": + err = unpopulate(val, "DisplayName", &o.DisplayName) delete(rawMsg, key) - case "loggerType": - err = unpopulate(val, "LoggerType", &l.LoggerType) + case "metadataEndpoint": + err = unpopulate(val, "MetadataEndpoint", &o.MetadataEndpoint) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &l.ResourceID) + case "useInApiDocumentation": + err = unpopulate(val, "UseInAPIDocumentation", &o.UseInAPIDocumentation) + delete(rawMsg, key) + case "useInTestConsole": + err = unpopulate(val, "UseInTestConsole", &o.UseInTestConsole) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LoggerUpdateContract. -func (l LoggerUpdateContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OpenidConnectProviderUpdateContract. +func (o OpenidConnectProviderUpdateContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", l.Properties) + populate(objectMap, "properties", o.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LoggerUpdateContract. -func (l *LoggerUpdateContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenidConnectProviderUpdateContract. +func (o *OpenidConnectProviderUpdateContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "properties": - err = unpopulate(val, "Properties", &l.Properties) + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OpenidConnectProviderUpdateContractProperties. +func (o OpenidConnectProviderUpdateContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", o.ClientID) + populate(objectMap, "clientSecret", o.ClientSecret) + populate(objectMap, "description", o.Description) + populate(objectMap, "displayName", o.DisplayName) + populate(objectMap, "metadataEndpoint", o.MetadataEndpoint) + populate(objectMap, "useInApiDocumentation", o.UseInAPIDocumentation) + populate(objectMap, "useInTestConsole", o.UseInTestConsole) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenidConnectProviderUpdateContractProperties. +func (o *OpenidConnectProviderUpdateContractProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &o.ClientID) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &o.ClientSecret) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &o.DisplayName) + delete(rawMsg, key) + case "metadataEndpoint": + err = unpopulate(val, "MetadataEndpoint", &o.MetadataEndpoint) + delete(rawMsg, key) + case "useInApiDocumentation": + err = unpopulate(val, "UseInAPIDocumentation", &o.UseInAPIDocumentation) + delete(rawMsg, key) + case "useInTestConsole": + err = unpopulate(val, "UseInTestConsole", &o.UseInTestConsole) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LoggerUpdateParameters. -func (l LoggerUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "credentials", l.Credentials) - populate(objectMap, "description", l.Description) - populate(objectMap, "isBuffered", l.IsBuffered) - populate(objectMap, "loggerType", l.LoggerType) + populate(objectMap, "display", o.Display) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populateAny(objectMap, "properties", o.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LoggerUpdateParameters. -func (l *LoggerUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "credentials": - err = unpopulate(val, "Credentials", &l.Credentials) + case "display": + err = unpopulate(val, "Display", &o.Display) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &l.Description) + case "name": + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) - case "isBuffered": - err = unpopulate(val, "IsBuffered", &l.IsBuffered) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) delete(rawMsg, key) - case "loggerType": - err = unpopulate(val, "LoggerType", &l.LoggerType) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NamedValueCollection. -func (n NamedValueCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationCollection. +func (o OperationCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", n.Count) - populate(objectMap, "nextLink", n.NextLink) - populate(objectMap, "value", n.Value) + populate(objectMap, "count", o.Count) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueCollection. -func (n *NamedValueCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationCollection. +func (o *OperationCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "count": - err = unpopulate(val, "Count", &n.Count) + err = unpopulate(val, "Count", &o.Count) delete(rawMsg, key) case "nextLink": - err = unpopulate(val, "NextLink", &n.NextLink) + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &n.Value) + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NamedValueContract. -func (n NamedValueContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationContract. +func (o OperationContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", n.ID) - populate(objectMap, "name", n.Name) - populate(objectMap, "properties", n.Properties) - populate(objectMap, "type", n.Type) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "type", o.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueContract. -func (n *NamedValueContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationContract. +func (o *OperationContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &n.ID) + err = unpopulate(val, "ID", &o.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &n.Name) + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &n.Properties) + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &n.Type) + err = unpopulate(val, "Type", &o.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NamedValueContractProperties. -func (n NamedValueContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationContractProperties. +func (o OperationContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "displayName", n.DisplayName) - populate(objectMap, "keyVault", n.KeyVault) - populate(objectMap, "secret", n.Secret) - populate(objectMap, "tags", n.Tags) - populate(objectMap, "value", n.Value) + populate(objectMap, "description", o.Description) + populate(objectMap, "displayName", o.DisplayName) + populate(objectMap, "method", o.Method) + populate(objectMap, "policies", o.Policies) + populate(objectMap, "request", o.Request) + populate(objectMap, "responses", o.Responses) + populate(objectMap, "templateParameters", o.TemplateParameters) + populate(objectMap, "urlTemplate", o.URLTemplate) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueContractProperties. -func (n *NamedValueContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationContractProperties. +func (o *OperationContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) case "displayName": - err = unpopulate(val, "DisplayName", &n.DisplayName) + err = unpopulate(val, "DisplayName", &o.DisplayName) delete(rawMsg, key) - case "keyVault": - err = unpopulate(val, "KeyVault", &n.KeyVault) + case "method": + err = unpopulate(val, "Method", &o.Method) delete(rawMsg, key) - case "secret": - err = unpopulate(val, "Secret", &n.Secret) + case "policies": + err = unpopulate(val, "Policies", &o.Policies) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &n.Tags) + case "request": + err = unpopulate(val, "Request", &o.Request) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) + case "responses": + err = unpopulate(val, "Responses", &o.Responses) + delete(rawMsg, key) + case "templateParameters": + err = unpopulate(val, "TemplateParameters", &o.TemplateParameters) + delete(rawMsg, key) + case "urlTemplate": + err = unpopulate(val, "URLTemplate", &o.URLTemplate) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NamedValueCreateContract. -func (n NamedValueCreateContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", n.ID) - populate(objectMap, "name", n.Name) - populate(objectMap, "properties", n.Properties) - populate(objectMap, "type", n.Type) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueCreateContract. -func (n *NamedValueCreateContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &n.ID) + case "description": + err = unpopulate(val, "Description", &o.Description) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &n.Name) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &n.Properties) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &n.Type) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NamedValueCreateContractProperties. -func (n NamedValueCreateContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationEntityBaseContract. +func (o OperationEntityBaseContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "displayName", n.DisplayName) - populate(objectMap, "keyVault", n.KeyVault) - populate(objectMap, "secret", n.Secret) - populate(objectMap, "tags", n.Tags) - populate(objectMap, "value", n.Value) + populate(objectMap, "description", o.Description) + populate(objectMap, "policies", o.Policies) + populate(objectMap, "request", o.Request) + populate(objectMap, "responses", o.Responses) + populate(objectMap, "templateParameters", o.TemplateParameters) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueCreateContractProperties. -func (n *NamedValueCreateContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationEntityBaseContract. +func (o *OperationEntityBaseContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "displayName": - err = unpopulate(val, "DisplayName", &n.DisplayName) + case "description": + err = unpopulate(val, "Description", &o.Description) delete(rawMsg, key) - case "keyVault": - err = unpopulate(val, "KeyVault", &n.KeyVault) + case "policies": + err = unpopulate(val, "Policies", &o.Policies) delete(rawMsg, key) - case "secret": - err = unpopulate(val, "Secret", &n.Secret) + case "request": + err = unpopulate(val, "Request", &o.Request) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &n.Tags) + case "responses": + err = unpopulate(val, "Responses", &o.Responses) + delete(rawMsg, key) + case "templateParameters": + err = unpopulate(val, "TemplateParameters", &o.TemplateParameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &n.Value) + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NamedValueEntityBaseParameters. -func (n NamedValueEntityBaseParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationResultContract. +func (o OperationResultContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "secret", n.Secret) - populate(objectMap, "tags", n.Tags) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "type", o.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueEntityBaseParameters. -func (n *NamedValueEntityBaseParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultContract. +func (o *OperationResultContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "secret": - err = unpopulate(val, "Secret", &n.Secret) + case "id": + err = unpopulate(val, "ID", &o.ID) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &n.Tags) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NamedValueSecretContract. -func (n NamedValueSecretContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationResultContractProperties. +func (o OperationResultContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", n.Value) + populate(objectMap, "actionLog", o.ActionLog) + populate(objectMap, "error", o.Error) + populate(objectMap, "id", o.ID) + populate(objectMap, "resultInfo", o.ResultInfo) + populateTimeRFC3339(objectMap, "started", o.Started) + populate(objectMap, "status", o.Status) + populateTimeRFC3339(objectMap, "updated", o.Updated) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueSecretContract. -func (n *NamedValueSecretContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultContractProperties. +func (o *OperationResultContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &n.Value) + case "actionLog": + err = unpopulate(val, "ActionLog", &o.ActionLog) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &o.Error) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "resultInfo": + err = unpopulate(val, "ResultInfo", &o.ResultInfo) + delete(rawMsg, key) + case "started": + err = unpopulateTimeRFC3339(val, "Started", &o.Started) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &o.Status) + delete(rawMsg, key) + case "updated": + err = unpopulateTimeRFC3339(val, "Updated", &o.Updated) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NamedValueUpdateParameterProperties. -func (n NamedValueUpdateParameterProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationResultLogItemContract. +func (o OperationResultLogItemContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "displayName", n.DisplayName) - populate(objectMap, "keyVault", n.KeyVault) - populate(objectMap, "secret", n.Secret) - populate(objectMap, "tags", n.Tags) - populate(objectMap, "value", n.Value) + populate(objectMap, "action", o.Action) + populate(objectMap, "objectKey", o.ObjectKey) + populate(objectMap, "objectType", o.ObjectType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueUpdateParameterProperties. -func (n *NamedValueUpdateParameterProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultLogItemContract. +func (o *OperationResultLogItemContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "displayName": - err = unpopulate(val, "DisplayName", &n.DisplayName) - delete(rawMsg, key) - case "keyVault": - err = unpopulate(val, "KeyVault", &n.KeyVault) - delete(rawMsg, key) - case "secret": - err = unpopulate(val, "Secret", &n.Secret) + case "action": + err = unpopulate(val, "Action", &o.Action) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &n.Tags) + case "objectKey": + err = unpopulate(val, "ObjectKey", &o.ObjectKey) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) + case "objectType": + err = unpopulate(val, "ObjectType", &o.ObjectType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NamedValueUpdateParameters. -func (n NamedValueUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationTagResourceContractProperties. +func (o OperationTagResourceContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", n.Properties) + populate(objectMap, "apiName", o.APIName) + populate(objectMap, "apiRevision", o.APIRevision) + populate(objectMap, "apiVersion", o.APIVersion) + populate(objectMap, "description", o.Description) + populate(objectMap, "id", o.ID) + populate(objectMap, "method", o.Method) + populate(objectMap, "name", o.Name) + populate(objectMap, "urlTemplate", o.URLTemplate) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueUpdateParameters. -func (n *NamedValueUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationTagResourceContractProperties. +func (o *OperationTagResourceContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &n.Properties) + case "apiName": + err = unpopulate(val, "APIName", &o.APIName) + delete(rawMsg, key) + case "apiRevision": + err = unpopulate(val, "APIRevision", &o.APIRevision) + delete(rawMsg, key) + case "apiVersion": + err = unpopulate(val, "APIVersion", &o.APIVersion) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "method": + err = unpopulate(val, "Method", &o.Method) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "urlTemplate": + err = unpopulate(val, "URLTemplate", &o.URLTemplate) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkStatusContract. -func (n NetworkStatusContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationUpdateContract. +func (o OperationUpdateContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "connectivityStatus", n.ConnectivityStatus) - populate(objectMap, "dnsServers", n.DNSServers) + populate(objectMap, "properties", o.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkStatusContract. -func (n *NetworkStatusContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationUpdateContract. +func (o *OperationUpdateContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "connectivityStatus": - err = unpopulate(val, "ConnectivityStatus", &n.ConnectivityStatus) - delete(rawMsg, key) - case "dnsServers": - err = unpopulate(val, "DNSServers", &n.DNSServers) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NetworkStatusContractByLocation. -func (n NetworkStatusContractByLocation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationUpdateContractProperties. +func (o OperationUpdateContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "location", n.Location) - populate(objectMap, "networkStatus", n.NetworkStatus) + populate(objectMap, "description", o.Description) + populate(objectMap, "displayName", o.DisplayName) + populate(objectMap, "method", o.Method) + populate(objectMap, "policies", o.Policies) + populate(objectMap, "request", o.Request) + populate(objectMap, "responses", o.Responses) + populate(objectMap, "templateParameters", o.TemplateParameters) + populate(objectMap, "urlTemplate", o.URLTemplate) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkStatusContractByLocation. -func (n *NetworkStatusContractByLocation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationUpdateContractProperties. +func (o *OperationUpdateContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "location": - err = unpopulate(val, "Location", &n.Location) + case "description": + err = unpopulate(val, "Description", &o.Description) delete(rawMsg, key) - case "networkStatus": - err = unpopulate(val, "NetworkStatus", &n.NetworkStatus) + case "displayName": + err = unpopulate(val, "DisplayName", &o.DisplayName) + delete(rawMsg, key) + case "method": + err = unpopulate(val, "Method", &o.Method) + delete(rawMsg, key) + case "policies": + err = unpopulate(val, "Policies", &o.Policies) + delete(rawMsg, key) + case "request": + err = unpopulate(val, "Request", &o.Request) + delete(rawMsg, key) + case "responses": + err = unpopulate(val, "Responses", &o.Responses) + delete(rawMsg, key) + case "templateParameters": + err = unpopulate(val, "TemplateParameters", &o.TemplateParameters) + delete(rawMsg, key) + case "urlTemplate": + err = unpopulate(val, "URLTemplate", &o.URLTemplate) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NotificationCollection. -func (n NotificationCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpoint. +func (o OutboundEnvironmentEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", n.Count) - populate(objectMap, "nextLink", n.NextLink) - populate(objectMap, "value", n.Value) + populate(objectMap, "category", o.Category) + populate(objectMap, "endpoints", o.Endpoints) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationCollection. -func (n *NotificationCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpoint. +func (o *OutboundEnvironmentEndpoint) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &n.Count) - delete(rawMsg, key) - case "nextLink": - err = unpopulate(val, "NextLink", &n.NextLink) + case "category": + err = unpopulate(val, "Category", &o.Category) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &n.Value) + case "endpoints": + err = unpopulate(val, "Endpoints", &o.Endpoints) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NotificationContract. -func (n NotificationContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpointList. +func (o OutboundEnvironmentEndpointList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", n.ID) - populate(objectMap, "name", n.Name) - populate(objectMap, "properties", n.Properties) - populate(objectMap, "type", n.Type) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationContract. -func (n *NotificationContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpointList. +func (o *OutboundEnvironmentEndpointList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &n.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &n.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &n.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &n.Type) + case "value": + err = unpopulate(val, "Value", &o.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NotificationContractProperties. -func (n NotificationContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ParameterContract. +func (p ParameterContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", n.Description) - populate(objectMap, "recipients", n.Recipients) - populate(objectMap, "title", n.Title) + populate(objectMap, "defaultValue", p.DefaultValue) + populate(objectMap, "description", p.Description) + populate(objectMap, "examples", p.Examples) + populate(objectMap, "name", p.Name) + populate(objectMap, "required", p.Required) + populate(objectMap, "schemaId", p.SchemaID) + populate(objectMap, "type", p.Type) + populate(objectMap, "typeName", p.TypeName) + populate(objectMap, "values", p.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationContractProperties. -func (n *NotificationContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ParameterContract. +func (p *ParameterContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { + case "defaultValue": + err = unpopulate(val, "DefaultValue", &p.DefaultValue) + delete(rawMsg, key) case "description": - err = unpopulate(val, "Description", &n.Description) + err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) - case "recipients": - err = unpopulate(val, "Recipients", &n.Recipients) + case "examples": + err = unpopulate(val, "Examples", &p.Examples) delete(rawMsg, key) - case "title": - err = unpopulate(val, "Title", &n.Title) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "required": + err = unpopulate(val, "Required", &p.Required) + delete(rawMsg, key) + case "schemaId": + err = unpopulate(val, "SchemaID", &p.SchemaID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &p.TypeName) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &p.Values) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OAuth2AuthenticationSettingsContract. -func (o OAuth2AuthenticationSettingsContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ParameterExampleContract. +func (p ParameterExampleContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "authorizationServerId", o.AuthorizationServerID) - populate(objectMap, "scope", o.Scope) + populate(objectMap, "description", p.Description) + populate(objectMap, "externalValue", p.ExternalValue) + populate(objectMap, "summary", p.Summary) + populateAny(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OAuth2AuthenticationSettingsContract. -func (o *OAuth2AuthenticationSettingsContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ParameterExampleContract. +func (p *ParameterExampleContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "authorizationServerId": - err = unpopulate(val, "AuthorizationServerID", &o.AuthorizationServerID) + case "description": + err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) - case "scope": - err = unpopulate(val, "Scope", &o.Scope) + case "externalValue": + err = unpopulate(val, "ExternalValue", &p.ExternalValue) + delete(rawMsg, key) + case "summary": + err = unpopulate(val, "Summary", &p.Summary) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OpenIDAuthenticationSettingsContract. -func (o OpenIDAuthenticationSettingsContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PipelineDiagnosticSettings. +func (p PipelineDiagnosticSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "bearerTokenSendingMethods", o.BearerTokenSendingMethods) - populate(objectMap, "openidProviderId", o.OpenidProviderID) + populate(objectMap, "request", p.Request) + populate(objectMap, "response", p.Response) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OpenIDAuthenticationSettingsContract. -func (o *OpenIDAuthenticationSettingsContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineDiagnosticSettings. +func (p *PipelineDiagnosticSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "bearerTokenSendingMethods": - err = unpopulate(val, "BearerTokenSendingMethods", &o.BearerTokenSendingMethods) + case "request": + err = unpopulate(val, "Request", &p.Request) delete(rawMsg, key) - case "openidProviderId": - err = unpopulate(val, "OpenidProviderID", &o.OpenidProviderID) + case "response": + err = unpopulate(val, "Response", &p.Response) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OpenIDConnectProviderCollection. -func (o OpenIDConnectProviderCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PolicyCollection. +func (p PolicyCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", o.Count) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) + populate(objectMap, "count", p.Count) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OpenIDConnectProviderCollection. -func (o *OpenIDConnectProviderCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyCollection. +func (p *PolicyCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "count": - err = unpopulate(val, "Count", &o.Count) + err = unpopulate(val, "Count", &p.Count) delete(rawMsg, key) case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &o.Value) + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OpenidConnectProviderContract. -func (o OpenidConnectProviderContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PolicyContract. +func (p PolicyContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", o.ID) - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "type", o.Type) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OpenidConnectProviderContract. -func (o *OpenidConnectProviderContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyContract. +func (p *PolicyContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &o.ID) + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &o.Name) + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &o.Properties) + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &o.Type) + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OpenidConnectProviderContractProperties. -func (o OpenidConnectProviderContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PolicyContractProperties. +func (p PolicyContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientId", o.ClientID) - populate(objectMap, "clientSecret", o.ClientSecret) - populate(objectMap, "description", o.Description) - populate(objectMap, "displayName", o.DisplayName) - populate(objectMap, "metadataEndpoint", o.MetadataEndpoint) + populate(objectMap, "format", p.Format) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OpenidConnectProviderContractProperties. -func (o *OpenidConnectProviderContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyContractProperties. +func (p *PolicyContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "clientId": - err = unpopulate(val, "ClientID", &o.ClientID) - delete(rawMsg, key) - case "clientSecret": - err = unpopulate(val, "ClientSecret", &o.ClientSecret) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &o.DisplayName) + case "format": + err = unpopulate(val, "Format", &p.Format) delete(rawMsg, key) - case "metadataEndpoint": - err = unpopulate(val, "MetadataEndpoint", &o.MetadataEndpoint) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OpenidConnectProviderUpdateContract. -func (o OpenidConnectProviderUpdateContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PolicyDescriptionCollection. +func (p PolicyDescriptionCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", o.Properties) + populate(objectMap, "count", p.Count) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OpenidConnectProviderUpdateContract. -func (o *OpenidConnectProviderUpdateContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyDescriptionCollection. +func (p *PolicyDescriptionCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &o.Properties) + case "count": + err = unpopulate(val, "Count", &p.Count) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OpenidConnectProviderUpdateContractProperties. -func (o OpenidConnectProviderUpdateContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PolicyDescriptionContract. +func (p PolicyDescriptionContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientId", o.ClientID) - populate(objectMap, "clientSecret", o.ClientSecret) - populate(objectMap, "description", o.Description) - populate(objectMap, "displayName", o.DisplayName) - populate(objectMap, "metadataEndpoint", o.MetadataEndpoint) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OpenidConnectProviderUpdateContractProperties. -func (o *OpenidConnectProviderUpdateContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyDescriptionContract. +func (p *PolicyDescriptionContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "clientId": - err = unpopulate(val, "ClientID", &o.ClientID) - delete(rawMsg, key) - case "clientSecret": - err = unpopulate(val, "ClientSecret", &o.ClientSecret) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &o.Description) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &o.DisplayName) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) - case "metadataEndpoint": - err = unpopulate(val, "MetadataEndpoint", &o.MetadataEndpoint) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Operation. -func (o Operation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PolicyDescriptionContractProperties. +func (p PolicyDescriptionContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "display", o.Display) - populate(objectMap, "name", o.Name) - populate(objectMap, "origin", o.Origin) - populateAny(objectMap, "properties", o.Properties) + populate(objectMap, "description", p.Description) + populate(objectMap, "scope", p.Scope) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. -func (o *Operation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyDescriptionContractProperties. +func (p *PolicyDescriptionContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "display": - err = unpopulate(val, "Display", &o.Display) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &o.Origin) + case "description": + err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) + case "scope": + err = unpopulate(val, "Scope", &p.Scope) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationCollection. -func (o OperationCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PolicyFragmentCollection. +func (p PolicyFragmentCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", o.Count) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) + populate(objectMap, "count", p.Count) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationCollection. -func (o *OperationCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyFragmentCollection. +func (p *PolicyFragmentCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "count": - err = unpopulate(val, "Count", &o.Count) + err = unpopulate(val, "Count", &p.Count) delete(rawMsg, key) case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &o.Value) + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationContract. -func (o OperationContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PolicyFragmentContract. +func (p PolicyFragmentContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", o.ID) - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "type", o.Type) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationContract. -func (o *OperationContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyFragmentContract. +func (p *PolicyFragmentContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &o.ID) + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &o.Name) + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &o.Properties) + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &o.Type) + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationContractProperties. -func (o OperationContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PolicyFragmentContractProperties. +func (p PolicyFragmentContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", o.Description) - populate(objectMap, "displayName", o.DisplayName) - populate(objectMap, "method", o.Method) - populate(objectMap, "policies", o.Policies) - populate(objectMap, "request", o.Request) - populate(objectMap, "responses", o.Responses) - populate(objectMap, "templateParameters", o.TemplateParameters) - populate(objectMap, "urlTemplate", o.URLTemplate) + populate(objectMap, "description", p.Description) + populate(objectMap, "format", p.Format) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationContractProperties. -func (o *OperationContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyFragmentContractProperties. +func (p *PolicyFragmentContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "description": - err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &o.DisplayName) - delete(rawMsg, key) - case "method": - err = unpopulate(val, "Method", &o.Method) - delete(rawMsg, key) - case "policies": - err = unpopulate(val, "Policies", &o.Policies) - delete(rawMsg, key) - case "request": - err = unpopulate(val, "Request", &o.Request) - delete(rawMsg, key) - case "responses": - err = unpopulate(val, "Responses", &o.Responses) + err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) - case "templateParameters": - err = unpopulate(val, "TemplateParameters", &o.TemplateParameters) + case "format": + err = unpopulate(val, "Format", &p.Format) delete(rawMsg, key) - case "urlTemplate": - err = unpopulate(val, "URLTemplate", &o.URLTemplate) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. -func (o OperationDisplay) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalConfigCollection. +func (p PortalConfigCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", o.Description) - populate(objectMap, "operation", o.Operation) - populate(objectMap, "provider", o.Provider) - populate(objectMap, "resource", o.Resource) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. -func (o *OperationDisplay) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalConfigCollection. +func (p *PortalConfigCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &o.Operation) - delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &o.Provider) + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationEntityBaseContract. -func (o OperationEntityBaseContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalConfigContract. +func (p PortalConfigContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", o.Description) - populate(objectMap, "policies", o.Policies) - populate(objectMap, "request", o.Request) - populate(objectMap, "responses", o.Responses) - populate(objectMap, "templateParameters", o.TemplateParameters) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationEntityBaseContract. -func (o *OperationEntityBaseContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalConfigContract. +func (p *PortalConfigContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &o.Description) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "policies": - err = unpopulate(val, "Policies", &o.Policies) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "request": - err = unpopulate(val, "Request", &o.Request) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) - case "responses": - err = unpopulate(val, "Responses", &o.Responses) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) - case "templateParameters": - err = unpopulate(val, "TemplateParameters", &o.TemplateParameters) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PortalConfigCorsProperties. +func (p PortalConfigCorsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowedOrigins", p.AllowedOrigins) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalConfigCorsProperties. +func (p *PortalConfigCorsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowedOrigins": + err = unpopulate(val, "AllowedOrigins", &p.AllowedOrigins) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationListResult. -func (o OperationListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalConfigCspProperties. +func (p PortalConfigCspProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) + populate(objectMap, "allowedSources", p.AllowedSources) + populate(objectMap, "mode", p.Mode) + populate(objectMap, "reportUri", p.ReportURI) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. -func (o *OperationListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalConfigCspProperties. +func (p *PortalConfigCspProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) + case "allowedSources": + err = unpopulate(val, "AllowedSources", &p.AllowedSources) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &o.Value) + case "mode": + err = unpopulate(val, "Mode", &p.Mode) + delete(rawMsg, key) + case "reportUri": + err = unpopulate(val, "ReportURI", &p.ReportURI) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationResultContract. -func (o OperationResultContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalConfigDelegationProperties. +func (p PortalConfigDelegationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", o.ID) - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "type", o.Type) + populate(objectMap, "delegateRegistration", p.DelegateRegistration) + populate(objectMap, "delegateSubscription", p.DelegateSubscription) + populate(objectMap, "delegationUrl", p.DelegationURL) + populate(objectMap, "validationKey", p.ValidationKey) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultContract. -func (o *OperationResultContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalConfigDelegationProperties. +func (p *PortalConfigDelegationProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &o.ID) + case "delegateRegistration": + err = unpopulate(val, "DelegateRegistration", &p.DelegateRegistration) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) + case "delegateSubscription": + err = unpopulate(val, "DelegateSubscription", &p.DelegateSubscription) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &o.Properties) + case "delegationUrl": + err = unpopulate(val, "DelegationURL", &p.DelegationURL) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &o.Type) + case "validationKey": + err = unpopulate(val, "ValidationKey", &p.ValidationKey) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationResultContractProperties. -func (o OperationResultContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalConfigProperties. +func (p PortalConfigProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "actionLog", o.ActionLog) - populate(objectMap, "error", o.Error) - populate(objectMap, "id", o.ID) - populate(objectMap, "resultInfo", o.ResultInfo) - populateTimeRFC3339(objectMap, "started", o.Started) - populate(objectMap, "status", o.Status) - populateTimeRFC3339(objectMap, "updated", o.Updated) + populate(objectMap, "cors", p.Cors) + populate(objectMap, "csp", p.Csp) + populate(objectMap, "delegation", p.Delegation) + populate(objectMap, "enableBasicAuth", p.EnableBasicAuth) + populate(objectMap, "signin", p.Signin) + populate(objectMap, "signup", p.Signup) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultContractProperties. -func (o *OperationResultContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalConfigProperties. +func (p *PortalConfigProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "actionLog": - err = unpopulate(val, "ActionLog", &o.ActionLog) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &o.Error) + case "cors": + err = unpopulate(val, "Cors", &p.Cors) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &o.ID) + case "csp": + err = unpopulate(val, "Csp", &p.Csp) delete(rawMsg, key) - case "resultInfo": - err = unpopulate(val, "ResultInfo", &o.ResultInfo) + case "delegation": + err = unpopulate(val, "Delegation", &p.Delegation) delete(rawMsg, key) - case "started": - err = unpopulateTimeRFC3339(val, "Started", &o.Started) + case "enableBasicAuth": + err = unpopulate(val, "EnableBasicAuth", &p.EnableBasicAuth) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &o.Status) + case "signin": + err = unpopulate(val, "Signin", &p.Signin) delete(rawMsg, key) - case "updated": - err = unpopulateTimeRFC3339(val, "Updated", &o.Updated) + case "signup": + err = unpopulate(val, "Signup", &p.Signup) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationResultLogItemContract. -func (o OperationResultLogItemContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalConfigPropertiesSignin. +func (p PortalConfigPropertiesSignin) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "action", o.Action) - populate(objectMap, "objectKey", o.ObjectKey) - populate(objectMap, "objectType", o.ObjectType) + populate(objectMap, "require", p.Require) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultLogItemContract. -func (o *OperationResultLogItemContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalConfigPropertiesSignin. +func (p *PortalConfigPropertiesSignin) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "action": - err = unpopulate(val, "Action", &o.Action) - delete(rawMsg, key) - case "objectKey": - err = unpopulate(val, "ObjectKey", &o.ObjectKey) - delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &o.ObjectType) + case "require": + err = unpopulate(val, "Require", &p.Require) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationTagResourceContractProperties. -func (o OperationTagResourceContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalConfigPropertiesSignup. +func (p PortalConfigPropertiesSignup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "apiName", o.APIName) - populate(objectMap, "apiRevision", o.APIRevision) - populate(objectMap, "apiVersion", o.APIVersion) - populate(objectMap, "description", o.Description) - populate(objectMap, "id", o.ID) - populate(objectMap, "method", o.Method) - populate(objectMap, "name", o.Name) - populate(objectMap, "urlTemplate", o.URLTemplate) + populate(objectMap, "termsOfService", p.TermsOfService) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationTagResourceContractProperties. -func (o *OperationTagResourceContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalConfigPropertiesSignup. +func (p *PortalConfigPropertiesSignup) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "apiName": - err = unpopulate(val, "APIName", &o.APIName) - delete(rawMsg, key) - case "apiRevision": - err = unpopulate(val, "APIRevision", &o.APIRevision) - delete(rawMsg, key) - case "apiVersion": - err = unpopulate(val, "APIVersion", &o.APIVersion) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &o.ID) - delete(rawMsg, key) - case "method": - err = unpopulate(val, "Method", &o.Method) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "urlTemplate": - err = unpopulate(val, "URLTemplate", &o.URLTemplate) + case "termsOfService": + err = unpopulate(val, "TermsOfService", &p.TermsOfService) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationUpdateContract. -func (o OperationUpdateContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalConfigTermsOfServiceProperties. +func (p PortalConfigTermsOfServiceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", o.Properties) + populate(objectMap, "requireConsent", p.RequireConsent) + populate(objectMap, "text", p.Text) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationUpdateContract. -func (o *OperationUpdateContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalConfigTermsOfServiceProperties. +func (p *PortalConfigTermsOfServiceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &o.Properties) + case "requireConsent": + err = unpopulate(val, "RequireConsent", &p.RequireConsent) + delete(rawMsg, key) + case "text": + err = unpopulate(val, "Text", &p.Text) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationUpdateContractProperties. -func (o OperationUpdateContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalDelegationSettings. +func (p PortalDelegationSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", o.Description) - populate(objectMap, "displayName", o.DisplayName) - populate(objectMap, "method", o.Method) - populate(objectMap, "policies", o.Policies) - populate(objectMap, "request", o.Request) - populate(objectMap, "responses", o.Responses) - populate(objectMap, "templateParameters", o.TemplateParameters) - populate(objectMap, "urlTemplate", o.URLTemplate) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationUpdateContractProperties. -func (o *OperationUpdateContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalDelegationSettings. +func (p *PortalDelegationSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &o.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &o.DisplayName) - delete(rawMsg, key) - case "method": - err = unpopulate(val, "Method", &o.Method) - delete(rawMsg, key) - case "policies": - err = unpopulate(val, "Policies", &o.Policies) - delete(rawMsg, key) - case "request": - err = unpopulate(val, "Request", &o.Request) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "responses": - err = unpopulate(val, "Responses", &o.Responses) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "templateParameters": - err = unpopulate(val, "TemplateParameters", &o.TemplateParameters) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) - case "urlTemplate": - err = unpopulate(val, "URLTemplate", &o.URLTemplate) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpoint. -func (o OutboundEnvironmentEndpoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalDelegationSettingsProperties. +func (p PortalDelegationSettingsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "category", o.Category) - populate(objectMap, "endpoints", o.Endpoints) + populate(objectMap, "subscriptions", p.Subscriptions) + populate(objectMap, "url", p.URL) + populate(objectMap, "userRegistration", p.UserRegistration) + populate(objectMap, "validationKey", p.ValidationKey) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpoint. -func (o *OutboundEnvironmentEndpoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalDelegationSettingsProperties. +func (p *PortalDelegationSettingsProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "category": - err = unpopulate(val, "Category", &o.Category) + case "subscriptions": + err = unpopulate(val, "Subscriptions", &p.Subscriptions) delete(rawMsg, key) - case "endpoints": - err = unpopulate(val, "Endpoints", &o.Endpoints) + case "url": + err = unpopulate(val, "URL", &p.URL) + delete(rawMsg, key) + case "userRegistration": + err = unpopulate(val, "UserRegistration", &p.UserRegistration) + delete(rawMsg, key) + case "validationKey": + err = unpopulate(val, "ValidationKey", &p.ValidationKey) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpointList. -func (o OutboundEnvironmentEndpointList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalRevisionCollection. +func (p PortalRevisionCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpointList. -func (o *OutboundEnvironmentEndpointList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalRevisionCollection. +func (p *PortalRevisionCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &o.NextLink) + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &o.Value) + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ParameterContract. -func (p ParameterContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalRevisionContract. +func (p PortalRevisionContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "defaultValue", p.DefaultValue) - populate(objectMap, "description", p.Description) - populate(objectMap, "examples", p.Examples) + populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) - populate(objectMap, "required", p.Required) - populate(objectMap, "schemaId", p.SchemaID) + populate(objectMap, "properties", p.Properties) populate(objectMap, "type", p.Type) - populate(objectMap, "typeName", p.TypeName) - populate(objectMap, "values", p.Values) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ParameterContract. -func (p *ParameterContract) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "defaultValue": - err = unpopulate(val, "DefaultValue", &p.DefaultValue) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) - delete(rawMsg, key) - case "examples": - err = unpopulate(val, "Examples", &p.Examples) +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalRevisionContract. +func (p *PortalRevisionContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "required": - err = unpopulate(val, "Required", &p.Required) - delete(rawMsg, key) - case "schemaId": - err = unpopulate(val, "SchemaID", &p.SchemaID) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) - case "typeName": - err = unpopulate(val, "TypeName", &p.TypeName) - delete(rawMsg, key) - case "values": - err = unpopulate(val, "Values", &p.Values) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8040,18 +9576,20 @@ func (p *ParameterContract) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ParameterExampleContract. -func (p ParameterExampleContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalRevisionContractProperties. +func (p PortalRevisionContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "createdDateTime", p.CreatedDateTime) populate(objectMap, "description", p.Description) - populate(objectMap, "externalValue", p.ExternalValue) - populate(objectMap, "summary", p.Summary) - populateAny(objectMap, "value", p.Value) + populate(objectMap, "isCurrent", p.IsCurrent) + populate(objectMap, "status", p.Status) + populate(objectMap, "statusDetails", p.StatusDetails) + populateTimeRFC3339(objectMap, "updatedDateTime", p.UpdatedDateTime) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ParameterExampleContract. -func (p *ParameterExampleContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalRevisionContractProperties. +func (p *PortalRevisionContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8059,17 +9597,23 @@ func (p *ParameterExampleContract) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "createdDateTime": + err = unpopulateTimeRFC3339(val, "CreatedDateTime", &p.CreatedDateTime) + delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) - case "externalValue": - err = unpopulate(val, "ExternalValue", &p.ExternalValue) + case "isCurrent": + err = unpopulate(val, "IsCurrent", &p.IsCurrent) delete(rawMsg, key) - case "summary": - err = unpopulate(val, "Summary", &p.Summary) + case "status": + err = unpopulate(val, "Status", &p.Status) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "statusDetails": + err = unpopulate(val, "StatusDetails", &p.StatusDetails) + delete(rawMsg, key) + case "updatedDateTime": + err = unpopulateTimeRFC3339(val, "UpdatedDateTime", &p.UpdatedDateTime) delete(rawMsg, key) } if err != nil { @@ -8079,16 +9623,15 @@ func (p *ParameterExampleContract) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PipelineDiagnosticSettings. -func (p PipelineDiagnosticSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalSettingValidationKeyContract. +func (p PortalSettingValidationKeyContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "request", p.Request) - populate(objectMap, "response", p.Response) + populate(objectMap, "validationKey", p.ValidationKey) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineDiagnosticSettings. -func (p *PipelineDiagnosticSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSettingValidationKeyContract. +func (p *PortalSettingValidationKeyContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8096,11 +9639,8 @@ func (p *PipelineDiagnosticSettings) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "request": - err = unpopulate(val, "Request", &p.Request) - delete(rawMsg, key) - case "response": - err = unpopulate(val, "Response", &p.Response) + case "validationKey": + err = unpopulate(val, "ValidationKey", &p.ValidationKey) delete(rawMsg, key) } if err != nil { @@ -8110,17 +9650,16 @@ func (p *PipelineDiagnosticSettings) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PolicyCollection. -func (p PolicyCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalSettingsCollection. +func (p PortalSettingsCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "count", p.Count) - populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyCollection. -func (p *PolicyCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSettingsCollection. +func (p *PortalSettingsCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8131,9 +9670,6 @@ func (p *PolicyCollection) UnmarshalJSON(data []byte) error { case "count": err = unpopulate(val, "Count", &p.Count) delete(rawMsg, key) - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) @@ -8145,8 +9681,8 @@ func (p *PolicyCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PolicyContract. -func (p PolicyContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalSettingsContract. +func (p PortalSettingsContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) @@ -8155,8 +9691,8 @@ func (p PolicyContract) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyContract. -func (p *PolicyContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSettingsContract. +func (p *PortalSettingsContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8184,16 +9720,20 @@ func (p *PolicyContract) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PolicyContractProperties. -func (p PolicyContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalSettingsContractProperties. +func (p PortalSettingsContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "format", p.Format) - populate(objectMap, "value", p.Value) + populate(objectMap, "enabled", p.Enabled) + populate(objectMap, "subscriptions", p.Subscriptions) + populate(objectMap, "termsOfService", p.TermsOfService) + populate(objectMap, "url", p.URL) + populate(objectMap, "userRegistration", p.UserRegistration) + populate(objectMap, "validationKey", p.ValidationKey) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyContractProperties. -func (p *PolicyContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSettingsContractProperties. +func (p *PortalSettingsContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8201,11 +9741,23 @@ func (p *PolicyContractProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "format": - err = unpopulate(val, "Format", &p.Format) + case "enabled": + err = unpopulate(val, "Enabled", &p.Enabled) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "subscriptions": + err = unpopulate(val, "Subscriptions", &p.Subscriptions) + delete(rawMsg, key) + case "termsOfService": + err = unpopulate(val, "TermsOfService", &p.TermsOfService) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &p.URL) + delete(rawMsg, key) + case "userRegistration": + err = unpopulate(val, "UserRegistration", &p.UserRegistration) + delete(rawMsg, key) + case "validationKey": + err = unpopulate(val, "ValidationKey", &p.ValidationKey) delete(rawMsg, key) } if err != nil { @@ -8215,16 +9767,15 @@ func (p *PolicyContractProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PolicyDescriptionCollection. -func (p PolicyDescriptionCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalSigninSettingProperties. +func (p PortalSigninSettingProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", p.Count) - populate(objectMap, "value", p.Value) + populate(objectMap, "enabled", p.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyDescriptionCollection. -func (p *PolicyDescriptionCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSigninSettingProperties. +func (p *PortalSigninSettingProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8232,11 +9783,47 @@ func (p *PolicyDescriptionCollection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &p.Count) + case "enabled": + err = unpopulate(val, "Enabled", &p.Enabled) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PortalSigninSettings. +func (p PortalSigninSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSigninSettings. +func (p *PortalSigninSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { @@ -8246,8 +9833,8 @@ func (p *PolicyDescriptionCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PolicyDescriptionContract. -func (p PolicyDescriptionContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalSignupSettings. +func (p PortalSignupSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) @@ -8256,8 +9843,8 @@ func (p PolicyDescriptionContract) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyDescriptionContract. -func (p *PolicyDescriptionContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSignupSettings. +func (p *PortalSignupSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8285,16 +9872,16 @@ func (p *PolicyDescriptionContract) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PolicyDescriptionContractProperties. -func (p PolicyDescriptionContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PortalSignupSettingsProperties. +func (p PortalSignupSettingsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", p.Description) - populate(objectMap, "scope", p.Scope) + populate(objectMap, "enabled", p.Enabled) + populate(objectMap, "termsOfService", p.TermsOfService) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyDescriptionContractProperties. -func (p *PolicyDescriptionContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSignupSettingsProperties. +func (p *PortalSignupSettingsProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8302,11 +9889,11 @@ func (p *PolicyDescriptionContractProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &p.Description) + case "enabled": + err = unpopulate(val, "Enabled", &p.Enabled) delete(rawMsg, key) - case "scope": - err = unpopulate(val, "Scope", &p.Scope) + case "termsOfService": + err = unpopulate(val, "TermsOfService", &p.TermsOfService) delete(rawMsg, key) } if err != nil { @@ -8316,18 +9903,15 @@ func (p *PolicyDescriptionContractProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PortalDelegationSettings. -func (p PortalDelegationSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. +func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PortalDelegationSettings. -func (p *PortalDelegationSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. +func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8338,15 +9922,6 @@ func (p *PortalDelegationSettings) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8355,18 +9930,18 @@ func (p *PortalDelegationSettings) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PortalDelegationSettingsProperties. -func (p PortalDelegationSettingsProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "subscriptions", p.Subscriptions) - populate(objectMap, "url", p.URL) - populate(objectMap, "userRegistration", p.UserRegistration) - populate(objectMap, "validationKey", p.ValidationKey) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PortalDelegationSettingsProperties. -func (p *PortalDelegationSettingsProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. +func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8374,17 +9949,17 @@ func (p *PortalDelegationSettingsProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "subscriptions": - err = unpopulate(val, "Subscriptions", &p.Subscriptions) - delete(rawMsg, key) - case "url": - err = unpopulate(val, "URL", &p.URL) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "userRegistration": - err = unpopulate(val, "UserRegistration", &p.UserRegistration) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "validationKey": - err = unpopulate(val, "ValidationKey", &p.ValidationKey) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { @@ -8394,16 +9969,15 @@ func (p *PortalDelegationSettingsProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PortalRevisionCollection. -func (p PortalRevisionCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PortalRevisionCollection. -func (p *PortalRevisionCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. +func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8411,9 +9985,6 @@ func (p *PortalRevisionCollection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) - delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) @@ -8425,18 +9996,17 @@ func (p *PortalRevisionCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PortalRevisionContract. -func (p PortalRevisionContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PortalRevisionContract. -func (p *PortalRevisionContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. +func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8444,17 +10014,14 @@ func (p *PortalRevisionContract) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) } if err != nil { @@ -8464,20 +10031,16 @@ func (p *PortalRevisionContract) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PortalRevisionContractProperties. -func (p PortalRevisionContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionRequest. +func (p PrivateEndpointConnectionRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateTimeRFC3339(objectMap, "createdDateTime", p.CreatedDateTime) - populate(objectMap, "description", p.Description) - populate(objectMap, "isCurrent", p.IsCurrent) - populate(objectMap, "status", p.Status) - populate(objectMap, "statusDetails", p.StatusDetails) - populateTimeRFC3339(objectMap, "updatedDateTime", p.UpdatedDateTime) + populate(objectMap, "id", p.ID) + populate(objectMap, "properties", p.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PortalRevisionContractProperties. -func (p *PortalRevisionContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionRequest. +func (p *PrivateEndpointConnectionRequest) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8485,23 +10048,11 @@ func (p *PortalRevisionContractProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "createdDateTime": - err = unpopulateTimeRFC3339(val, "CreatedDateTime", &p.CreatedDateTime) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) - delete(rawMsg, key) - case "isCurrent": - err = unpopulate(val, "IsCurrent", &p.IsCurrent) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) - delete(rawMsg, key) - case "statusDetails": - err = unpopulate(val, "StatusDetails", &p.StatusDetails) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "updatedDateTime": - err = unpopulateTimeRFC3339(val, "UpdatedDateTime", &p.UpdatedDateTime) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) } if err != nil { @@ -8511,15 +10062,15 @@ func (p *PortalRevisionContractProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PortalSettingValidationKeyContract. -func (p PortalSettingValidationKeyContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionRequestProperties. +func (p PrivateEndpointConnectionRequestProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "validationKey", p.ValidationKey) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSettingValidationKeyContract. -func (p *PortalSettingValidationKeyContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionRequestProperties. +func (p *PrivateEndpointConnectionRequestProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8527,8 +10078,8 @@ func (p *PortalSettingValidationKeyContract) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "validationKey": - err = unpopulate(val, "ValidationKey", &p.ValidationKey) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) delete(rawMsg, key) } if err != nil { @@ -8538,16 +10089,18 @@ func (p *PortalSettingValidationKeyContract) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PortalSettingsCollection. -func (p PortalSettingsCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionWrapperProperties. +func (p PrivateEndpointConnectionWrapperProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", p.Count) - populate(objectMap, "value", p.Value) + populate(objectMap, "groupIds", p.GroupIDs) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSettingsCollection. -func (p *PortalSettingsCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionWrapperProperties. +func (p *PrivateEndpointConnectionWrapperProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8555,11 +10108,17 @@ func (p *PortalSettingsCollection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &p.Count) + case "groupIds": + err = unpopulate(val, "GroupIDs", &p.GroupIDs) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) delete(rawMsg, key) } if err != nil { @@ -8569,8 +10128,8 @@ func (p *PortalSettingsCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PortalSettingsContract. -func (p PortalSettingsContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) @@ -8579,8 +10138,8 @@ func (p PortalSettingsContract) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSettingsContract. -func (p *PortalSettingsContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. +func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8608,20 +10167,15 @@ func (p *PortalSettingsContract) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PortalSettingsContractProperties. -func (p PortalSettingsContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "enabled", p.Enabled) - populate(objectMap, "subscriptions", p.Subscriptions) - populate(objectMap, "termsOfService", p.TermsOfService) - populate(objectMap, "url", p.URL) - populate(objectMap, "userRegistration", p.UserRegistration) - populate(objectMap, "validationKey", p.ValidationKey) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSettingsContractProperties. -func (p *PortalSettingsContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. +func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8629,23 +10183,43 @@ func (p *PortalSettingsContractProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "enabled": - err = unpopulate(val, "Enabled", &p.Enabled) - delete(rawMsg, key) - case "subscriptions": - err = unpopulate(val, "Subscriptions", &p.Subscriptions) - delete(rawMsg, key) - case "termsOfService": - err = unpopulate(val, "TermsOfService", &p.TermsOfService) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) - case "url": - err = unpopulate(val, "URL", &p.URL) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. +func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) delete(rawMsg, key) - case "userRegistration": - err = unpopulate(val, "UserRegistration", &p.UserRegistration) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) delete(rawMsg, key) - case "validationKey": - err = unpopulate(val, "ValidationKey", &p.ValidationKey) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) delete(rawMsg, key) } if err != nil { @@ -8655,15 +10229,17 @@ func (p *PortalSettingsContractProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PortalSigninSettingProperties. -func (p PortalSigninSettingProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. +func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "enabled", p.Enabled) + populate(objectMap, "actionsRequired", p.ActionsRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "status", p.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSigninSettingProperties. -func (p *PortalSigninSettingProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. +func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8671,8 +10247,14 @@ func (p *PortalSigninSettingProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "enabled": - err = unpopulate(val, "Enabled", &p.Enabled) + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) delete(rawMsg, key) } if err != nil { @@ -8682,18 +10264,17 @@ func (p *PortalSigninSettingProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PortalSigninSettings. -func (p PortalSigninSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProductCollection. +func (p ProductCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) + populate(objectMap, "count", p.Count) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSigninSettings. -func (p *PortalSigninSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProductCollection. +func (p *ProductCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8701,17 +10282,14 @@ func (p *PortalSigninSettings) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) + case "count": + err = unpopulate(val, "Count", &p.Count) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { @@ -8721,8 +10299,8 @@ func (p *PortalSigninSettings) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PortalSignupSettings. -func (p PortalSignupSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProductContract. +func (p ProductContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) @@ -8731,8 +10309,8 @@ func (p PortalSignupSettings) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSignupSettings. -func (p *PortalSignupSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProductContract. +func (p *ProductContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8760,16 +10338,21 @@ func (p *PortalSignupSettings) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PortalSignupSettingsProperties. -func (p PortalSignupSettingsProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProductContractProperties. +func (p ProductContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "enabled", p.Enabled) - populate(objectMap, "termsOfService", p.TermsOfService) + populate(objectMap, "approvalRequired", p.ApprovalRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "displayName", p.DisplayName) + populate(objectMap, "state", p.State) + populate(objectMap, "subscriptionRequired", p.SubscriptionRequired) + populate(objectMap, "subscriptionsLimit", p.SubscriptionsLimit) + populate(objectMap, "terms", p.Terms) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSignupSettingsProperties. -func (p *PortalSignupSettingsProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProductContractProperties. +func (p *ProductContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8777,11 +10360,26 @@ func (p *PortalSignupSettingsProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "enabled": - err = unpopulate(val, "Enabled", &p.Enabled) + case "approvalRequired": + err = unpopulate(val, "ApprovalRequired", &p.ApprovalRequired) delete(rawMsg, key) - case "termsOfService": - err = unpopulate(val, "TermsOfService", &p.TermsOfService) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &p.DisplayName) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &p.State) + delete(rawMsg, key) + case "subscriptionRequired": + err = unpopulate(val, "SubscriptionRequired", &p.SubscriptionRequired) + delete(rawMsg, key) + case "subscriptionsLimit": + err = unpopulate(val, "SubscriptionsLimit", &p.SubscriptionsLimit) + delete(rawMsg, key) + case "terms": + err = unpopulate(val, "Terms", &p.Terms) delete(rawMsg, key) } if err != nil { @@ -8791,15 +10389,20 @@ func (p *PortalSignupSettingsProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. -func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProductEntityBaseParameters. +func (p ProductEntityBaseParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) + populate(objectMap, "approvalRequired", p.ApprovalRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "state", p.State) + populate(objectMap, "subscriptionRequired", p.SubscriptionRequired) + populate(objectMap, "subscriptionsLimit", p.SubscriptionsLimit) + populate(objectMap, "terms", p.Terms) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. -func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProductEntityBaseParameters. +func (p *ProductEntityBaseParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8807,8 +10410,23 @@ func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) + case "approvalRequired": + err = unpopulate(val, "ApprovalRequired", &p.ApprovalRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &p.State) + delete(rawMsg, key) + case "subscriptionRequired": + err = unpopulate(val, "SubscriptionRequired", &p.SubscriptionRequired) + delete(rawMsg, key) + case "subscriptionsLimit": + err = unpopulate(val, "SubscriptionsLimit", &p.SubscriptionsLimit) + delete(rawMsg, key) + case "terms": + err = unpopulate(val, "Terms", &p.Terms) delete(rawMsg, key) } if err != nil { @@ -8818,18 +10436,22 @@ func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. -func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProductTagResourceContractProperties. +func (p ProductTagResourceContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "approvalRequired", p.ApprovalRequired) + populate(objectMap, "description", p.Description) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) + populate(objectMap, "state", p.State) + populate(objectMap, "subscriptionRequired", p.SubscriptionRequired) + populate(objectMap, "subscriptionsLimit", p.SubscriptionsLimit) + populate(objectMap, "terms", p.Terms) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. -func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProductTagResourceContractProperties. +func (p *ProductTagResourceContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8837,17 +10459,29 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "approvalRequired": + err = unpopulate(val, "ApprovalRequired", &p.ApprovalRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "state": + err = unpopulate(val, "State", &p.State) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "subscriptionRequired": + err = unpopulate(val, "SubscriptionRequired", &p.SubscriptionRequired) + delete(rawMsg, key) + case "subscriptionsLimit": + err = unpopulate(val, "SubscriptionsLimit", &p.SubscriptionsLimit) + delete(rawMsg, key) + case "terms": + err = unpopulate(val, "Terms", &p.Terms) delete(rawMsg, key) } if err != nil { @@ -8857,15 +10491,15 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. -func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProductUpdateParameters. +func (p ProductUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", p.Value) + populate(objectMap, "properties", p.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. -func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProductUpdateParameters. +func (p *ProductUpdateParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8873,8 +10507,8 @@ func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &p.Value) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) } if err != nil { @@ -8884,17 +10518,21 @@ func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. -func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProductUpdateProperties. +func (p ProductUpdateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "privateEndpoint", p.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "approvalRequired", p.ApprovalRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "displayName", p.DisplayName) + populate(objectMap, "state", p.State) + populate(objectMap, "subscriptionRequired", p.SubscriptionRequired) + populate(objectMap, "subscriptionsLimit", p.SubscriptionsLimit) + populate(objectMap, "terms", p.Terms) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. -func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProductUpdateProperties. +func (p *ProductUpdateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8902,14 +10540,26 @@ func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + case "approvalRequired": + err = unpopulate(val, "ApprovalRequired", &p.ApprovalRequired) delete(rawMsg, key) - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + case "description": + err = unpopulate(val, "Description", &p.Description) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + case "displayName": + err = unpopulate(val, "DisplayName", &p.DisplayName) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &p.State) + delete(rawMsg, key) + case "subscriptionRequired": + err = unpopulate(val, "SubscriptionRequired", &p.SubscriptionRequired) + delete(rawMsg, key) + case "subscriptionsLimit": + err = unpopulate(val, "SubscriptionsLimit", &p.SubscriptionsLimit) + delete(rawMsg, key) + case "terms": + err = unpopulate(val, "Terms", &p.Terms) delete(rawMsg, key) } if err != nil { @@ -8919,16 +10569,17 @@ func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionRequest. -func (p PrivateEndpointConnectionRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", p.ID) - populate(objectMap, "properties", p.Properties) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionRequest. -func (p *PrivateEndpointConnectionRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -8939,35 +10590,11 @@ func (p *PrivateEndpointConnectionRequest) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "name": + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionRequestProperties. -func (p PrivateEndpointConnectionRequestProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionRequestProperties. -func (p *PrivateEndpointConnectionRequestProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { @@ -8977,660 +10604,607 @@ func (p *PrivateEndpointConnectionRequestProperties) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionWrapperProperties. -func (p PrivateEndpointConnectionWrapperProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QuotaCounterCollection. +func (q QuotaCounterCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "groupIds", p.GroupIDs) - populate(objectMap, "privateEndpoint", p.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "count", q.Count) + populate(objectMap, "nextLink", q.NextLink) + populate(objectMap, "value", q.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionWrapperProperties. -func (p *PrivateEndpointConnectionWrapperProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterCollection. +func (q *QuotaCounterCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "groupIds": - err = unpopulate(val, "GroupIDs", &p.GroupIDs) - delete(rawMsg, key) - case "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + case "count": + err = unpopulate(val, "Count", &q.Count) delete(rawMsg, key) - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + case "nextLink": + err = unpopulate(val, "NextLink", &q.NextLink) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + case "value": + err = unpopulate(val, "Value", &q.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. -func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QuotaCounterContract. +func (q QuotaCounterContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) + populate(objectMap, "counterKey", q.CounterKey) + populateTimeRFC3339(objectMap, "periodEndTime", q.PeriodEndTime) + populate(objectMap, "periodKey", q.PeriodKey) + populateTimeRFC3339(objectMap, "periodStartTime", q.PeriodStartTime) + populate(objectMap, "value", q.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. -func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterContract. +func (q *QuotaCounterContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) + case "counterKey": + err = unpopulate(val, "CounterKey", &q.CounterKey) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) + case "periodEndTime": + err = unpopulateTimeRFC3339(val, "PeriodEndTime", &q.PeriodEndTime) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "periodKey": + err = unpopulate(val, "PeriodKey", &q.PeriodKey) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "periodStartTime": + err = unpopulateTimeRFC3339(val, "PeriodStartTime", &q.PeriodStartTime) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &q.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. -func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QuotaCounterValueContract. +func (q QuotaCounterValueContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", p.Value) + populate(objectMap, "value", q.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. -func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterValueContract. +func (q *QuotaCounterValueContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { case "value": - err = unpopulate(val, "Value", &p.Value) + err = unpopulate(val, "Value", &q.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QuotaCounterValueContractProperties. +func (q QuotaCounterValueContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + populate(objectMap, "callsCount", q.CallsCount) + populate(objectMap, "kbTransferred", q.KbTransferred) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. -func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterValueContractProperties. +func (q *QuotaCounterValueContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "groupId": - err = unpopulate(val, "GroupID", &p.GroupID) - delete(rawMsg, key) - case "requiredMembers": - err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + case "callsCount": + err = unpopulate(val, "CallsCount", &q.CallsCount) delete(rawMsg, key) - case "requiredZoneNames": - err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + case "kbTransferred": + err = unpopulate(val, "KbTransferred", &q.KbTransferred) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. -func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QuotaCounterValueUpdateContract. +func (q QuotaCounterValueUpdateContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "actionsRequired", p.ActionsRequired) - populate(objectMap, "description", p.Description) - populate(objectMap, "status", p.Status) + populate(objectMap, "properties", q.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. -func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterValueUpdateContract. +func (q *QuotaCounterValueUpdateContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "actionsRequired": - err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) + case "properties": + err = unpopulate(val, "Properties", &q.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProductCollection. -func (p ProductCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecipientEmailCollection. +func (r RecipientEmailCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", p.Count) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "count", r.Count) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProductCollection. -func (p *ProductCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientEmailCollection. +func (r *RecipientEmailCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { case "count": - err = unpopulate(val, "Count", &p.Count) + err = unpopulate(val, "Count", &r.Count) delete(rawMsg, key) case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) + err = unpopulate(val, "NextLink", &r.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &p.Value) + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProductContract. -func (p ProductContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecipientEmailContract. +func (r RecipientEmailContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProductContract. -func (p *ProductContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientEmailContract. +func (r *RecipientEmailContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &p.ID) + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &p.Name) + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &p.Properties) + err = unpopulate(val, "Properties", &r.Properties) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &p.Type) + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProductContractProperties. -func (p ProductContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecipientEmailContractProperties. +func (r RecipientEmailContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "approvalRequired", p.ApprovalRequired) - populate(objectMap, "description", p.Description) - populate(objectMap, "displayName", p.DisplayName) - populate(objectMap, "state", p.State) - populate(objectMap, "subscriptionRequired", p.SubscriptionRequired) - populate(objectMap, "subscriptionsLimit", p.SubscriptionsLimit) - populate(objectMap, "terms", p.Terms) + populate(objectMap, "email", r.Email) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProductContractProperties. -func (p *ProductContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientEmailContractProperties. +func (r *RecipientEmailContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "approvalRequired": - err = unpopulate(val, "ApprovalRequired", &p.ApprovalRequired) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &p.DisplayName) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &p.State) - delete(rawMsg, key) - case "subscriptionRequired": - err = unpopulate(val, "SubscriptionRequired", &p.SubscriptionRequired) - delete(rawMsg, key) - case "subscriptionsLimit": - err = unpopulate(val, "SubscriptionsLimit", &p.SubscriptionsLimit) - delete(rawMsg, key) - case "terms": - err = unpopulate(val, "Terms", &p.Terms) + case "email": + err = unpopulate(val, "Email", &r.Email) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProductEntityBaseParameters. -func (p ProductEntityBaseParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecipientUserCollection. +func (r RecipientUserCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "approvalRequired", p.ApprovalRequired) - populate(objectMap, "description", p.Description) - populate(objectMap, "state", p.State) - populate(objectMap, "subscriptionRequired", p.SubscriptionRequired) - populate(objectMap, "subscriptionsLimit", p.SubscriptionsLimit) - populate(objectMap, "terms", p.Terms) + populate(objectMap, "count", r.Count) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProductEntityBaseParameters. -func (p *ProductEntityBaseParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientUserCollection. +func (r *RecipientUserCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "approvalRequired": - err = unpopulate(val, "ApprovalRequired", &p.ApprovalRequired) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &p.State) - delete(rawMsg, key) - case "subscriptionRequired": - err = unpopulate(val, "SubscriptionRequired", &p.SubscriptionRequired) + case "count": + err = unpopulate(val, "Count", &r.Count) delete(rawMsg, key) - case "subscriptionsLimit": - err = unpopulate(val, "SubscriptionsLimit", &p.SubscriptionsLimit) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) delete(rawMsg, key) - case "terms": - err = unpopulate(val, "Terms", &p.Terms) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProductTagResourceContractProperties. -func (p ProductTagResourceContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecipientUserContract. +func (r RecipientUserContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "approvalRequired", p.ApprovalRequired) - populate(objectMap, "description", p.Description) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "state", p.State) - populate(objectMap, "subscriptionRequired", p.SubscriptionRequired) - populate(objectMap, "subscriptionsLimit", p.SubscriptionsLimit) - populate(objectMap, "terms", p.Terms) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProductTagResourceContractProperties. -func (p *ProductTagResourceContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientUserContract. +func (r *RecipientUserContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "approvalRequired": - err = unpopulate(val, "ApprovalRequired", &p.ApprovalRequired) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) - delete(rawMsg, key) case "id": - err = unpopulate(val, "ID", &p.ID) + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &p.State) - delete(rawMsg, key) - case "subscriptionRequired": - err = unpopulate(val, "SubscriptionRequired", &p.SubscriptionRequired) + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "subscriptionsLimit": - err = unpopulate(val, "SubscriptionsLimit", &p.SubscriptionsLimit) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) delete(rawMsg, key) - case "terms": - err = unpopulate(val, "Terms", &p.Terms) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProductUpdateParameters. -func (p ProductUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecipientUsersContractProperties. +func (r RecipientUsersContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", p.Properties) + populate(objectMap, "userId", r.UserID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProductUpdateParameters. -func (p *ProductUpdateParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientUsersContractProperties. +func (r *RecipientUsersContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "userId": + err = unpopulate(val, "UserID", &r.UserID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProductUpdateProperties. -func (p ProductUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RecipientsContractProperties. +func (r RecipientsContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "approvalRequired", p.ApprovalRequired) - populate(objectMap, "description", p.Description) - populate(objectMap, "displayName", p.DisplayName) - populate(objectMap, "state", p.State) - populate(objectMap, "subscriptionRequired", p.SubscriptionRequired) - populate(objectMap, "subscriptionsLimit", p.SubscriptionsLimit) - populate(objectMap, "terms", p.Terms) + populate(objectMap, "emails", r.Emails) + populate(objectMap, "users", r.Users) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProductUpdateProperties. -func (p *ProductUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientsContractProperties. +func (r *RecipientsContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "approvalRequired": - err = unpopulate(val, "ApprovalRequired", &p.ApprovalRequired) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &p.DisplayName) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &p.State) - delete(rawMsg, key) - case "subscriptionRequired": - err = unpopulate(val, "SubscriptionRequired", &p.SubscriptionRequired) - delete(rawMsg, key) - case "subscriptionsLimit": - err = unpopulate(val, "SubscriptionsLimit", &p.SubscriptionsLimit) + case "emails": + err = unpopulate(val, "Emails", &r.Emails) delete(rawMsg, key) - case "terms": - err = unpopulate(val, "Terms", &p.Terms) + case "users": + err = unpopulate(val, "Users", &r.Users) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type QuotaCounterCollection. -func (q QuotaCounterCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegionContract. +func (r RegionContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", q.Count) - populate(objectMap, "nextLink", q.NextLink) - populate(objectMap, "value", q.Value) + populate(objectMap, "isDeleted", r.IsDeleted) + populate(objectMap, "isMasterRegion", r.IsMasterRegion) + populate(objectMap, "name", r.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterCollection. -func (q *QuotaCounterCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegionContract. +func (r *RegionContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &q.Count) + case "isDeleted": + err = unpopulate(val, "IsDeleted", &r.IsDeleted) delete(rawMsg, key) - case "nextLink": - err = unpopulate(val, "NextLink", &q.NextLink) + case "isMasterRegion": + err = unpopulate(val, "IsMasterRegion", &r.IsMasterRegion) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &q.Value) + case "name": + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type QuotaCounterContract. -func (q QuotaCounterContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegionListResult. +func (r RegionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "counterKey", q.CounterKey) - populateTimeRFC3339(objectMap, "periodEndTime", q.PeriodEndTime) - populate(objectMap, "periodKey", q.PeriodKey) - populateTimeRFC3339(objectMap, "periodStartTime", q.PeriodStartTime) - populate(objectMap, "value", q.Value) + populate(objectMap, "count", r.Count) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterContract. -func (q *QuotaCounterContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegionListResult. +func (r *RegionListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "counterKey": - err = unpopulate(val, "CounterKey", &q.CounterKey) - delete(rawMsg, key) - case "periodEndTime": - err = unpopulateTimeRFC3339(val, "PeriodEndTime", &q.PeriodEndTime) - delete(rawMsg, key) - case "periodKey": - err = unpopulate(val, "PeriodKey", &q.PeriodKey) + case "count": + err = unpopulate(val, "Count", &r.Count) delete(rawMsg, key) - case "periodStartTime": - err = unpopulateTimeRFC3339(val, "PeriodStartTime", &q.PeriodStartTime) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &q.Value) + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type QuotaCounterValueContract. -func (q QuotaCounterValueContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistrationDelegationSettingsProperties. +func (r RegistrationDelegationSettingsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", q.Value) + populate(objectMap, "enabled", r.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterValueContract. -func (q *QuotaCounterValueContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistrationDelegationSettingsProperties. +func (r *RegistrationDelegationSettingsProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &q.Value) + case "enabled": + err = unpopulate(val, "Enabled", &r.Enabled) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type QuotaCounterValueContractProperties. -func (q QuotaCounterValueContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RemotePrivateEndpointConnectionWrapper. +func (r RemotePrivateEndpointConnectionWrapper) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "callsCount", q.CallsCount) - populate(objectMap, "kbTransferred", q.KbTransferred) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterValueContractProperties. -func (q *QuotaCounterValueContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RemotePrivateEndpointConnectionWrapper. +func (r *RemotePrivateEndpointConnectionWrapper) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "callsCount": - err = unpopulate(val, "CallsCount", &q.CallsCount) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "kbTransferred": - err = unpopulate(val, "KbTransferred", &q.KbTransferred) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type QuotaCounterValueUpdateContract. -func (q QuotaCounterValueUpdateContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ReportCollection. +func (r ReportCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", q.Properties) + populate(objectMap, "count", r.Count) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterValueUpdateContract. -func (q *QuotaCounterValueUpdateContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ReportCollection. +func (r *ReportCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &q.Properties) + case "count": + err = unpopulate(val, "Count", &r.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RecipientEmailCollection. -func (r RecipientEmailCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ReportRecordContract. +func (r ReportRecordContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", r.Count) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) + populate(objectMap, "apiId", r.APIID) + populate(objectMap, "apiRegion", r.APIRegion) + populate(objectMap, "apiTimeAvg", r.APITimeAvg) + populate(objectMap, "apiTimeMax", r.APITimeMax) + populate(objectMap, "apiTimeMin", r.APITimeMin) + populate(objectMap, "bandwidth", r.Bandwidth) + populate(objectMap, "cacheHitCount", r.CacheHitCount) + populate(objectMap, "cacheMissCount", r.CacheMissCount) + populate(objectMap, "callCountBlocked", r.CallCountBlocked) + populate(objectMap, "callCountFailed", r.CallCountFailed) + populate(objectMap, "callCountOther", r.CallCountOther) + populate(objectMap, "callCountSuccess", r.CallCountSuccess) + populate(objectMap, "callCountTotal", r.CallCountTotal) + populate(objectMap, "country", r.Country) + populate(objectMap, "interval", r.Interval) + populate(objectMap, "name", r.Name) + populate(objectMap, "operationId", r.OperationID) + populate(objectMap, "productId", r.ProductID) + populate(objectMap, "region", r.Region) + populate(objectMap, "serviceTimeAvg", r.ServiceTimeAvg) + populate(objectMap, "serviceTimeMax", r.ServiceTimeMax) + populate(objectMap, "serviceTimeMin", r.ServiceTimeMin) + populate(objectMap, "subscriptionId", r.SubscriptionID) + populateTimeRFC3339(objectMap, "timestamp", r.Timestamp) + populate(objectMap, "userId", r.UserID) + populate(objectMap, "zip", r.Zip) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientEmailCollection. -func (r *RecipientEmailCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ReportRecordContract. +func (r *ReportRecordContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9638,14 +11212,83 @@ func (r *RecipientEmailCollection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &r.Count) + case "apiId": + err = unpopulate(val, "APIID", &r.APIID) delete(rawMsg, key) - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) + case "apiRegion": + err = unpopulate(val, "APIRegion", &r.APIRegion) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) + case "apiTimeAvg": + err = unpopulate(val, "APITimeAvg", &r.APITimeAvg) + delete(rawMsg, key) + case "apiTimeMax": + err = unpopulate(val, "APITimeMax", &r.APITimeMax) + delete(rawMsg, key) + case "apiTimeMin": + err = unpopulate(val, "APITimeMin", &r.APITimeMin) + delete(rawMsg, key) + case "bandwidth": + err = unpopulate(val, "Bandwidth", &r.Bandwidth) + delete(rawMsg, key) + case "cacheHitCount": + err = unpopulate(val, "CacheHitCount", &r.CacheHitCount) + delete(rawMsg, key) + case "cacheMissCount": + err = unpopulate(val, "CacheMissCount", &r.CacheMissCount) + delete(rawMsg, key) + case "callCountBlocked": + err = unpopulate(val, "CallCountBlocked", &r.CallCountBlocked) + delete(rawMsg, key) + case "callCountFailed": + err = unpopulate(val, "CallCountFailed", &r.CallCountFailed) + delete(rawMsg, key) + case "callCountOther": + err = unpopulate(val, "CallCountOther", &r.CallCountOther) + delete(rawMsg, key) + case "callCountSuccess": + err = unpopulate(val, "CallCountSuccess", &r.CallCountSuccess) + delete(rawMsg, key) + case "callCountTotal": + err = unpopulate(val, "CallCountTotal", &r.CallCountTotal) + delete(rawMsg, key) + case "country": + err = unpopulate(val, "Country", &r.Country) + delete(rawMsg, key) + case "interval": + err = unpopulate(val, "Interval", &r.Interval) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "operationId": + err = unpopulate(val, "OperationID", &r.OperationID) + delete(rawMsg, key) + case "productId": + err = unpopulate(val, "ProductID", &r.ProductID) + delete(rawMsg, key) + case "region": + err = unpopulate(val, "Region", &r.Region) + delete(rawMsg, key) + case "serviceTimeAvg": + err = unpopulate(val, "ServiceTimeAvg", &r.ServiceTimeAvg) + delete(rawMsg, key) + case "serviceTimeMax": + err = unpopulate(val, "ServiceTimeMax", &r.ServiceTimeMax) + delete(rawMsg, key) + case "serviceTimeMin": + err = unpopulate(val, "ServiceTimeMin", &r.ServiceTimeMin) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &r.SubscriptionID) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTimeRFC3339(val, "Timestamp", &r.Timestamp) + delete(rawMsg, key) + case "userId": + err = unpopulate(val, "UserID", &r.UserID) + delete(rawMsg, key) + case "zip": + err = unpopulate(val, "Zip", &r.Zip) delete(rawMsg, key) } if err != nil { @@ -9655,18 +11298,19 @@ func (r *RecipientEmailCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecipientEmailContract. -func (r RecipientEmailContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RepresentationContract. +func (r RepresentationContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "type", r.Type) + populate(objectMap, "contentType", r.ContentType) + populate(objectMap, "examples", r.Examples) + populate(objectMap, "formParameters", r.FormParameters) + populate(objectMap, "schemaId", r.SchemaID) + populate(objectMap, "typeName", r.TypeName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientEmailContract. -func (r *RecipientEmailContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RepresentationContract. +func (r *RepresentationContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9674,17 +11318,20 @@ func (r *RecipientEmailContract) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) + case "contentType": + err = unpopulate(val, "ContentType", &r.ContentType) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "examples": + err = unpopulate(val, "Examples", &r.Examples) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) + case "formParameters": + err = unpopulate(val, "FormParameters", &r.FormParameters) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "schemaId": + err = unpopulate(val, "SchemaID", &r.SchemaID) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &r.TypeName) delete(rawMsg, key) } if err != nil { @@ -9694,15 +11341,18 @@ func (r *RecipientEmailContract) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecipientEmailContractProperties. -func (r RecipientEmailContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RequestContract. +func (r RequestContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "email", r.Email) + populate(objectMap, "description", r.Description) + populate(objectMap, "headers", r.Headers) + populate(objectMap, "queryParameters", r.QueryParameters) + populate(objectMap, "representations", r.Representations) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientEmailContractProperties. -func (r *RecipientEmailContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RequestContract. +func (r *RequestContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9710,8 +11360,17 @@ func (r *RecipientEmailContractProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "email": - err = unpopulate(val, "Email", &r.Email) + case "description": + err = unpopulate(val, "Description", &r.Description) + delete(rawMsg, key) + case "headers": + err = unpopulate(val, "Headers", &r.Headers) + delete(rawMsg, key) + case "queryParameters": + err = unpopulate(val, "QueryParameters", &r.QueryParameters) + delete(rawMsg, key) + case "representations": + err = unpopulate(val, "Representations", &r.Representations) delete(rawMsg, key) } if err != nil { @@ -9721,17 +11380,16 @@ func (r *RecipientEmailContractProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecipientUserCollection. -func (r RecipientUserCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RequestReportCollection. +func (r RequestReportCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "count", r.Count) - populate(objectMap, "nextLink", r.NextLink) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientUserCollection. -func (r *RecipientUserCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RequestReportCollection. +func (r *RequestReportCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9742,9 +11400,6 @@ func (r *RecipientUserCollection) UnmarshalJSON(data []byte) error { case "count": err = unpopulate(val, "Count", &r.Count) delete(rawMsg, key) - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) @@ -9756,18 +11411,32 @@ func (r *RecipientUserCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecipientUserContract. -func (r RecipientUserContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RequestReportRecordContract. +func (r RequestReportRecordContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "type", r.Type) + populate(objectMap, "apiId", r.APIID) + populate(objectMap, "apiRegion", r.APIRegion) + populate(objectMap, "apiTime", r.APITime) + populate(objectMap, "backendResponseCode", r.BackendResponseCode) + populate(objectMap, "cache", r.Cache) + populate(objectMap, "ipAddress", r.IPAddress) + populate(objectMap, "method", r.Method) + populate(objectMap, "operationId", r.OperationID) + populate(objectMap, "productId", r.ProductID) + populate(objectMap, "requestId", r.RequestID) + populate(objectMap, "requestSize", r.RequestSize) + populate(objectMap, "responseCode", r.ResponseCode) + populate(objectMap, "responseSize", r.ResponseSize) + populate(objectMap, "serviceTime", r.ServiceTime) + populate(objectMap, "subscriptionId", r.SubscriptionID) + populateTimeRFC3339(objectMap, "timestamp", r.Timestamp) + populate(objectMap, "url", r.URL) + populate(objectMap, "userId", r.UserID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientUserContract. -func (r *RecipientUserContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RequestReportRecordContract. +func (r *RequestReportRecordContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9775,42 +11444,57 @@ func (r *RecipientUserContract) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) + case "apiId": + err = unpopulate(val, "APIID", &r.APIID) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "apiRegion": + err = unpopulate(val, "APIRegion", &r.APIRegion) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) + case "apiTime": + err = unpopulate(val, "APITime", &r.APITime) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "backendResponseCode": + err = unpopulate(val, "BackendResponseCode", &r.BackendResponseCode) + delete(rawMsg, key) + case "cache": + err = unpopulate(val, "Cache", &r.Cache) + delete(rawMsg, key) + case "ipAddress": + err = unpopulate(val, "IPAddress", &r.IPAddress) + delete(rawMsg, key) + case "method": + err = unpopulate(val, "Method", &r.Method) + delete(rawMsg, key) + case "operationId": + err = unpopulate(val, "OperationID", &r.OperationID) + delete(rawMsg, key) + case "productId": + err = unpopulate(val, "ProductID", &r.ProductID) + delete(rawMsg, key) + case "requestId": + err = unpopulate(val, "RequestID", &r.RequestID) + delete(rawMsg, key) + case "requestSize": + err = unpopulate(val, "RequestSize", &r.RequestSize) + delete(rawMsg, key) + case "responseCode": + err = unpopulate(val, "ResponseCode", &r.ResponseCode) + delete(rawMsg, key) + case "responseSize": + err = unpopulate(val, "ResponseSize", &r.ResponseSize) + delete(rawMsg, key) + case "serviceTime": + err = unpopulate(val, "ServiceTime", &r.ServiceTime) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &r.SubscriptionID) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTimeRFC3339(val, "Timestamp", &r.Timestamp) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &r.URL) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RecipientUsersContractProperties. -func (r RecipientUsersContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "userId", r.UserID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientUsersContractProperties. -func (r *RecipientUsersContractProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { case "userId": err = unpopulate(val, "UserID", &r.UserID) delete(rawMsg, key) @@ -9822,16 +11506,17 @@ func (r *RecipientUsersContractProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RecipientsContractProperties. -func (r RecipientsContractProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResolverCollection. +func (r ResolverCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "emails", r.Emails) - populate(objectMap, "users", r.Users) + populate(objectMap, "count", r.Count) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientsContractProperties. -func (r *RecipientsContractProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResolverCollection. +func (r *ResolverCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9839,11 +11524,14 @@ func (r *RecipientsContractProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "emails": - err = unpopulate(val, "Emails", &r.Emails) + case "count": + err = unpopulate(val, "Count", &r.Count) delete(rawMsg, key) - case "users": - err = unpopulate(val, "Users", &r.Users) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { @@ -9853,17 +11541,18 @@ func (r *RecipientsContractProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RegionContract. -func (r RegionContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResolverContract. +func (r ResolverContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "isDeleted", r.IsDeleted) - populate(objectMap, "isMasterRegion", r.IsMasterRegion) + populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegionContract. -func (r *RegionContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResolverContract. +func (r *ResolverContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9871,49 +11560,17 @@ func (r *RegionContract) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "isDeleted": - err = unpopulate(val, "IsDeleted", &r.IsDeleted) - delete(rawMsg, key) - case "isMasterRegion": - err = unpopulate(val, "IsMasterRegion", &r.IsMasterRegion) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RegionListResult. -func (r RegionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "count", r.Count) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RegionListResult. -func (r *RegionListResult) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "count": - err = unpopulate(val, "Count", &r.Count) - delete(rawMsg, key) - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { @@ -9923,15 +11580,17 @@ func (r *RegionListResult) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RegistrationDelegationSettingsProperties. -func (r RegistrationDelegationSettingsProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResolverEntityBaseContract. +func (r ResolverEntityBaseContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "enabled", r.Enabled) + populate(objectMap, "description", r.Description) + populate(objectMap, "displayName", r.DisplayName) + populate(objectMap, "path", r.Path) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistrationDelegationSettingsProperties. -func (r *RegistrationDelegationSettingsProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResolverEntityBaseContract. +func (r *ResolverEntityBaseContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9939,8 +11598,14 @@ func (r *RegistrationDelegationSettingsProperties) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { - case "enabled": - err = unpopulate(val, "Enabled", &r.Enabled) + case "description": + err = unpopulate(val, "Description", &r.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &r.DisplayName) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &r.Path) delete(rawMsg, key) } if err != nil { @@ -9950,8 +11615,8 @@ func (r *RegistrationDelegationSettingsProperties) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type RemotePrivateEndpointConnectionWrapper. -func (r RemotePrivateEndpointConnectionWrapper) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResolverResultContract. +func (r ResolverResultContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) @@ -9960,8 +11625,8 @@ func (r RemotePrivateEndpointConnectionWrapper) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RemotePrivateEndpointConnectionWrapper. -func (r *RemotePrivateEndpointConnectionWrapper) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResolverResultContract. +func (r *ResolverResultContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -9989,17 +11654,21 @@ func (r *RemotePrivateEndpointConnectionWrapper) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type ReportCollection. -func (r ReportCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResolverResultContractProperties. +func (r ResolverResultContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", r.Count) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) + populate(objectMap, "actionLog", r.ActionLog) + populate(objectMap, "error", r.Error) + populate(objectMap, "id", r.ID) + populate(objectMap, "resultInfo", r.ResultInfo) + populateTimeRFC3339(objectMap, "started", r.Started) + populate(objectMap, "status", r.Status) + populateTimeRFC3339(objectMap, "updated", r.Updated) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ReportCollection. -func (r *ReportCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResolverResultContractProperties. +func (r *ResolverResultContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -10007,14 +11676,26 @@ func (r *ReportCollection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &r.Count) + case "actionLog": + err = unpopulate(val, "ActionLog", &r.ActionLog) delete(rawMsg, key) - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) + case "error": + err = unpopulate(val, "Error", &r.Error) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "resultInfo": + err = unpopulate(val, "ResultInfo", &r.ResultInfo) + delete(rawMsg, key) + case "started": + err = unpopulateTimeRFC3339(val, "Started", &r.Started) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &r.Status) + delete(rawMsg, key) + case "updated": + err = unpopulateTimeRFC3339(val, "Updated", &r.Updated) delete(rawMsg, key) } if err != nil { @@ -10024,40 +11705,17 @@ func (r *ReportCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ReportRecordContract. -func (r ReportRecordContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResolverResultLogItemContract. +func (r ResolverResultLogItemContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "apiId", r.APIID) - populate(objectMap, "apiRegion", r.APIRegion) - populate(objectMap, "apiTimeAvg", r.APITimeAvg) - populate(objectMap, "apiTimeMax", r.APITimeMax) - populate(objectMap, "apiTimeMin", r.APITimeMin) - populate(objectMap, "bandwidth", r.Bandwidth) - populate(objectMap, "cacheHitCount", r.CacheHitCount) - populate(objectMap, "cacheMissCount", r.CacheMissCount) - populate(objectMap, "callCountBlocked", r.CallCountBlocked) - populate(objectMap, "callCountFailed", r.CallCountFailed) - populate(objectMap, "callCountOther", r.CallCountOther) - populate(objectMap, "callCountSuccess", r.CallCountSuccess) - populate(objectMap, "callCountTotal", r.CallCountTotal) - populate(objectMap, "country", r.Country) - populate(objectMap, "interval", r.Interval) - populate(objectMap, "name", r.Name) - populate(objectMap, "operationId", r.OperationID) - populate(objectMap, "productId", r.ProductID) - populate(objectMap, "region", r.Region) - populate(objectMap, "serviceTimeAvg", r.ServiceTimeAvg) - populate(objectMap, "serviceTimeMax", r.ServiceTimeMax) - populate(objectMap, "serviceTimeMin", r.ServiceTimeMin) - populate(objectMap, "subscriptionId", r.SubscriptionID) - populateTimeRFC3339(objectMap, "timestamp", r.Timestamp) - populate(objectMap, "userId", r.UserID) - populate(objectMap, "zip", r.Zip) + populate(objectMap, "action", r.Action) + populate(objectMap, "objectKey", r.ObjectKey) + populate(objectMap, "objectType", r.ObjectType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ReportRecordContract. -func (r *ReportRecordContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResolverResultLogItemContract. +func (r *ResolverResultLogItemContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -10065,105 +11723,32 @@ func (r *ReportRecordContract) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "apiId": - err = unpopulate(val, "APIID", &r.APIID) - delete(rawMsg, key) - case "apiRegion": - err = unpopulate(val, "APIRegion", &r.APIRegion) - delete(rawMsg, key) - case "apiTimeAvg": - err = unpopulate(val, "APITimeAvg", &r.APITimeAvg) - delete(rawMsg, key) - case "apiTimeMax": - err = unpopulate(val, "APITimeMax", &r.APITimeMax) - delete(rawMsg, key) - case "apiTimeMin": - err = unpopulate(val, "APITimeMin", &r.APITimeMin) - delete(rawMsg, key) - case "bandwidth": - err = unpopulate(val, "Bandwidth", &r.Bandwidth) - delete(rawMsg, key) - case "cacheHitCount": - err = unpopulate(val, "CacheHitCount", &r.CacheHitCount) - delete(rawMsg, key) - case "cacheMissCount": - err = unpopulate(val, "CacheMissCount", &r.CacheMissCount) - delete(rawMsg, key) - case "callCountBlocked": - err = unpopulate(val, "CallCountBlocked", &r.CallCountBlocked) - delete(rawMsg, key) - case "callCountFailed": - err = unpopulate(val, "CallCountFailed", &r.CallCountFailed) - delete(rawMsg, key) - case "callCountOther": - err = unpopulate(val, "CallCountOther", &r.CallCountOther) - delete(rawMsg, key) - case "callCountSuccess": - err = unpopulate(val, "CallCountSuccess", &r.CallCountSuccess) - delete(rawMsg, key) - case "callCountTotal": - err = unpopulate(val, "CallCountTotal", &r.CallCountTotal) - delete(rawMsg, key) - case "country": - err = unpopulate(val, "Country", &r.Country) - delete(rawMsg, key) - case "interval": - err = unpopulate(val, "Interval", &r.Interval) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "operationId": - err = unpopulate(val, "OperationID", &r.OperationID) - delete(rawMsg, key) - case "productId": - err = unpopulate(val, "ProductID", &r.ProductID) - delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &r.Region) - delete(rawMsg, key) - case "serviceTimeAvg": - err = unpopulate(val, "ServiceTimeAvg", &r.ServiceTimeAvg) - delete(rawMsg, key) - case "serviceTimeMax": - err = unpopulate(val, "ServiceTimeMax", &r.ServiceTimeMax) - delete(rawMsg, key) - case "serviceTimeMin": - err = unpopulate(val, "ServiceTimeMin", &r.ServiceTimeMin) - delete(rawMsg, key) - case "subscriptionId": - err = unpopulate(val, "SubscriptionID", &r.SubscriptionID) - delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &r.Timestamp) + case "action": + err = unpopulate(val, "Action", &r.Action) delete(rawMsg, key) - case "userId": - err = unpopulate(val, "UserID", &r.UserID) + case "objectKey": + err = unpopulate(val, "ObjectKey", &r.ObjectKey) delete(rawMsg, key) - case "zip": - err = unpopulate(val, "Zip", &r.Zip) + case "objectType": + err = unpopulate(val, "ObjectType", &r.ObjectType) delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) } } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RepresentationContract. -func (r RepresentationContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "contentType", r.ContentType) - populate(objectMap, "examples", r.Examples) - populate(objectMap, "formParameters", r.FormParameters) - populate(objectMap, "schemaId", r.SchemaID) - populate(objectMap, "typeName", r.TypeName) + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResolverUpdateContract. +func (r ResolverUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", r.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RepresentationContract. -func (r *RepresentationContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResolverUpdateContract. +func (r *ResolverUpdateContract) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -10171,20 +11756,8 @@ func (r *RepresentationContract) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "contentType": - err = unpopulate(val, "ContentType", &r.ContentType) - delete(rawMsg, key) - case "examples": - err = unpopulate(val, "Examples", &r.Examples) - delete(rawMsg, key) - case "formParameters": - err = unpopulate(val, "FormParameters", &r.FormParameters) - delete(rawMsg, key) - case "schemaId": - err = unpopulate(val, "SchemaID", &r.SchemaID) - delete(rawMsg, key) - case "typeName": - err = unpopulate(val, "TypeName", &r.TypeName) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) delete(rawMsg, key) } if err != nil { @@ -10194,18 +11767,17 @@ func (r *RepresentationContract) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RequestContract. -func (r RequestContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResolverUpdateContractProperties. +func (r ResolverUpdateContractProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", r.Description) - populate(objectMap, "headers", r.Headers) - populate(objectMap, "queryParameters", r.QueryParameters) - populate(objectMap, "representations", r.Representations) + populate(objectMap, "displayName", r.DisplayName) + populate(objectMap, "path", r.Path) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RequestContract. -func (r *RequestContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResolverUpdateContractProperties. +func (r *ResolverUpdateContractProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -10216,14 +11788,11 @@ func (r *RequestContract) UnmarshalJSON(data []byte) error { case "description": err = unpopulate(val, "Description", &r.Description) delete(rawMsg, key) - case "headers": - err = unpopulate(val, "Headers", &r.Headers) - delete(rawMsg, key) - case "queryParameters": - err = unpopulate(val, "QueryParameters", &r.QueryParameters) + case "displayName": + err = unpopulate(val, "DisplayName", &r.DisplayName) delete(rawMsg, key) - case "representations": - err = unpopulate(val, "Representations", &r.Representations) + case "path": + err = unpopulate(val, "Path", &r.Path) delete(rawMsg, key) } if err != nil { @@ -10233,16 +11802,17 @@ func (r *RequestContract) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RequestReportCollection. -func (r RequestReportCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "count", r.Count) - populate(objectMap, "value", r.Value) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RequestReportCollection. -func (r *RequestReportCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -10250,11 +11820,14 @@ func (r *RequestReportCollection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "count": - err = unpopulate(val, "Count", &r.Count) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) } if err != nil { @@ -10264,32 +11837,17 @@ func (r *RequestReportCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RequestReportRecordContract. -func (r RequestReportRecordContract) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceCollection. +func (r ResourceCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "apiId", r.APIID) - populate(objectMap, "apiRegion", r.APIRegion) - populate(objectMap, "apiTime", r.APITime) - populate(objectMap, "backendResponseCode", r.BackendResponseCode) - populate(objectMap, "cache", r.Cache) - populate(objectMap, "ipAddress", r.IPAddress) - populate(objectMap, "method", r.Method) - populate(objectMap, "operationId", r.OperationID) - populate(objectMap, "productId", r.ProductID) - populate(objectMap, "requestId", r.RequestID) - populate(objectMap, "requestSize", r.RequestSize) - populate(objectMap, "responseCode", r.ResponseCode) - populate(objectMap, "responseSize", r.ResponseSize) - populate(objectMap, "serviceTime", r.ServiceTime) - populate(objectMap, "subscriptionId", r.SubscriptionID) - populateTimeRFC3339(objectMap, "timestamp", r.Timestamp) - populate(objectMap, "url", r.URL) - populate(objectMap, "userId", r.UserID) + populate(objectMap, "count", r.Count) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RequestReportRecordContract. -func (r *RequestReportRecordContract) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceCollection. +func (r *ResourceCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -10297,59 +11855,14 @@ func (r *RequestReportRecordContract) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "apiId": - err = unpopulate(val, "APIID", &r.APIID) - delete(rawMsg, key) - case "apiRegion": - err = unpopulate(val, "APIRegion", &r.APIRegion) - delete(rawMsg, key) - case "apiTime": - err = unpopulate(val, "APITime", &r.APITime) - delete(rawMsg, key) - case "backendResponseCode": - err = unpopulate(val, "BackendResponseCode", &r.BackendResponseCode) - delete(rawMsg, key) - case "cache": - err = unpopulate(val, "Cache", &r.Cache) - delete(rawMsg, key) - case "ipAddress": - err = unpopulate(val, "IPAddress", &r.IPAddress) - delete(rawMsg, key) - case "method": - err = unpopulate(val, "Method", &r.Method) - delete(rawMsg, key) - case "operationId": - err = unpopulate(val, "OperationID", &r.OperationID) - delete(rawMsg, key) - case "productId": - err = unpopulate(val, "ProductID", &r.ProductID) - delete(rawMsg, key) - case "requestId": - err = unpopulate(val, "RequestID", &r.RequestID) - delete(rawMsg, key) - case "requestSize": - err = unpopulate(val, "RequestSize", &r.RequestSize) - delete(rawMsg, key) - case "responseCode": - err = unpopulate(val, "ResponseCode", &r.ResponseCode) - delete(rawMsg, key) - case "responseSize": - err = unpopulate(val, "ResponseSize", &r.ResponseSize) - delete(rawMsg, key) - case "serviceTime": - err = unpopulate(val, "ServiceTime", &r.ServiceTime) - delete(rawMsg, key) - case "subscriptionId": - err = unpopulate(val, "SubscriptionID", &r.SubscriptionID) - delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &r.Timestamp) + case "count": + err = unpopulate(val, "Count", &r.Count) delete(rawMsg, key) - case "url": - err = unpopulate(val, "URL", &r.URL) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) delete(rawMsg, key) - case "userId": - err = unpopulate(val, "UserID", &r.UserID) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { @@ -10359,8 +11872,8 @@ func (r *RequestReportRecordContract) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ResourceCollectionValueItem. +func (r ResourceCollectionValueItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) @@ -10368,8 +11881,8 @@ func (r Resource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. -func (r *Resource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceCollectionValueItem. +func (r *ResourceCollectionValueItem) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -11269,7 +12782,9 @@ func (s ServiceBaseProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "gatewayUrl", s.GatewayURL) populate(objectMap, "hostnameConfigurations", s.HostnameConfigurations) populate(objectMap, "managementApiUrl", s.ManagementAPIURL) + populate(objectMap, "natGatewayState", s.NatGatewayState) populate(objectMap, "notificationSenderEmail", s.NotificationSenderEmail) + populate(objectMap, "outboundPublicIPAddresses", s.OutboundPublicIPAddresses) populate(objectMap, "platformVersion", s.PlatformVersion) populate(objectMap, "portalUrl", s.PortalURL) populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) @@ -11331,9 +12846,15 @@ func (s *ServiceBaseProperties) UnmarshalJSON(data []byte) error { case "managementApiUrl": err = unpopulate(val, "ManagementAPIURL", &s.ManagementAPIURL) delete(rawMsg, key) + case "natGatewayState": + err = unpopulate(val, "NatGatewayState", &s.NatGatewayState) + delete(rawMsg, key) case "notificationSenderEmail": err = unpopulate(val, "NotificationSenderEmail", &s.NotificationSenderEmail) delete(rawMsg, key) + case "outboundPublicIPAddresses": + err = unpopulate(val, "OutboundPublicIPAddresses", &s.OutboundPublicIPAddresses) + delete(rawMsg, key) case "platformVersion": err = unpopulate(val, "PlatformVersion", &s.PlatformVersion) delete(rawMsg, key) @@ -11582,7 +13103,9 @@ func (s ServiceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "gatewayUrl", s.GatewayURL) populate(objectMap, "hostnameConfigurations", s.HostnameConfigurations) populate(objectMap, "managementApiUrl", s.ManagementAPIURL) + populate(objectMap, "natGatewayState", s.NatGatewayState) populate(objectMap, "notificationSenderEmail", s.NotificationSenderEmail) + populate(objectMap, "outboundPublicIPAddresses", s.OutboundPublicIPAddresses) populate(objectMap, "platformVersion", s.PlatformVersion) populate(objectMap, "portalUrl", s.PortalURL) populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) @@ -11646,9 +13169,15 @@ func (s *ServiceProperties) UnmarshalJSON(data []byte) error { case "managementApiUrl": err = unpopulate(val, "ManagementAPIURL", &s.ManagementAPIURL) delete(rawMsg, key) + case "natGatewayState": + err = unpopulate(val, "NatGatewayState", &s.NatGatewayState) + delete(rawMsg, key) case "notificationSenderEmail": err = unpopulate(val, "NotificationSenderEmail", &s.NotificationSenderEmail) delete(rawMsg, key) + case "outboundPublicIPAddresses": + err = unpopulate(val, "OutboundPublicIPAddresses", &s.OutboundPublicIPAddresses) + delete(rawMsg, key) case "platformVersion": err = unpopulate(val, "PlatformVersion", &s.PlatformVersion) delete(rawMsg, key) @@ -11874,7 +13403,9 @@ func (s ServiceUpdateProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "gatewayUrl", s.GatewayURL) populate(objectMap, "hostnameConfigurations", s.HostnameConfigurations) populate(objectMap, "managementApiUrl", s.ManagementAPIURL) + populate(objectMap, "natGatewayState", s.NatGatewayState) populate(objectMap, "notificationSenderEmail", s.NotificationSenderEmail) + populate(objectMap, "outboundPublicIPAddresses", s.OutboundPublicIPAddresses) populate(objectMap, "platformVersion", s.PlatformVersion) populate(objectMap, "portalUrl", s.PortalURL) populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) @@ -11938,9 +13469,15 @@ func (s *ServiceUpdateProperties) UnmarshalJSON(data []byte) error { case "managementApiUrl": err = unpopulate(val, "ManagementAPIURL", &s.ManagementAPIURL) delete(rawMsg, key) + case "natGatewayState": + err = unpopulate(val, "NatGatewayState", &s.NatGatewayState) + delete(rawMsg, key) case "notificationSenderEmail": err = unpopulate(val, "NotificationSenderEmail", &s.NotificationSenderEmail) delete(rawMsg, key) + case "outboundPublicIPAddresses": + err = unpopulate(val, "OutboundPublicIPAddresses", &s.OutboundPublicIPAddresses) + delete(rawMsg, key) case "platformVersion": err = unpopulate(val, "PlatformVersion", &s.PlatformVersion) delete(rawMsg, key) @@ -13657,6 +15194,157 @@ func (v *VirtualNetworkConfiguration) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WikiCollection. +func (w WikiCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WikiCollection. +func (w *WikiCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &w.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WikiContract. +func (w WikiContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", w.ID) + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WikiContract. +func (w *WikiContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WikiContractProperties. +func (w WikiContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "documents", w.Documents) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WikiContractProperties. +func (w *WikiContractProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "documents": + err = unpopulate(val, "Documents", &w.Documents) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WikiDocumentationContract. +func (w WikiDocumentationContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "documentationId", w.DocumentationID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WikiDocumentationContract. +func (w *WikiDocumentationContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "documentationId": + err = unpopulate(val, "DocumentationID", &w.DocumentationID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WikiUpdateContract. +func (w WikiUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", w.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WikiUpdateContract. +func (w *WikiUpdateContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type X509CertificateName. func (x X509CertificateName) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/namedvalue_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/namedvalue_client.go index 32a875a6c0f2..54ebe24deded 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/namedvalue_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/namedvalue_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type NamedValueClient struct { } // NewNamedValueClient creates a new instance of NamedValueClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewNamedValueClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NamedValueClient, error) { @@ -49,8 +47,8 @@ func NewNamedValueClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Creates or updates named value. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - namedValueID - Identifier of the NamedValue. // - parameters - Create parameters. @@ -62,9 +60,10 @@ func (client *NamedValueClient) BeginCreateOrUpdate(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamedValueClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamedValueClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NamedValueClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,20 +72,22 @@ func (client *NamedValueClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates named value. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *NamedValueClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, parameters NamedValueCreateContract, options *NamedValueClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, namedValueID, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,36 +114,41 @@ func (client *NamedValueClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Delete - Deletes specific named value from the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - namedValueID - Identifier of the NamedValue. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - options - NamedValueClientDeleteOptions contains the optional parameters for the NamedValueClient.Delete method. func (client *NamedValueClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, ifMatch string, options *NamedValueClientDeleteOptions) (NamedValueClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, namedValueID, ifMatch, options) if err != nil { return NamedValueClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NamedValueClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return NamedValueClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return NamedValueClientDeleteResponse{}, err } return NamedValueClientDeleteResponse{}, nil } @@ -171,7 +177,7 @@ func (client *NamedValueClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -181,24 +187,27 @@ func (client *NamedValueClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets the details of the named value specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - namedValueID - Identifier of the NamedValue. // - options - NamedValueClientGetOptions contains the optional parameters for the NamedValueClient.Get method. func (client *NamedValueClient) Get(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, options *NamedValueClientGetOptions) (NamedValueClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, namedValueID, options) if err != nil { return NamedValueClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NamedValueClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NamedValueClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NamedValueClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -225,7 +234,7 @@ func (client *NamedValueClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -245,24 +254,27 @@ func (client *NamedValueClient) getHandleResponse(resp *http.Response) (NamedVal // GetEntityTag - Gets the entity state (Etag) version of the named value specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - namedValueID - Identifier of the NamedValue. // - options - NamedValueClientGetEntityTagOptions contains the optional parameters for the NamedValueClient.GetEntityTag method. func (client *NamedValueClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, options *NamedValueClientGetEntityTagOptions) (NamedValueClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, namedValueID, options) if err != nil { return NamedValueClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NamedValueClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NamedValueClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NamedValueClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -289,7 +301,7 @@ func (client *NamedValueClient) getEntityTagCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -307,8 +319,8 @@ func (client *NamedValueClient) getEntityTagHandleResponse(resp *http.Response) // NewListByServicePager - Lists a collection of named values defined within a service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - NamedValueClientListByServiceOptions contains the optional parameters for the NamedValueClient.NewListByServicePager // method. @@ -372,7 +384,7 @@ func (client *NamedValueClient) listByServiceCreateRequest(ctx context.Context, if options != nil && options.IsKeyVaultRefreshFailed != nil { reqQP.Set("isKeyVaultRefreshFailed", strconv.FormatBool(*options.IsKeyVaultRefreshFailed)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -390,24 +402,27 @@ func (client *NamedValueClient) listByServiceHandleResponse(resp *http.Response) // ListValue - Gets the secret of the named value specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - namedValueID - Identifier of the NamedValue. // - options - NamedValueClientListValueOptions contains the optional parameters for the NamedValueClient.ListValue method. func (client *NamedValueClient) ListValue(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, options *NamedValueClientListValueOptions) (NamedValueClientListValueResponse, error) { + var err error req, err := client.listValueCreateRequest(ctx, resourceGroupName, serviceName, namedValueID, options) if err != nil { return NamedValueClientListValueResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NamedValueClientListValueResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NamedValueClientListValueResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NamedValueClientListValueResponse{}, err } - return client.listValueHandleResponse(resp) + resp, err := client.listValueHandleResponse(httpResp) + return resp, err } // listValueCreateRequest creates the ListValue request. @@ -434,7 +449,7 @@ func (client *NamedValueClient) listValueCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -455,8 +470,8 @@ func (client *NamedValueClient) listValueHandleResponse(resp *http.Response) (Na // BeginRefreshSecret - Refresh the secret of the named value specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - namedValueID - Identifier of the NamedValue. // - options - NamedValueClientBeginRefreshSecretOptions contains the optional parameters for the NamedValueClient.BeginRefreshSecret @@ -467,9 +482,10 @@ func (client *NamedValueClient) BeginRefreshSecret(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamedValueClientRefreshSecretResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamedValueClientRefreshSecretResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NamedValueClientRefreshSecretResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -478,20 +494,22 @@ func (client *NamedValueClient) BeginRefreshSecret(ctx context.Context, resource // RefreshSecret - Refresh the secret of the named value specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *NamedValueClient) refreshSecret(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, options *NamedValueClientBeginRefreshSecretOptions) (*http.Response, error) { + var err error req, err := client.refreshSecretCreateRequest(ctx, resourceGroupName, serviceName, namedValueID, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // refreshSecretCreateRequest creates the RefreshSecret request. @@ -518,7 +536,7 @@ func (client *NamedValueClient) refreshSecretCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -527,8 +545,8 @@ func (client *NamedValueClient) refreshSecretCreateRequest(ctx context.Context, // BeginUpdate - Updates the specific named value. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - namedValueID - Identifier of the NamedValue. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -541,9 +559,10 @@ func (client *NamedValueClient) BeginUpdate(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamedValueClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NamedValueClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[NamedValueClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -552,20 +571,22 @@ func (client *NamedValueClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Updates the specific named value. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *NamedValueClient) update(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, ifMatch string, parameters NamedValueUpdateParameters, options *NamedValueClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, namedValueID, ifMatch, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -592,9 +613,12 @@ func (client *NamedValueClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/namedvalue_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/namedvalue_client_example_test.go index 5f5d0ee0387b..674508c7a150 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/namedvalue_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/namedvalue_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNamedValues.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListNamedValues.json func ExampleNamedValueClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -81,7 +81,7 @@ func ExampleNamedValueClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadNamedValue.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadNamedValue.json func ExampleNamedValueClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -98,7 +98,7 @@ func ExampleNamedValueClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetNamedValue.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetNamedValue.json func ExampleNamedValueClient_Get_apiManagementGetNamedValue() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -131,7 +131,7 @@ func ExampleNamedValueClient_Get_apiManagementGetNamedValue() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetNamedValueWithKeyVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetNamedValueWithKeyVault.json func ExampleNamedValueClient_Get_apiManagementGetNamedValueWithKeyVault() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -171,7 +171,7 @@ func ExampleNamedValueClient_Get_apiManagementGetNamedValueWithKeyVault() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNamedValue.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateNamedValue.json func ExampleNamedValueClient_BeginCreateOrUpdate_apiManagementCreateNamedValue() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -217,7 +217,7 @@ func ExampleNamedValueClient_BeginCreateOrUpdate_apiManagementCreateNamedValue() // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNamedValueWithKeyVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateNamedValueWithKeyVault.json func ExampleNamedValueClient_BeginCreateOrUpdate_apiManagementCreateNamedValueWithKeyVault() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -273,7 +273,7 @@ func ExampleNamedValueClient_BeginCreateOrUpdate_apiManagementCreateNamedValueWi // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateNamedValue.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateNamedValue.json func ExampleNamedValueClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -318,7 +318,7 @@ func ExampleNamedValueClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteNamedValue.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteNamedValue.json func ExampleNamedValueClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -335,7 +335,7 @@ func ExampleNamedValueClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementNamedValueListValue.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementNamedValueListValue.json func ExampleNamedValueClient_ListValue() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -358,7 +358,7 @@ func ExampleNamedValueClient_ListValue() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementRefreshNamedValue.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementRefreshNamedValue.json func ExampleNamedValueClient_BeginRefreshSecret() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/networkstatus_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/networkstatus_client.go index 219ba49985ca..751d60e89623 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/networkstatus_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/networkstatus_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type NetworkStatusClient struct { } // NewNetworkStatusClient creates a new instance of NetworkStatusClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewNetworkStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkStatusClient, error) { @@ -49,26 +47,29 @@ func NewNetworkStatusClient(subscriptionID string, credential azcore.TokenCreden // inside the Cloud Service. This also returns the DNS Servers as visible to the CloudService. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - locationName - Location in which the API Management service is deployed. This is one of the Azure Regions like West US, // East US, South Central US. // - options - NetworkStatusClientListByLocationOptions contains the optional parameters for the NetworkStatusClient.ListByLocation // method. func (client *NetworkStatusClient) ListByLocation(ctx context.Context, resourceGroupName string, serviceName string, locationName string, options *NetworkStatusClientListByLocationOptions) (NetworkStatusClientListByLocationResponse, error) { + var err error req, err := client.listByLocationCreateRequest(ctx, resourceGroupName, serviceName, locationName, options) if err != nil { return NetworkStatusClientListByLocationResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NetworkStatusClientListByLocationResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkStatusClientListByLocationResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkStatusClientListByLocationResponse{}, err } - return client.listByLocationHandleResponse(resp) + resp, err := client.listByLocationHandleResponse(httpResp) + return resp, err } // listByLocationCreateRequest creates the ListByLocation request. @@ -95,7 +96,7 @@ func (client *NetworkStatusClient) listByLocationCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,24 +115,27 @@ func (client *NetworkStatusClient) listByLocationHandleResponse(resp *http.Respo // inside the Cloud Service. This also returns the DNS Servers as visible to the CloudService. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - NetworkStatusClientListByServiceOptions contains the optional parameters for the NetworkStatusClient.ListByService // method. func (client *NetworkStatusClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, options *NetworkStatusClientListByServiceOptions) (NetworkStatusClientListByServiceResponse, error) { + var err error req, err := client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return NetworkStatusClientListByServiceResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NetworkStatusClientListByServiceResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NetworkStatusClientListByServiceResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkStatusClientListByServiceResponse{}, err } - return client.listByServiceHandleResponse(resp) + resp, err := client.listByServiceHandleResponse(httpResp) + return resp, err } // listByServiceCreateRequest creates the ListByService request. @@ -154,7 +158,7 @@ func (client *NetworkStatusClient) listByServiceCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/networkstatus_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/networkstatus_client_example_test.go index 79f4a3bc9e6e..126d4fb5880d 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/networkstatus_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/networkstatus_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetNetworkStatus.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementServiceGetNetworkStatus.json func ExampleNetworkStatusClient_ListByService() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -172,7 +172,7 @@ func ExampleNetworkStatusClient_ListByService() { // }} } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetNetworkStatusByLocation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementServiceGetNetworkStatusByLocation.json func ExampleNetworkStatusClient_ListByLocation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/notification_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/notification_client.go index 0da7cb4f98cf..7affc8f8960d 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/notification_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/notification_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type NotificationClient struct { } // NewNotificationClient creates a new instance of NotificationClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewNotificationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NotificationClient, error) { @@ -49,25 +47,28 @@ func NewNotificationClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Create or Update API Management publisher notification. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - notificationName - Notification Name Identifier. // - options - NotificationClientCreateOrUpdateOptions contains the optional parameters for the NotificationClient.CreateOrUpdate // method. func (client *NotificationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, options *NotificationClientCreateOrUpdateOptions) (NotificationClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, notificationName, options) if err != nil { return NotificationClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NotificationClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NotificationClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NotificationClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -94,7 +95,7 @@ func (client *NotificationClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -115,24 +116,27 @@ func (client *NotificationClient) createOrUpdateHandleResponse(resp *http.Respon // Get - Gets the details of the Notification specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - notificationName - Notification Name Identifier. // - options - NotificationClientGetOptions contains the optional parameters for the NotificationClient.Get method. func (client *NotificationClient) Get(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, options *NotificationClientGetOptions) (NotificationClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, notificationName, options) if err != nil { return NotificationClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NotificationClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NotificationClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NotificationClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -159,7 +163,7 @@ func (client *NotificationClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -176,8 +180,8 @@ func (client *NotificationClient) getHandleResponse(resp *http.Response) (Notifi // NewListByServicePager - Lists a collection of properties defined within a service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - NotificationClientListByServiceOptions contains the optional parameters for the NotificationClient.NewListByServicePager // method. @@ -235,7 +239,7 @@ func (client *NotificationClient) listByServiceCreateRequest(ctx context.Context if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/notification_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/notification_client_example_test.go index a699db6872bb..d211919473d4 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/notification_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/notification_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNotifications.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListNotifications.json func ExampleNotificationClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -155,7 +155,7 @@ func ExampleNotificationClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetNotification.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetNotification.json func ExampleNotificationClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -192,7 +192,7 @@ func ExampleNotificationClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNotification.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateNotification.json func ExampleNotificationClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientemail_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientemail_client.go index 210708dae801..c0b83c33e5b5 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientemail_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientemail_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type NotificationRecipientEmailClient struct { } // NewNotificationRecipientEmailClient creates a new instance of NotificationRecipientEmailClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewNotificationRecipientEmailClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NotificationRecipientEmailClient, error) { @@ -47,26 +45,28 @@ func NewNotificationRecipientEmailClient(subscriptionID string, credential azcor // CheckEntityExists - Determine if Notification Recipient Email subscribed to the notification. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - notificationName - Notification Name Identifier. // - email - Email identifier. // - options - NotificationRecipientEmailClientCheckEntityExistsOptions contains the optional parameters for the NotificationRecipientEmailClient.CheckEntityExists // method. func (client *NotificationRecipientEmailClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, email string, options *NotificationRecipientEmailClientCheckEntityExistsOptions) (NotificationRecipientEmailClientCheckEntityExistsResponse, error) { + var err error req, err := client.checkEntityExistsCreateRequest(ctx, resourceGroupName, serviceName, notificationName, email, options) if err != nil { return NotificationRecipientEmailClientCheckEntityExistsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NotificationRecipientEmailClientCheckEntityExistsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent, http.StatusNotFound) { - return NotificationRecipientEmailClientCheckEntityExistsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent, http.StatusNotFound) { + err = runtime.NewResponseError(httpResp) + return NotificationRecipientEmailClientCheckEntityExistsResponse{}, err } - return NotificationRecipientEmailClientCheckEntityExistsResponse{Success: resp.StatusCode >= 200 && resp.StatusCode < 300}, nil + return NotificationRecipientEmailClientCheckEntityExistsResponse{Success: httpResp.StatusCode >= 200 && httpResp.StatusCode < 300}, nil } // checkEntityExistsCreateRequest creates the CheckEntityExists request. @@ -97,7 +97,7 @@ func (client *NotificationRecipientEmailClient) checkEntityExistsCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -106,26 +106,29 @@ func (client *NotificationRecipientEmailClient) checkEntityExistsCreateRequest(c // CreateOrUpdate - Adds the Email address to the list of Recipients for the Notification. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - notificationName - Notification Name Identifier. // - email - Email identifier. // - options - NotificationRecipientEmailClientCreateOrUpdateOptions contains the optional parameters for the NotificationRecipientEmailClient.CreateOrUpdate // method. func (client *NotificationRecipientEmailClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, email string, options *NotificationRecipientEmailClientCreateOrUpdateOptions) (NotificationRecipientEmailClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, notificationName, email, options) if err != nil { return NotificationRecipientEmailClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NotificationRecipientEmailClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return NotificationRecipientEmailClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return NotificationRecipientEmailClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -156,7 +159,7 @@ func (client *NotificationRecipientEmailClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,24 +177,26 @@ func (client *NotificationRecipientEmailClient) createOrUpdateHandleResponse(res // Delete - Removes the email from the list of Notification. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - notificationName - Notification Name Identifier. // - email - Email identifier. // - options - NotificationRecipientEmailClientDeleteOptions contains the optional parameters for the NotificationRecipientEmailClient.Delete // method. func (client *NotificationRecipientEmailClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, email string, options *NotificationRecipientEmailClientDeleteOptions) (NotificationRecipientEmailClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, notificationName, email, options) if err != nil { return NotificationRecipientEmailClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NotificationRecipientEmailClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return NotificationRecipientEmailClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return NotificationRecipientEmailClientDeleteResponse{}, err } return NotificationRecipientEmailClientDeleteResponse{}, nil } @@ -224,7 +229,7 @@ func (client *NotificationRecipientEmailClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -233,25 +238,28 @@ func (client *NotificationRecipientEmailClient) deleteCreateRequest(ctx context. // ListByNotification - Gets the list of the Notification Recipient Emails subscribed to a notification. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - notificationName - Notification Name Identifier. // - options - NotificationRecipientEmailClientListByNotificationOptions contains the optional parameters for the NotificationRecipientEmailClient.ListByNotification // method. func (client *NotificationRecipientEmailClient) ListByNotification(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, options *NotificationRecipientEmailClientListByNotificationOptions) (NotificationRecipientEmailClientListByNotificationResponse, error) { + var err error req, err := client.listByNotificationCreateRequest(ctx, resourceGroupName, serviceName, notificationName, options) if err != nil { return NotificationRecipientEmailClientListByNotificationResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NotificationRecipientEmailClientListByNotificationResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NotificationRecipientEmailClientListByNotificationResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NotificationRecipientEmailClientListByNotificationResponse{}, err } - return client.listByNotificationHandleResponse(resp) + resp, err := client.listByNotificationHandleResponse(httpResp) + return resp, err } // listByNotificationCreateRequest creates the ListByNotification request. @@ -278,7 +286,7 @@ func (client *NotificationRecipientEmailClient) listByNotificationCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientemail_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientemail_client_example_test.go index 394ad4b63e71..e063db06f7bc 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientemail_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientemail_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNotificationRecipientEmails.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListNotificationRecipientEmails.json func ExampleNotificationRecipientEmailClient_ListByNotification() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -65,7 +65,7 @@ func ExampleNotificationRecipientEmailClient_ListByNotification() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadNotificationRecipientEmail.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadNotificationRecipientEmail.json func ExampleNotificationRecipientEmailClient_CheckEntityExists() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -82,7 +82,7 @@ func ExampleNotificationRecipientEmailClient_CheckEntityExists() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNotificationRecipientEmail.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateNotificationRecipientEmail.json func ExampleNotificationRecipientEmailClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -110,7 +110,7 @@ func ExampleNotificationRecipientEmailClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteNotificationRecipientEmail.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteNotificationRecipientEmail.json func ExampleNotificationRecipientEmailClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientuser_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientuser_client.go index e1775c3fed80..0999ce3ab116 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientuser_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientuser_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type NotificationRecipientUserClient struct { } // NewNotificationRecipientUserClient creates a new instance of NotificationRecipientUserClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewNotificationRecipientUserClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NotificationRecipientUserClient, error) { @@ -47,26 +45,28 @@ func NewNotificationRecipientUserClient(subscriptionID string, credential azcore // CheckEntityExists - Determine if the Notification Recipient User is subscribed to the notification. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - notificationName - Notification Name Identifier. // - userID - User identifier. Must be unique in the current API Management service instance. // - options - NotificationRecipientUserClientCheckEntityExistsOptions contains the optional parameters for the NotificationRecipientUserClient.CheckEntityExists // method. func (client *NotificationRecipientUserClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, userID string, options *NotificationRecipientUserClientCheckEntityExistsOptions) (NotificationRecipientUserClientCheckEntityExistsResponse, error) { + var err error req, err := client.checkEntityExistsCreateRequest(ctx, resourceGroupName, serviceName, notificationName, userID, options) if err != nil { return NotificationRecipientUserClientCheckEntityExistsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NotificationRecipientUserClientCheckEntityExistsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent, http.StatusNotFound) { - return NotificationRecipientUserClientCheckEntityExistsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent, http.StatusNotFound) { + err = runtime.NewResponseError(httpResp) + return NotificationRecipientUserClientCheckEntityExistsResponse{}, err } - return NotificationRecipientUserClientCheckEntityExistsResponse{Success: resp.StatusCode >= 200 && resp.StatusCode < 300}, nil + return NotificationRecipientUserClientCheckEntityExistsResponse{Success: httpResp.StatusCode >= 200 && httpResp.StatusCode < 300}, nil } // checkEntityExistsCreateRequest creates the CheckEntityExists request. @@ -97,7 +97,7 @@ func (client *NotificationRecipientUserClient) checkEntityExistsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -106,26 +106,29 @@ func (client *NotificationRecipientUserClient) checkEntityExistsCreateRequest(ct // CreateOrUpdate - Adds the API Management User to the list of Recipients for the Notification. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - notificationName - Notification Name Identifier. // - userID - User identifier. Must be unique in the current API Management service instance. // - options - NotificationRecipientUserClientCreateOrUpdateOptions contains the optional parameters for the NotificationRecipientUserClient.CreateOrUpdate // method. func (client *NotificationRecipientUserClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, userID string, options *NotificationRecipientUserClientCreateOrUpdateOptions) (NotificationRecipientUserClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, notificationName, userID, options) if err != nil { return NotificationRecipientUserClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NotificationRecipientUserClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return NotificationRecipientUserClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return NotificationRecipientUserClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -156,7 +159,7 @@ func (client *NotificationRecipientUserClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,24 +177,26 @@ func (client *NotificationRecipientUserClient) createOrUpdateHandleResponse(resp // Delete - Removes the API Management user from the list of Notification. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - notificationName - Notification Name Identifier. // - userID - User identifier. Must be unique in the current API Management service instance. // - options - NotificationRecipientUserClientDeleteOptions contains the optional parameters for the NotificationRecipientUserClient.Delete // method. func (client *NotificationRecipientUserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, userID string, options *NotificationRecipientUserClientDeleteOptions) (NotificationRecipientUserClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, notificationName, userID, options) if err != nil { return NotificationRecipientUserClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NotificationRecipientUserClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return NotificationRecipientUserClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return NotificationRecipientUserClientDeleteResponse{}, err } return NotificationRecipientUserClientDeleteResponse{}, nil } @@ -224,7 +229,7 @@ func (client *NotificationRecipientUserClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -233,25 +238,28 @@ func (client *NotificationRecipientUserClient) deleteCreateRequest(ctx context.C // ListByNotification - Gets the list of the Notification Recipient User subscribed to the notification. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - notificationName - Notification Name Identifier. // - options - NotificationRecipientUserClientListByNotificationOptions contains the optional parameters for the NotificationRecipientUserClient.ListByNotification // method. func (client *NotificationRecipientUserClient) ListByNotification(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, options *NotificationRecipientUserClientListByNotificationOptions) (NotificationRecipientUserClientListByNotificationResponse, error) { + var err error req, err := client.listByNotificationCreateRequest(ctx, resourceGroupName, serviceName, notificationName, options) if err != nil { return NotificationRecipientUserClientListByNotificationResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return NotificationRecipientUserClientListByNotificationResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return NotificationRecipientUserClientListByNotificationResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NotificationRecipientUserClientListByNotificationResponse{}, err } - return client.listByNotificationHandleResponse(resp) + resp, err := client.listByNotificationHandleResponse(httpResp) + return resp, err } // listByNotificationCreateRequest creates the ListByNotification request. @@ -278,7 +286,7 @@ func (client *NotificationRecipientUserClient) listByNotificationCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientuser_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientuser_client_example_test.go index cd0e8e7c10be..e36a048ed0c0 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientuser_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientuser_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNotificationRecipientUsers.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListNotificationRecipientUsers.json func ExampleNotificationRecipientUserClient_ListByNotification() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -49,7 +49,7 @@ func ExampleNotificationRecipientUserClient_ListByNotification() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadNotificationRecipientUser.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadNotificationRecipientUser.json func ExampleNotificationRecipientUserClient_CheckEntityExists() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleNotificationRecipientUserClient_CheckEntityExists() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNotificationRecipientUser.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateNotificationRecipientUser.json func ExampleNotificationRecipientUserClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -94,7 +94,7 @@ func ExampleNotificationRecipientUserClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteNotificationRecipientUser.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteNotificationRecipientUser.json func ExampleNotificationRecipientUserClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/openidconnectprovider_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/openidconnectprovider_client.go index f40b172123a9..47729caedbc2 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/openidconnectprovider_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/openidconnectprovider_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type OpenIDConnectProviderClient struct { } // NewOpenIDConnectProviderClient creates a new instance of OpenIDConnectProviderClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewOpenIDConnectProviderClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OpenIDConnectProviderClient, error) { @@ -49,26 +47,29 @@ func NewOpenIDConnectProviderClient(subscriptionID string, credential azcore.Tok // CreateOrUpdate - Creates or updates the OpenID Connect Provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - opid - Identifier of the OpenID Connect Provider. // - parameters - Create parameters. // - options - OpenIDConnectProviderClientCreateOrUpdateOptions contains the optional parameters for the OpenIDConnectProviderClient.CreateOrUpdate // method. func (client *OpenIDConnectProviderClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, opid string, parameters OpenidConnectProviderContract, options *OpenIDConnectProviderClientCreateOrUpdateOptions) (OpenIDConnectProviderClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, opid, parameters, options) if err != nil { return OpenIDConnectProviderClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OpenIDConnectProviderClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return OpenIDConnectProviderClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return OpenIDConnectProviderClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -95,13 +96,16 @@ func (client *OpenIDConnectProviderClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -119,8 +123,8 @@ func (client *OpenIDConnectProviderClient) createOrUpdateHandleResponse(resp *ht // Delete - Deletes specific OpenID Connect Provider of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - opid - Identifier of the OpenID Connect Provider. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -128,16 +132,18 @@ func (client *OpenIDConnectProviderClient) createOrUpdateHandleResponse(resp *ht // - options - OpenIDConnectProviderClientDeleteOptions contains the optional parameters for the OpenIDConnectProviderClient.Delete // method. func (client *OpenIDConnectProviderClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, opid string, ifMatch string, options *OpenIDConnectProviderClientDeleteOptions) (OpenIDConnectProviderClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, opid, ifMatch, options) if err != nil { return OpenIDConnectProviderClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OpenIDConnectProviderClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return OpenIDConnectProviderClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return OpenIDConnectProviderClientDeleteResponse{}, err } return OpenIDConnectProviderClientDeleteResponse{}, nil } @@ -166,7 +172,7 @@ func (client *OpenIDConnectProviderClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -176,25 +182,28 @@ func (client *OpenIDConnectProviderClient) deleteCreateRequest(ctx context.Conte // Get - Gets specific OpenID Connect Provider without secrets. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - opid - Identifier of the OpenID Connect Provider. // - options - OpenIDConnectProviderClientGetOptions contains the optional parameters for the OpenIDConnectProviderClient.Get // method. func (client *OpenIDConnectProviderClient) Get(ctx context.Context, resourceGroupName string, serviceName string, opid string, options *OpenIDConnectProviderClientGetOptions) (OpenIDConnectProviderClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, opid, options) if err != nil { return OpenIDConnectProviderClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OpenIDConnectProviderClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OpenIDConnectProviderClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OpenIDConnectProviderClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -221,7 +230,7 @@ func (client *OpenIDConnectProviderClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -241,25 +250,28 @@ func (client *OpenIDConnectProviderClient) getHandleResponse(resp *http.Response // GetEntityTag - Gets the entity state (Etag) version of the openIdConnectProvider specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - opid - Identifier of the OpenID Connect Provider. // - options - OpenIDConnectProviderClientGetEntityTagOptions contains the optional parameters for the OpenIDConnectProviderClient.GetEntityTag // method. func (client *OpenIDConnectProviderClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, opid string, options *OpenIDConnectProviderClientGetEntityTagOptions) (OpenIDConnectProviderClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, opid, options) if err != nil { return OpenIDConnectProviderClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OpenIDConnectProviderClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OpenIDConnectProviderClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OpenIDConnectProviderClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -286,7 +298,7 @@ func (client *OpenIDConnectProviderClient) getEntityTagCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -304,8 +316,8 @@ func (client *OpenIDConnectProviderClient) getEntityTagHandleResponse(resp *http // NewListByServicePager - Lists of all the OpenId Connect Providers. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - OpenIDConnectProviderClientListByServiceOptions contains the optional parameters for the OpenIDConnectProviderClient.NewListByServicePager // method. @@ -366,7 +378,7 @@ func (client *OpenIDConnectProviderClient) listByServiceCreateRequest(ctx contex if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,25 +396,28 @@ func (client *OpenIDConnectProviderClient) listByServiceHandleResponse(resp *htt // ListSecrets - Gets the client secret details of the OpenID Connect Provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - opid - Identifier of the OpenID Connect Provider. // - options - OpenIDConnectProviderClientListSecretsOptions contains the optional parameters for the OpenIDConnectProviderClient.ListSecrets // method. func (client *OpenIDConnectProviderClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, opid string, options *OpenIDConnectProviderClientListSecretsOptions) (OpenIDConnectProviderClientListSecretsResponse, error) { + var err error req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, serviceName, opid, options) if err != nil { return OpenIDConnectProviderClientListSecretsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OpenIDConnectProviderClientListSecretsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OpenIDConnectProviderClientListSecretsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OpenIDConnectProviderClientListSecretsResponse{}, err } - return client.listSecretsHandleResponse(resp) + resp, err := client.listSecretsHandleResponse(httpResp) + return resp, err } // listSecretsCreateRequest creates the ListSecrets request. @@ -429,7 +444,7 @@ func (client *OpenIDConnectProviderClient) listSecretsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -450,8 +465,8 @@ func (client *OpenIDConnectProviderClient) listSecretsHandleResponse(resp *http. // Update - Updates the specific OpenID Connect Provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - opid - Identifier of the OpenID Connect Provider. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -460,18 +475,21 @@ func (client *OpenIDConnectProviderClient) listSecretsHandleResponse(resp *http. // - options - OpenIDConnectProviderClientUpdateOptions contains the optional parameters for the OpenIDConnectProviderClient.Update // method. func (client *OpenIDConnectProviderClient) Update(ctx context.Context, resourceGroupName string, serviceName string, opid string, ifMatch string, parameters OpenidConnectProviderUpdateContract, options *OpenIDConnectProviderClientUpdateOptions) (OpenIDConnectProviderClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, opid, ifMatch, parameters, options) if err != nil { return OpenIDConnectProviderClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OpenIDConnectProviderClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OpenIDConnectProviderClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OpenIDConnectProviderClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -498,11 +516,14 @@ func (client *OpenIDConnectProviderClient) updateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/openidconnectprovider_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/openidconnectprovider_client_example_test.go index c1317ce23727..5da175eac161 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/openidconnectprovider_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/openidconnectprovider_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListOpenIdConnectProviders.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListOpenIdConnectProviders.json func ExampleOpenIDConnectProviderClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -55,13 +55,15 @@ func ExampleOpenIDConnectProviderClient_NewListByServicePager() { // ClientID: to.Ptr("oidprovidertemplate2"), // DisplayName: to.Ptr("templateoidprovider2"), // MetadataEndpoint: to.Ptr("https://oidprovider-template2.net"), + // UseInAPIDocumentation: to.Ptr(true), + // UseInTestConsole: to.Ptr(false), // }, // }}, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadOpenIdConnectProvider.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadOpenIdConnectProvider.json func ExampleOpenIDConnectProviderClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -78,7 +80,7 @@ func ExampleOpenIDConnectProviderClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetOpenIdConnectProvider.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetOpenIdConnectProvider.json func ExampleOpenIDConnectProviderClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -105,11 +107,13 @@ func ExampleOpenIDConnectProviderClient_Get() { // ClientID: to.Ptr("oidprovidertemplate2"), // DisplayName: to.Ptr("templateoidprovider2"), // MetadataEndpoint: to.Ptr("https://oidprovider-template2.net"), + // UseInAPIDocumentation: to.Ptr(true), + // UseInTestConsole: to.Ptr(false), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateOpenIdConnectProvider.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateOpenIdConnectProvider.json func ExampleOpenIDConnectProviderClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -122,10 +126,12 @@ func ExampleOpenIDConnectProviderClient_CreateOrUpdate() { } res, err := clientFactory.NewOpenIDConnectProviderClient().CreateOrUpdate(ctx, "rg1", "apimService1", "templateOpenIdConnect3", armapimanagement.OpenidConnectProviderContract{ Properties: &armapimanagement.OpenidConnectProviderContractProperties{ - ClientID: to.Ptr("oidprovidertemplate3"), - ClientSecret: to.Ptr("x"), - DisplayName: to.Ptr("templateoidprovider3"), - MetadataEndpoint: to.Ptr("https://oidprovider-template3.net"), + ClientID: to.Ptr("oidprovidertemplate3"), + ClientSecret: to.Ptr("x"), + DisplayName: to.Ptr("templateoidprovider3"), + MetadataEndpoint: to.Ptr("https://oidprovider-template3.net"), + UseInAPIDocumentation: to.Ptr(true), + UseInTestConsole: to.Ptr(false), }, }, &armapimanagement.OpenIDConnectProviderClientCreateOrUpdateOptions{IfMatch: nil}) if err != nil { @@ -142,11 +148,13 @@ func ExampleOpenIDConnectProviderClient_CreateOrUpdate() { // ClientID: to.Ptr("oidprovidertemplate3"), // DisplayName: to.Ptr("templateoidprovider3"), // MetadataEndpoint: to.Ptr("https://oidprovider-template3.net"), + // UseInAPIDocumentation: to.Ptr(true), + // UseInTestConsole: to.Ptr(false), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateOpenIdConnectProvider.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateOpenIdConnectProvider.json func ExampleOpenIDConnectProviderClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -159,7 +167,9 @@ func ExampleOpenIDConnectProviderClient_Update() { } res, err := clientFactory.NewOpenIDConnectProviderClient().Update(ctx, "rg1", "apimService1", "templateOpenIdConnect2", "*", armapimanagement.OpenidConnectProviderUpdateContract{ Properties: &armapimanagement.OpenidConnectProviderUpdateContractProperties{ - ClientSecret: to.Ptr("updatedsecret"), + ClientSecret: to.Ptr("updatedsecret"), + UseInAPIDocumentation: to.Ptr(true), + UseInTestConsole: to.Ptr(false), }, }, nil) if err != nil { @@ -177,11 +187,13 @@ func ExampleOpenIDConnectProviderClient_Update() { // ClientID: to.Ptr("oidprovidertemplate2"), // DisplayName: to.Ptr("templateoidprovider2"), // MetadataEndpoint: to.Ptr("https://oidprovider-template2.net"), + // UseInAPIDocumentation: to.Ptr(true), + // UseInTestConsole: to.Ptr(false), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteOpenIdConnectProvider.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteOpenIdConnectProvider.json func ExampleOpenIDConnectProviderClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -198,7 +210,7 @@ func ExampleOpenIDConnectProviderClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementOpenidConnectProviderListSecrets.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementOpenidConnectProviderListSecrets.json func ExampleOpenIDConnectProviderClient_ListSecrets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/operation_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/operation_client.go index c833fe730dbe..cdac68e75c7f 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/operation_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/operation_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type OperationClient struct { } // NewOperationClient creates a new instance of OperationClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewOperationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationClient, error) { @@ -48,8 +46,8 @@ func NewOperationClient(subscriptionID string, credential azcore.TokenCredential // NewListByTagsPager - Lists a collection of operations associated with tags. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -119,7 +117,7 @@ func (client *OperationClient) listByTagsCreateRequest(ctx context.Context, reso if options != nil && options.IncludeNotTaggedOperations != nil { reqQP.Set("includeNotTaggedOperations", strconv.FormatBool(*options.IncludeNotTaggedOperations)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/operation_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/operation_client_example_test.go index 6f596cc9332c..7ac557ba31f3 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/operation_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/operation_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiOperationsByTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApiOperationsByTags.json func ExampleOperationClient_NewListByTagsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/operations_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/operations_client.go index 472db7d5457c..d028d23fc930 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/operations_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/operations_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -40,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available REST API operations of the Microsoft.ApiManagement provider. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -78,7 +77,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/operations_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/operations_client_example_test.go index 772620741bfe..dc0437cab70b 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/operations_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/operations_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListOperations.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListOperations.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/options.go b/sdk/resourcemanager/apimanagement/armapimanagement/options.go new file mode 100644 index 000000000000..5cc2f1ddc18b --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/options.go @@ -0,0 +1,2944 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armapimanagement + +// APIClientBeginCreateOrUpdateOptions contains the optional parameters for the APIClient.BeginCreateOrUpdate method. +type APIClientBeginCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// APIClientDeleteOptions contains the optional parameters for the APIClient.Delete method. +type APIClientDeleteOptions struct { + // Delete all revisions of the Api. + DeleteRevisions *bool +} + +// APIClientGetEntityTagOptions contains the optional parameters for the APIClient.GetEntityTag method. +type APIClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// APIClientGetOptions contains the optional parameters for the APIClient.Get method. +type APIClientGetOptions struct { + // placeholder for future optional parameters +} + +// APIClientListByServiceOptions contains the optional parameters for the APIClient.NewListByServicePager method. +type APIClientListByServiceOptions struct { + // Include full ApiVersionSet resource in response + ExpandAPIVersionSet *bool + + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | isCurrent | filter | eq, ne | | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Include tags in the response. + Tags *string + + // Number of records to return. + Top *int32 +} + +// APIClientListByTagsOptions contains the optional parameters for the APIClient.NewListByTagsPager method. +type APIClientListByTagsOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | isCurrent | filter | eq | | + Filter *string + + // Include not tagged APIs. + IncludeNotTaggedApis *bool + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// APIClientUpdateOptions contains the optional parameters for the APIClient.Update method. +type APIClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// APIDiagnosticClientCreateOrUpdateOptions contains the optional parameters for the APIDiagnosticClient.CreateOrUpdate method. +type APIDiagnosticClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// APIDiagnosticClientDeleteOptions contains the optional parameters for the APIDiagnosticClient.Delete method. +type APIDiagnosticClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// APIDiagnosticClientGetEntityTagOptions contains the optional parameters for the APIDiagnosticClient.GetEntityTag method. +type APIDiagnosticClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// APIDiagnosticClientGetOptions contains the optional parameters for the APIDiagnosticClient.Get method. +type APIDiagnosticClientGetOptions struct { + // placeholder for future optional parameters +} + +// APIDiagnosticClientListByServiceOptions contains the optional parameters for the APIDiagnosticClient.NewListByServicePager +// method. +type APIDiagnosticClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// APIDiagnosticClientUpdateOptions contains the optional parameters for the APIDiagnosticClient.Update method. +type APIDiagnosticClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// APIExportClientGetOptions contains the optional parameters for the APIExportClient.Get method. +type APIExportClientGetOptions struct { + // placeholder for future optional parameters +} + +// APIIssueAttachmentClientCreateOrUpdateOptions contains the optional parameters for the APIIssueAttachmentClient.CreateOrUpdate +// method. +type APIIssueAttachmentClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// APIIssueAttachmentClientDeleteOptions contains the optional parameters for the APIIssueAttachmentClient.Delete method. +type APIIssueAttachmentClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// APIIssueAttachmentClientGetEntityTagOptions contains the optional parameters for the APIIssueAttachmentClient.GetEntityTag +// method. +type APIIssueAttachmentClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// APIIssueAttachmentClientGetOptions contains the optional parameters for the APIIssueAttachmentClient.Get method. +type APIIssueAttachmentClientGetOptions struct { + // placeholder for future optional parameters +} + +// APIIssueAttachmentClientListByServiceOptions contains the optional parameters for the APIIssueAttachmentClient.NewListByServicePager +// method. +type APIIssueAttachmentClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// APIIssueClientCreateOrUpdateOptions contains the optional parameters for the APIIssueClient.CreateOrUpdate method. +type APIIssueClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// APIIssueClientDeleteOptions contains the optional parameters for the APIIssueClient.Delete method. +type APIIssueClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// APIIssueClientGetEntityTagOptions contains the optional parameters for the APIIssueClient.GetEntityTag method. +type APIIssueClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// APIIssueClientGetOptions contains the optional parameters for the APIIssueClient.Get method. +type APIIssueClientGetOptions struct { + // Expand the comment attachments. + ExpandCommentsAttachments *bool +} + +// APIIssueClientListByServiceOptions contains the optional parameters for the APIIssueClient.NewListByServicePager method. +type APIIssueClientListByServiceOptions struct { + // Expand the comment attachments. + ExpandCommentsAttachments *bool + + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | state | filter | eq | | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// APIIssueClientUpdateOptions contains the optional parameters for the APIIssueClient.Update method. +type APIIssueClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// APIIssueCommentClientCreateOrUpdateOptions contains the optional parameters for the APIIssueCommentClient.CreateOrUpdate +// method. +type APIIssueCommentClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// APIIssueCommentClientDeleteOptions contains the optional parameters for the APIIssueCommentClient.Delete method. +type APIIssueCommentClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// APIIssueCommentClientGetEntityTagOptions contains the optional parameters for the APIIssueCommentClient.GetEntityTag method. +type APIIssueCommentClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// APIIssueCommentClientGetOptions contains the optional parameters for the APIIssueCommentClient.Get method. +type APIIssueCommentClientGetOptions struct { + // placeholder for future optional parameters +} + +// APIIssueCommentClientListByServiceOptions contains the optional parameters for the APIIssueCommentClient.NewListByServicePager +// method. +type APIIssueCommentClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// APIOperationClientCreateOrUpdateOptions contains the optional parameters for the APIOperationClient.CreateOrUpdate method. +type APIOperationClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// APIOperationClientDeleteOptions contains the optional parameters for the APIOperationClient.Delete method. +type APIOperationClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// APIOperationClientGetEntityTagOptions contains the optional parameters for the APIOperationClient.GetEntityTag method. +type APIOperationClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// APIOperationClientGetOptions contains the optional parameters for the APIOperationClient.Get method. +type APIOperationClientGetOptions struct { + // placeholder for future optional parameters +} + +// APIOperationClientListByAPIOptions contains the optional parameters for the APIOperationClient.NewListByAPIPager method. +type APIOperationClientListByAPIOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Include tags in the response. + Tags *string + + // Number of records to return. + Top *int32 +} + +// APIOperationClientUpdateOptions contains the optional parameters for the APIOperationClient.Update method. +type APIOperationClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// APIOperationPolicyClientCreateOrUpdateOptions contains the optional parameters for the APIOperationPolicyClient.CreateOrUpdate +// method. +type APIOperationPolicyClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// APIOperationPolicyClientDeleteOptions contains the optional parameters for the APIOperationPolicyClient.Delete method. +type APIOperationPolicyClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// APIOperationPolicyClientGetEntityTagOptions contains the optional parameters for the APIOperationPolicyClient.GetEntityTag +// method. +type APIOperationPolicyClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// APIOperationPolicyClientGetOptions contains the optional parameters for the APIOperationPolicyClient.Get method. +type APIOperationPolicyClientGetOptions struct { + // Policy Export Format. + Format *PolicyExportFormat +} + +// APIOperationPolicyClientListByOperationOptions contains the optional parameters for the APIOperationPolicyClient.ListByOperation +// method. +type APIOperationPolicyClientListByOperationOptions struct { + // placeholder for future optional parameters +} + +// APIPolicyClientCreateOrUpdateOptions contains the optional parameters for the APIPolicyClient.CreateOrUpdate method. +type APIPolicyClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// APIPolicyClientDeleteOptions contains the optional parameters for the APIPolicyClient.Delete method. +type APIPolicyClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// APIPolicyClientGetEntityTagOptions contains the optional parameters for the APIPolicyClient.GetEntityTag method. +type APIPolicyClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// APIPolicyClientGetOptions contains the optional parameters for the APIPolicyClient.Get method. +type APIPolicyClientGetOptions struct { + // Policy Export Format. + Format *PolicyExportFormat +} + +// APIPolicyClientListByAPIOptions contains the optional parameters for the APIPolicyClient.ListByAPI method. +type APIPolicyClientListByAPIOptions struct { + // placeholder for future optional parameters +} + +// APIProductClientListByApisOptions contains the optional parameters for the APIProductClient.NewListByApisPager method. +type APIProductClientListByApisOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// APIReleaseClientCreateOrUpdateOptions contains the optional parameters for the APIReleaseClient.CreateOrUpdate method. +type APIReleaseClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// APIReleaseClientDeleteOptions contains the optional parameters for the APIReleaseClient.Delete method. +type APIReleaseClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// APIReleaseClientGetEntityTagOptions contains the optional parameters for the APIReleaseClient.GetEntityTag method. +type APIReleaseClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// APIReleaseClientGetOptions contains the optional parameters for the APIReleaseClient.Get method. +type APIReleaseClientGetOptions struct { + // placeholder for future optional parameters +} + +// APIReleaseClientListByServiceOptions contains the optional parameters for the APIReleaseClient.NewListByServicePager method. +type APIReleaseClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | notes | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// APIReleaseClientUpdateOptions contains the optional parameters for the APIReleaseClient.Update method. +type APIReleaseClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// APIRevisionClientListByServiceOptions contains the optional parameters for the APIRevisionClient.NewListByServicePager +// method. +type APIRevisionClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// APISchemaClientBeginCreateOrUpdateOptions contains the optional parameters for the APISchemaClient.BeginCreateOrUpdate +// method. +type APISchemaClientBeginCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// APISchemaClientDeleteOptions contains the optional parameters for the APISchemaClient.Delete method. +type APISchemaClientDeleteOptions struct { + // If true removes all references to the schema before deleting it. + Force *bool +} + +// APISchemaClientGetEntityTagOptions contains the optional parameters for the APISchemaClient.GetEntityTag method. +type APISchemaClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// APISchemaClientGetOptions contains the optional parameters for the APISchemaClient.Get method. +type APISchemaClientGetOptions struct { + // placeholder for future optional parameters +} + +// APISchemaClientListByAPIOptions contains the optional parameters for the APISchemaClient.NewListByAPIPager method. +type APISchemaClientListByAPIOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | contentType | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// APITagDescriptionClientCreateOrUpdateOptions contains the optional parameters for the APITagDescriptionClient.CreateOrUpdate +// method. +type APITagDescriptionClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// APITagDescriptionClientDeleteOptions contains the optional parameters for the APITagDescriptionClient.Delete method. +type APITagDescriptionClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// APITagDescriptionClientGetEntityTagOptions contains the optional parameters for the APITagDescriptionClient.GetEntityTag +// method. +type APITagDescriptionClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// APITagDescriptionClientGetOptions contains the optional parameters for the APITagDescriptionClient.Get method. +type APITagDescriptionClientGetOptions struct { + // placeholder for future optional parameters +} + +// APITagDescriptionClientListByServiceOptions contains the optional parameters for the APITagDescriptionClient.NewListByServicePager +// method. +type APITagDescriptionClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// APIVersionSetClientCreateOrUpdateOptions contains the optional parameters for the APIVersionSetClient.CreateOrUpdate method. +type APIVersionSetClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// APIVersionSetClientDeleteOptions contains the optional parameters for the APIVersionSetClient.Delete method. +type APIVersionSetClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// APIVersionSetClientGetEntityTagOptions contains the optional parameters for the APIVersionSetClient.GetEntityTag method. +type APIVersionSetClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// APIVersionSetClientGetOptions contains the optional parameters for the APIVersionSetClient.Get method. +type APIVersionSetClientGetOptions struct { + // placeholder for future optional parameters +} + +// APIVersionSetClientListByServiceOptions contains the optional parameters for the APIVersionSetClient.NewListByServicePager +// method. +type APIVersionSetClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// APIVersionSetClientUpdateOptions contains the optional parameters for the APIVersionSetClient.Update method. +type APIVersionSetClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// APIWikiClientCreateOrUpdateOptions contains the optional parameters for the APIWikiClient.CreateOrUpdate method. +type APIWikiClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// APIWikiClientDeleteOptions contains the optional parameters for the APIWikiClient.Delete method. +type APIWikiClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// APIWikiClientGetEntityTagOptions contains the optional parameters for the APIWikiClient.GetEntityTag method. +type APIWikiClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// APIWikiClientGetOptions contains the optional parameters for the APIWikiClient.Get method. +type APIWikiClientGetOptions struct { + // placeholder for future optional parameters +} + +// APIWikiClientUpdateOptions contains the optional parameters for the APIWikiClient.Update method. +type APIWikiClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// APIWikisClientListOptions contains the optional parameters for the APIWikisClient.NewListPager method. +type APIWikisClientListOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | eq | contains | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// AuthorizationAccessPolicyClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationAccessPolicyClient.CreateOrUpdate +// method. +type AuthorizationAccessPolicyClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// AuthorizationAccessPolicyClientDeleteOptions contains the optional parameters for the AuthorizationAccessPolicyClient.Delete +// method. +type AuthorizationAccessPolicyClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationAccessPolicyClientGetOptions contains the optional parameters for the AuthorizationAccessPolicyClient.Get +// method. +type AuthorizationAccessPolicyClientGetOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationAccessPolicyClientListByAuthorizationOptions contains the optional parameters for the AuthorizationAccessPolicyClient.NewListByAuthorizationPager +// method. +type AuthorizationAccessPolicyClientListByAuthorizationOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// AuthorizationClientConfirmConsentCodeOptions contains the optional parameters for the AuthorizationClient.ConfirmConsentCode +// method. +type AuthorizationClientConfirmConsentCodeOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationClient.CreateOrUpdate method. +type AuthorizationClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// AuthorizationClientDeleteOptions contains the optional parameters for the AuthorizationClient.Delete method. +type AuthorizationClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationClientGetOptions contains the optional parameters for the AuthorizationClient.Get method. +type AuthorizationClientGetOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationClientListByAuthorizationProviderOptions contains the optional parameters for the AuthorizationClient.NewListByAuthorizationProviderPager +// method. +type AuthorizationClientListByAuthorizationProviderOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// AuthorizationLoginLinksClientPostOptions contains the optional parameters for the AuthorizationLoginLinksClient.Post method. +type AuthorizationLoginLinksClientPostOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationProviderClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationProviderClient.CreateOrUpdate +// method. +type AuthorizationProviderClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// AuthorizationProviderClientDeleteOptions contains the optional parameters for the AuthorizationProviderClient.Delete method. +type AuthorizationProviderClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationProviderClientGetOptions contains the optional parameters for the AuthorizationProviderClient.Get method. +type AuthorizationProviderClientGetOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationProviderClientListByServiceOptions contains the optional parameters for the AuthorizationProviderClient.NewListByServicePager +// method. +type AuthorizationProviderClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// AuthorizationServerClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationServerClient.CreateOrUpdate +// method. +type AuthorizationServerClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// AuthorizationServerClientDeleteOptions contains the optional parameters for the AuthorizationServerClient.Delete method. +type AuthorizationServerClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationServerClientGetEntityTagOptions contains the optional parameters for the AuthorizationServerClient.GetEntityTag +// method. +type AuthorizationServerClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationServerClientGetOptions contains the optional parameters for the AuthorizationServerClient.Get method. +type AuthorizationServerClientGetOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationServerClientListByServiceOptions contains the optional parameters for the AuthorizationServerClient.NewListByServicePager +// method. +type AuthorizationServerClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// AuthorizationServerClientListSecretsOptions contains the optional parameters for the AuthorizationServerClient.ListSecrets +// method. +type AuthorizationServerClientListSecretsOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationServerClientUpdateOptions contains the optional parameters for the AuthorizationServerClient.Update method. +type AuthorizationServerClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// BackendClientCreateOrUpdateOptions contains the optional parameters for the BackendClient.CreateOrUpdate method. +type BackendClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// BackendClientDeleteOptions contains the optional parameters for the BackendClient.Delete method. +type BackendClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// BackendClientGetEntityTagOptions contains the optional parameters for the BackendClient.GetEntityTag method. +type BackendClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// BackendClientGetOptions contains the optional parameters for the BackendClient.Get method. +type BackendClientGetOptions struct { + // placeholder for future optional parameters +} + +// BackendClientListByServiceOptions contains the optional parameters for the BackendClient.NewListByServicePager method. +type BackendClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | title | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | url | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// BackendClientReconnectOptions contains the optional parameters for the BackendClient.Reconnect method. +type BackendClientReconnectOptions struct { + // Reconnect request parameters. + Parameters *BackendReconnectContract +} + +// BackendClientUpdateOptions contains the optional parameters for the BackendClient.Update method. +type BackendClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// CacheClientCreateOrUpdateOptions contains the optional parameters for the CacheClient.CreateOrUpdate method. +type CacheClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// CacheClientDeleteOptions contains the optional parameters for the CacheClient.Delete method. +type CacheClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// CacheClientGetEntityTagOptions contains the optional parameters for the CacheClient.GetEntityTag method. +type CacheClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// CacheClientGetOptions contains the optional parameters for the CacheClient.Get method. +type CacheClientGetOptions struct { + // placeholder for future optional parameters +} + +// CacheClientListByServiceOptions contains the optional parameters for the CacheClient.NewListByServicePager method. +type CacheClientListByServiceOptions struct { + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// CacheClientUpdateOptions contains the optional parameters for the CacheClient.Update method. +type CacheClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// CertificateClientCreateOrUpdateOptions contains the optional parameters for the CertificateClient.CreateOrUpdate method. +type CertificateClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// CertificateClientDeleteOptions contains the optional parameters for the CertificateClient.Delete method. +type CertificateClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// CertificateClientGetEntityTagOptions contains the optional parameters for the CertificateClient.GetEntityTag method. +type CertificateClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// CertificateClientGetOptions contains the optional parameters for the CertificateClient.Get method. +type CertificateClientGetOptions struct { + // placeholder for future optional parameters +} + +// CertificateClientListByServiceOptions contains the optional parameters for the CertificateClient.NewListByServicePager +// method. +type CertificateClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | subject | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | thumbprint | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | expirationDate | filter | ge, le, eq, ne, gt, lt | | + Filter *string + + // When set to true, the response contains only certificates entities which failed refresh. + IsKeyVaultRefreshFailed *bool + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// CertificateClientRefreshSecretOptions contains the optional parameters for the CertificateClient.RefreshSecret method. +type CertificateClientRefreshSecretOptions struct { + // placeholder for future optional parameters +} + +// ClientBeginPerformConnectivityCheckAsyncOptions contains the optional parameters for the Client.BeginPerformConnectivityCheckAsync +// method. +type ClientBeginPerformConnectivityCheckAsyncOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ContentItemClientCreateOrUpdateOptions contains the optional parameters for the ContentItemClient.CreateOrUpdate method. +type ContentItemClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// ContentItemClientDeleteOptions contains the optional parameters for the ContentItemClient.Delete method. +type ContentItemClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ContentItemClientGetEntityTagOptions contains the optional parameters for the ContentItemClient.GetEntityTag method. +type ContentItemClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// ContentItemClientGetOptions contains the optional parameters for the ContentItemClient.Get method. +type ContentItemClientGetOptions struct { + // placeholder for future optional parameters +} + +// ContentItemClientListByServiceOptions contains the optional parameters for the ContentItemClient.NewListByServicePager +// method. +type ContentItemClientListByServiceOptions struct { + // placeholder for future optional parameters +} + +// ContentTypeClientCreateOrUpdateOptions contains the optional parameters for the ContentTypeClient.CreateOrUpdate method. +type ContentTypeClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// ContentTypeClientDeleteOptions contains the optional parameters for the ContentTypeClient.Delete method. +type ContentTypeClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ContentTypeClientGetOptions contains the optional parameters for the ContentTypeClient.Get method. +type ContentTypeClientGetOptions struct { + // placeholder for future optional parameters +} + +// ContentTypeClientListByServiceOptions contains the optional parameters for the ContentTypeClient.NewListByServicePager +// method. +type ContentTypeClientListByServiceOptions struct { + // placeholder for future optional parameters +} + +// DelegationSettingsClientCreateOrUpdateOptions contains the optional parameters for the DelegationSettingsClient.CreateOrUpdate +// method. +type DelegationSettingsClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// DelegationSettingsClientGetEntityTagOptions contains the optional parameters for the DelegationSettingsClient.GetEntityTag +// method. +type DelegationSettingsClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// DelegationSettingsClientGetOptions contains the optional parameters for the DelegationSettingsClient.Get method. +type DelegationSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DelegationSettingsClientListSecretsOptions contains the optional parameters for the DelegationSettingsClient.ListSecrets +// method. +type DelegationSettingsClientListSecretsOptions struct { + // placeholder for future optional parameters +} + +// DelegationSettingsClientUpdateOptions contains the optional parameters for the DelegationSettingsClient.Update method. +type DelegationSettingsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// DeletedServicesClientBeginPurgeOptions contains the optional parameters for the DeletedServicesClient.BeginPurge method. +type DeletedServicesClientBeginPurgeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DeletedServicesClientGetByNameOptions contains the optional parameters for the DeletedServicesClient.GetByName method. +type DeletedServicesClientGetByNameOptions struct { + // placeholder for future optional parameters +} + +// DeletedServicesClientListBySubscriptionOptions contains the optional parameters for the DeletedServicesClient.NewListBySubscriptionPager +// method. +type DeletedServicesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticClientCreateOrUpdateOptions contains the optional parameters for the DiagnosticClient.CreateOrUpdate method. +type DiagnosticClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// DiagnosticClientDeleteOptions contains the optional parameters for the DiagnosticClient.Delete method. +type DiagnosticClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticClientGetEntityTagOptions contains the optional parameters for the DiagnosticClient.GetEntityTag method. +type DiagnosticClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticClientGetOptions contains the optional parameters for the DiagnosticClient.Get method. +type DiagnosticClientGetOptions struct { + // placeholder for future optional parameters +} + +// DiagnosticClientListByServiceOptions contains the optional parameters for the DiagnosticClient.NewListByServicePager method. +type DiagnosticClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// DiagnosticClientUpdateOptions contains the optional parameters for the DiagnosticClient.Update method. +type DiagnosticClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// DocumentationClientCreateOrUpdateOptions contains the optional parameters for the DocumentationClient.CreateOrUpdate method. +type DocumentationClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// DocumentationClientDeleteOptions contains the optional parameters for the DocumentationClient.Delete method. +type DocumentationClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DocumentationClientGetEntityTagOptions contains the optional parameters for the DocumentationClient.GetEntityTag method. +type DocumentationClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// DocumentationClientGetOptions contains the optional parameters for the DocumentationClient.Get method. +type DocumentationClientGetOptions struct { + // placeholder for future optional parameters +} + +// DocumentationClientListByServiceOptions contains the optional parameters for the DocumentationClient.NewListByServicePager +// method. +type DocumentationClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | eq | contains | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// DocumentationClientUpdateOptions contains the optional parameters for the DocumentationClient.Update method. +type DocumentationClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// EmailTemplateClientCreateOrUpdateOptions contains the optional parameters for the EmailTemplateClient.CreateOrUpdate method. +type EmailTemplateClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// EmailTemplateClientDeleteOptions contains the optional parameters for the EmailTemplateClient.Delete method. +type EmailTemplateClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// EmailTemplateClientGetEntityTagOptions contains the optional parameters for the EmailTemplateClient.GetEntityTag method. +type EmailTemplateClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// EmailTemplateClientGetOptions contains the optional parameters for the EmailTemplateClient.Get method. +type EmailTemplateClientGetOptions struct { + // placeholder for future optional parameters +} + +// EmailTemplateClientListByServiceOptions contains the optional parameters for the EmailTemplateClient.NewListByServicePager +// method. +type EmailTemplateClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// EmailTemplateClientUpdateOptions contains the optional parameters for the EmailTemplateClient.Update method. +type EmailTemplateClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// GatewayAPIClientCreateOrUpdateOptions contains the optional parameters for the GatewayAPIClient.CreateOrUpdate method. +type GatewayAPIClientCreateOrUpdateOptions struct { + Parameters *AssociationContract +} + +// GatewayAPIClientDeleteOptions contains the optional parameters for the GatewayAPIClient.Delete method. +type GatewayAPIClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// GatewayAPIClientGetEntityTagOptions contains the optional parameters for the GatewayAPIClient.GetEntityTag method. +type GatewayAPIClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// GatewayAPIClientListByServiceOptions contains the optional parameters for the GatewayAPIClient.NewListByServicePager method. +type GatewayAPIClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// GatewayCertificateAuthorityClientCreateOrUpdateOptions contains the optional parameters for the GatewayCertificateAuthorityClient.CreateOrUpdate +// method. +type GatewayCertificateAuthorityClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// GatewayCertificateAuthorityClientDeleteOptions contains the optional parameters for the GatewayCertificateAuthorityClient.Delete +// method. +type GatewayCertificateAuthorityClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// GatewayCertificateAuthorityClientGetEntityTagOptions contains the optional parameters for the GatewayCertificateAuthorityClient.GetEntityTag +// method. +type GatewayCertificateAuthorityClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// GatewayCertificateAuthorityClientGetOptions contains the optional parameters for the GatewayCertificateAuthorityClient.Get +// method. +type GatewayCertificateAuthorityClientGetOptions struct { + // placeholder for future optional parameters +} + +// GatewayCertificateAuthorityClientListByServiceOptions contains the optional parameters for the GatewayCertificateAuthorityClient.NewListByServicePager +// method. +type GatewayCertificateAuthorityClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | eq, ne | | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// GatewayClientCreateOrUpdateOptions contains the optional parameters for the GatewayClient.CreateOrUpdate method. +type GatewayClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// GatewayClientDeleteOptions contains the optional parameters for the GatewayClient.Delete method. +type GatewayClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// GatewayClientGenerateTokenOptions contains the optional parameters for the GatewayClient.GenerateToken method. +type GatewayClientGenerateTokenOptions struct { + // placeholder for future optional parameters +} + +// GatewayClientGetEntityTagOptions contains the optional parameters for the GatewayClient.GetEntityTag method. +type GatewayClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// GatewayClientGetOptions contains the optional parameters for the GatewayClient.Get method. +type GatewayClientGetOptions struct { + // placeholder for future optional parameters +} + +// GatewayClientListByServiceOptions contains the optional parameters for the GatewayClient.NewListByServicePager method. +type GatewayClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | region | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// GatewayClientListKeysOptions contains the optional parameters for the GatewayClient.ListKeys method. +type GatewayClientListKeysOptions struct { + // placeholder for future optional parameters +} + +// GatewayClientRegenerateKeyOptions contains the optional parameters for the GatewayClient.RegenerateKey method. +type GatewayClientRegenerateKeyOptions struct { + // placeholder for future optional parameters +} + +// GatewayClientUpdateOptions contains the optional parameters for the GatewayClient.Update method. +type GatewayClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// GatewayHostnameConfigurationClientCreateOrUpdateOptions contains the optional parameters for the GatewayHostnameConfigurationClient.CreateOrUpdate +// method. +type GatewayHostnameConfigurationClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// GatewayHostnameConfigurationClientDeleteOptions contains the optional parameters for the GatewayHostnameConfigurationClient.Delete +// method. +type GatewayHostnameConfigurationClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// GatewayHostnameConfigurationClientGetEntityTagOptions contains the optional parameters for the GatewayHostnameConfigurationClient.GetEntityTag +// method. +type GatewayHostnameConfigurationClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// GatewayHostnameConfigurationClientGetOptions contains the optional parameters for the GatewayHostnameConfigurationClient.Get +// method. +type GatewayHostnameConfigurationClientGetOptions struct { + // placeholder for future optional parameters +} + +// GatewayHostnameConfigurationClientListByServiceOptions contains the optional parameters for the GatewayHostnameConfigurationClient.NewListByServicePager +// method. +type GatewayHostnameConfigurationClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | hostname | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// GlobalSchemaClientBeginCreateOrUpdateOptions contains the optional parameters for the GlobalSchemaClient.BeginCreateOrUpdate +// method. +type GlobalSchemaClientBeginCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GlobalSchemaClientDeleteOptions contains the optional parameters for the GlobalSchemaClient.Delete method. +type GlobalSchemaClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// GlobalSchemaClientGetEntityTagOptions contains the optional parameters for the GlobalSchemaClient.GetEntityTag method. +type GlobalSchemaClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// GlobalSchemaClientGetOptions contains the optional parameters for the GlobalSchemaClient.Get method. +type GlobalSchemaClientGetOptions struct { + // placeholder for future optional parameters +} + +// GlobalSchemaClientListByServiceOptions contains the optional parameters for the GlobalSchemaClient.NewListByServicePager +// method. +type GlobalSchemaClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// GraphQLAPIResolverClientCreateOrUpdateOptions contains the optional parameters for the GraphQLAPIResolverClient.CreateOrUpdate +// method. +type GraphQLAPIResolverClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// GraphQLAPIResolverClientDeleteOptions contains the optional parameters for the GraphQLAPIResolverClient.Delete method. +type GraphQLAPIResolverClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// GraphQLAPIResolverClientGetEntityTagOptions contains the optional parameters for the GraphQLAPIResolverClient.GetEntityTag +// method. +type GraphQLAPIResolverClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// GraphQLAPIResolverClientGetOptions contains the optional parameters for the GraphQLAPIResolverClient.Get method. +type GraphQLAPIResolverClientGetOptions struct { + // placeholder for future optional parameters +} + +// GraphQLAPIResolverClientListByAPIOptions contains the optional parameters for the GraphQLAPIResolverClient.NewListByAPIPager +// method. +type GraphQLAPIResolverClientListByAPIOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// GraphQLAPIResolverClientUpdateOptions contains the optional parameters for the GraphQLAPIResolverClient.Update method. +type GraphQLAPIResolverClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// GraphQLAPIResolverPolicyClientCreateOrUpdateOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.CreateOrUpdate +// method. +type GraphQLAPIResolverPolicyClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// GraphQLAPIResolverPolicyClientDeleteOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.Delete +// method. +type GraphQLAPIResolverPolicyClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// GraphQLAPIResolverPolicyClientGetEntityTagOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.GetEntityTag +// method. +type GraphQLAPIResolverPolicyClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// GraphQLAPIResolverPolicyClientGetOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.Get method. +type GraphQLAPIResolverPolicyClientGetOptions struct { + // Policy Export Format. + Format *PolicyExportFormat +} + +// GraphQLAPIResolverPolicyClientListByResolverOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.NewListByResolverPager +// method. +type GraphQLAPIResolverPolicyClientListByResolverOptions struct { + // placeholder for future optional parameters +} + +// GroupClientCreateOrUpdateOptions contains the optional parameters for the GroupClient.CreateOrUpdate method. +type GroupClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// GroupClientDeleteOptions contains the optional parameters for the GroupClient.Delete method. +type GroupClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// GroupClientGetEntityTagOptions contains the optional parameters for the GroupClient.GetEntityTag method. +type GroupClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// GroupClientGetOptions contains the optional parameters for the GroupClient.Get method. +type GroupClientGetOptions struct { + // placeholder for future optional parameters +} + +// GroupClientListByServiceOptions contains the optional parameters for the GroupClient.NewListByServicePager method. +type GroupClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | externalId | filter | eq | | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// GroupClientUpdateOptions contains the optional parameters for the GroupClient.Update method. +type GroupClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// GroupUserClientCheckEntityExistsOptions contains the optional parameters for the GroupUserClient.CheckEntityExists method. +type GroupUserClientCheckEntityExistsOptions struct { + // placeholder for future optional parameters +} + +// GroupUserClientCreateOptions contains the optional parameters for the GroupUserClient.Create method. +type GroupUserClientCreateOptions struct { + // placeholder for future optional parameters +} + +// GroupUserClientDeleteOptions contains the optional parameters for the GroupUserClient.Delete method. +type GroupUserClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// GroupUserClientListOptions contains the optional parameters for the GroupUserClient.NewListPager method. +type GroupUserClientListOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | firstName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | lastName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | registrationDate | filter | ge, le, eq, ne, gt, lt | | + // | note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// IdentityProviderClientCreateOrUpdateOptions contains the optional parameters for the IdentityProviderClient.CreateOrUpdate +// method. +type IdentityProviderClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// IdentityProviderClientDeleteOptions contains the optional parameters for the IdentityProviderClient.Delete method. +type IdentityProviderClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// IdentityProviderClientGetEntityTagOptions contains the optional parameters for the IdentityProviderClient.GetEntityTag +// method. +type IdentityProviderClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// IdentityProviderClientGetOptions contains the optional parameters for the IdentityProviderClient.Get method. +type IdentityProviderClientGetOptions struct { + // placeholder for future optional parameters +} + +// IdentityProviderClientListByServiceOptions contains the optional parameters for the IdentityProviderClient.NewListByServicePager +// method. +type IdentityProviderClientListByServiceOptions struct { + // placeholder for future optional parameters +} + +// IdentityProviderClientListSecretsOptions contains the optional parameters for the IdentityProviderClient.ListSecrets method. +type IdentityProviderClientListSecretsOptions struct { + // placeholder for future optional parameters +} + +// IdentityProviderClientUpdateOptions contains the optional parameters for the IdentityProviderClient.Update method. +type IdentityProviderClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// IssueClientGetOptions contains the optional parameters for the IssueClient.Get method. +type IssueClientGetOptions struct { + // placeholder for future optional parameters +} + +// IssueClientListByServiceOptions contains the optional parameters for the IssueClient.NewListByServicePager method. +type IssueClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | apiId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | title | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | authorName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | state | filter | eq | | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// LoggerClientCreateOrUpdateOptions contains the optional parameters for the LoggerClient.CreateOrUpdate method. +type LoggerClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// LoggerClientDeleteOptions contains the optional parameters for the LoggerClient.Delete method. +type LoggerClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// LoggerClientGetEntityTagOptions contains the optional parameters for the LoggerClient.GetEntityTag method. +type LoggerClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// LoggerClientGetOptions contains the optional parameters for the LoggerClient.Get method. +type LoggerClientGetOptions struct { + // placeholder for future optional parameters +} + +// LoggerClientListByServiceOptions contains the optional parameters for the LoggerClient.NewListByServicePager method. +type LoggerClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | loggerType | filter | eq | | + // | resourceId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// LoggerClientUpdateOptions contains the optional parameters for the LoggerClient.Update method. +type LoggerClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// NamedValueClientBeginCreateOrUpdateOptions contains the optional parameters for the NamedValueClient.BeginCreateOrUpdate +// method. +type NamedValueClientBeginCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NamedValueClientBeginRefreshSecretOptions contains the optional parameters for the NamedValueClient.BeginRefreshSecret +// method. +type NamedValueClientBeginRefreshSecretOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NamedValueClientBeginUpdateOptions contains the optional parameters for the NamedValueClient.BeginUpdate method. +type NamedValueClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NamedValueClientDeleteOptions contains the optional parameters for the NamedValueClient.Delete method. +type NamedValueClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// NamedValueClientGetEntityTagOptions contains the optional parameters for the NamedValueClient.GetEntityTag method. +type NamedValueClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// NamedValueClientGetOptions contains the optional parameters for the NamedValueClient.Get method. +type NamedValueClientGetOptions struct { + // placeholder for future optional parameters +} + +// NamedValueClientListByServiceOptions contains the optional parameters for the NamedValueClient.NewListByServicePager method. +type NamedValueClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | tags | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith, any, all | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // When set to true, the response contains only named value entities which failed refresh. + IsKeyVaultRefreshFailed *bool + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// NamedValueClientListValueOptions contains the optional parameters for the NamedValueClient.ListValue method. +type NamedValueClientListValueOptions struct { + // placeholder for future optional parameters +} + +// NetworkStatusClientListByLocationOptions contains the optional parameters for the NetworkStatusClient.ListByLocation method. +type NetworkStatusClientListByLocationOptions struct { + // placeholder for future optional parameters +} + +// NetworkStatusClientListByServiceOptions contains the optional parameters for the NetworkStatusClient.ListByService method. +type NetworkStatusClientListByServiceOptions struct { + // placeholder for future optional parameters +} + +// NotificationClientCreateOrUpdateOptions contains the optional parameters for the NotificationClient.CreateOrUpdate method. +type NotificationClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// NotificationClientGetOptions contains the optional parameters for the NotificationClient.Get method. +type NotificationClientGetOptions struct { + // placeholder for future optional parameters +} + +// NotificationClientListByServiceOptions contains the optional parameters for the NotificationClient.NewListByServicePager +// method. +type NotificationClientListByServiceOptions struct { + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// NotificationRecipientEmailClientCheckEntityExistsOptions contains the optional parameters for the NotificationRecipientEmailClient.CheckEntityExists +// method. +type NotificationRecipientEmailClientCheckEntityExistsOptions struct { + // placeholder for future optional parameters +} + +// NotificationRecipientEmailClientCreateOrUpdateOptions contains the optional parameters for the NotificationRecipientEmailClient.CreateOrUpdate +// method. +type NotificationRecipientEmailClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// NotificationRecipientEmailClientDeleteOptions contains the optional parameters for the NotificationRecipientEmailClient.Delete +// method. +type NotificationRecipientEmailClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// NotificationRecipientEmailClientListByNotificationOptions contains the optional parameters for the NotificationRecipientEmailClient.ListByNotification +// method. +type NotificationRecipientEmailClientListByNotificationOptions struct { + // placeholder for future optional parameters +} + +// NotificationRecipientUserClientCheckEntityExistsOptions contains the optional parameters for the NotificationRecipientUserClient.CheckEntityExists +// method. +type NotificationRecipientUserClientCheckEntityExistsOptions struct { + // placeholder for future optional parameters +} + +// NotificationRecipientUserClientCreateOrUpdateOptions contains the optional parameters for the NotificationRecipientUserClient.CreateOrUpdate +// method. +type NotificationRecipientUserClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// NotificationRecipientUserClientDeleteOptions contains the optional parameters for the NotificationRecipientUserClient.Delete +// method. +type NotificationRecipientUserClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// NotificationRecipientUserClientListByNotificationOptions contains the optional parameters for the NotificationRecipientUserClient.ListByNotification +// method. +type NotificationRecipientUserClientListByNotificationOptions struct { + // placeholder for future optional parameters +} + +// OpenIDConnectProviderClientCreateOrUpdateOptions contains the optional parameters for the OpenIDConnectProviderClient.CreateOrUpdate +// method. +type OpenIDConnectProviderClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// OpenIDConnectProviderClientDeleteOptions contains the optional parameters for the OpenIDConnectProviderClient.Delete method. +type OpenIDConnectProviderClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// OpenIDConnectProviderClientGetEntityTagOptions contains the optional parameters for the OpenIDConnectProviderClient.GetEntityTag +// method. +type OpenIDConnectProviderClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// OpenIDConnectProviderClientGetOptions contains the optional parameters for the OpenIDConnectProviderClient.Get method. +type OpenIDConnectProviderClientGetOptions struct { + // placeholder for future optional parameters +} + +// OpenIDConnectProviderClientListByServiceOptions contains the optional parameters for the OpenIDConnectProviderClient.NewListByServicePager +// method. +type OpenIDConnectProviderClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// OpenIDConnectProviderClientListSecretsOptions contains the optional parameters for the OpenIDConnectProviderClient.ListSecrets +// method. +type OpenIDConnectProviderClientListSecretsOptions struct { + // placeholder for future optional parameters +} + +// OpenIDConnectProviderClientUpdateOptions contains the optional parameters for the OpenIDConnectProviderClient.Update method. +type OpenIDConnectProviderClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// OperationClientListByTagsOptions contains the optional parameters for the OperationClient.NewListByTagsPager method. +type OperationClientListByTagsOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | apiName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Include not tagged Operations. + IncludeNotTaggedOperations *bool + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// OutboundNetworkDependenciesEndpointsClientListByServiceOptions contains the optional parameters for the OutboundNetworkDependenciesEndpointsClient.ListByService +// method. +type OutboundNetworkDependenciesEndpointsClientListByServiceOptions struct { + // placeholder for future optional parameters +} + +// PolicyClientCreateOrUpdateOptions contains the optional parameters for the PolicyClient.CreateOrUpdate method. +type PolicyClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// PolicyClientDeleteOptions contains the optional parameters for the PolicyClient.Delete method. +type PolicyClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// PolicyClientGetEntityTagOptions contains the optional parameters for the PolicyClient.GetEntityTag method. +type PolicyClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// PolicyClientGetOptions contains the optional parameters for the PolicyClient.Get method. +type PolicyClientGetOptions struct { + // Policy Export Format. + Format *PolicyExportFormat +} + +// PolicyClientListByServiceOptions contains the optional parameters for the PolicyClient.ListByService method. +type PolicyClientListByServiceOptions struct { + // placeholder for future optional parameters +} + +// PolicyDescriptionClientListByServiceOptions contains the optional parameters for the PolicyDescriptionClient.ListByService +// method. +type PolicyDescriptionClientListByServiceOptions struct { + // Policy scope. + Scope *PolicyScopeContract +} + +// PolicyFragmentClientBeginCreateOrUpdateOptions contains the optional parameters for the PolicyFragmentClient.BeginCreateOrUpdate +// method. +type PolicyFragmentClientBeginCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PolicyFragmentClientDeleteOptions contains the optional parameters for the PolicyFragmentClient.Delete method. +type PolicyFragmentClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// PolicyFragmentClientGetEntityTagOptions contains the optional parameters for the PolicyFragmentClient.GetEntityTag method. +type PolicyFragmentClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// PolicyFragmentClientGetOptions contains the optional parameters for the PolicyFragmentClient.Get method. +type PolicyFragmentClientGetOptions struct { + // Policy fragment content format. + Format *PolicyFragmentContentFormat +} + +// PolicyFragmentClientListByServiceOptions contains the optional parameters for the PolicyFragmentClient.ListByService method. +type PolicyFragmentClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter, orderBy | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | value | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // OData order by query option. + Orderby *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// PolicyFragmentClientListReferencesOptions contains the optional parameters for the PolicyFragmentClient.ListReferences +// method. +type PolicyFragmentClientListReferencesOptions struct { + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// PortalConfigClientCreateOrUpdateOptions contains the optional parameters for the PortalConfigClient.CreateOrUpdate method. +type PortalConfigClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// PortalConfigClientGetEntityTagOptions contains the optional parameters for the PortalConfigClient.GetEntityTag method. +type PortalConfigClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// PortalConfigClientGetOptions contains the optional parameters for the PortalConfigClient.Get method. +type PortalConfigClientGetOptions struct { + // placeholder for future optional parameters +} + +// PortalConfigClientListByServiceOptions contains the optional parameters for the PortalConfigClient.ListByService method. +type PortalConfigClientListByServiceOptions struct { + // placeholder for future optional parameters +} + +// PortalConfigClientUpdateOptions contains the optional parameters for the PortalConfigClient.Update method. +type PortalConfigClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// PortalRevisionClientBeginCreateOrUpdateOptions contains the optional parameters for the PortalRevisionClient.BeginCreateOrUpdate +// method. +type PortalRevisionClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PortalRevisionClientBeginUpdateOptions contains the optional parameters for the PortalRevisionClient.BeginUpdate method. +type PortalRevisionClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PortalRevisionClientGetEntityTagOptions contains the optional parameters for the PortalRevisionClient.GetEntityTag method. +type PortalRevisionClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// PortalRevisionClientGetOptions contains the optional parameters for the PortalRevisionClient.Get method. +type PortalRevisionClientGetOptions struct { + // placeholder for future optional parameters +} + +// PortalRevisionClientListByServiceOptions contains the optional parameters for the PortalRevisionClient.NewListByServicePager +// method. +type PortalRevisionClientListByServiceOptions struct { + // FIELD SUPPORTED OPERATORS SUPPORTED FUNCTIONS + // |name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| |description | ge, le, eq, ne, gt, lt | substringof, + // contains, startswith, endswith| |isCurrent | eq, ne | | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// PortalSettingsClientListByServiceOptions contains the optional parameters for the PortalSettingsClient.ListByService method. +type PortalSettingsClientListByServiceOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginCreateOrUpdate +// method. +type PrivateEndpointConnectionClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginDelete +// method. +type PrivateEndpointConnectionClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionClientGetByNameOptions contains the optional parameters for the PrivateEndpointConnectionClient.GetByName +// method. +type PrivateEndpointConnectionClientGetByNameOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionClientGetPrivateLinkResourceOptions contains the optional parameters for the PrivateEndpointConnectionClient.GetPrivateLinkResource +// method. +type PrivateEndpointConnectionClientGetPrivateLinkResourceOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionClientListByServiceOptions contains the optional parameters for the PrivateEndpointConnectionClient.NewListByServicePager +// method. +type PrivateEndpointConnectionClientListByServiceOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionClientListPrivateLinkResourcesOptions contains the optional parameters for the PrivateEndpointConnectionClient.ListPrivateLinkResources +// method. +type PrivateEndpointConnectionClientListPrivateLinkResourcesOptions struct { + // placeholder for future optional parameters +} + +// ProductAPIClientCheckEntityExistsOptions contains the optional parameters for the ProductAPIClient.CheckEntityExists method. +type ProductAPIClientCheckEntityExistsOptions struct { + // placeholder for future optional parameters +} + +// ProductAPIClientCreateOrUpdateOptions contains the optional parameters for the ProductAPIClient.CreateOrUpdate method. +type ProductAPIClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ProductAPIClientDeleteOptions contains the optional parameters for the ProductAPIClient.Delete method. +type ProductAPIClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ProductAPIClientListByProductOptions contains the optional parameters for the ProductAPIClient.NewListByProductPager method. +type ProductAPIClientListByProductOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// ProductClientCreateOrUpdateOptions contains the optional parameters for the ProductClient.CreateOrUpdate method. +type ProductClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// ProductClientDeleteOptions contains the optional parameters for the ProductClient.Delete method. +type ProductClientDeleteOptions struct { + // Delete existing subscriptions associated with the product or not. + DeleteSubscriptions *bool +} + +// ProductClientGetEntityTagOptions contains the optional parameters for the ProductClient.GetEntityTag method. +type ProductClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// ProductClientGetOptions contains the optional parameters for the ProductClient.Get method. +type ProductClientGetOptions struct { + // placeholder for future optional parameters +} + +// ProductClientListByServiceOptions contains the optional parameters for the ProductClient.NewListByServicePager method. +type ProductClientListByServiceOptions struct { + // When set to true, the response contains an array of groups that have visibility to the product. The default is false. + ExpandGroups *bool + + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | state | filter | eq | | + // | groups | expand | | | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Products which are part of a specific tag. + Tags *string + + // Number of records to return. + Top *int32 +} + +// ProductClientListByTagsOptions contains the optional parameters for the ProductClient.NewListByTagsPager method. +type ProductClientListByTagsOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | state | filter | eq | substringof, contains, startswith, endswith | + Filter *string + + // Include not tagged Products. + IncludeNotTaggedProducts *bool + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// ProductClientUpdateOptions contains the optional parameters for the ProductClient.Update method. +type ProductClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ProductGroupClientCheckEntityExistsOptions contains the optional parameters for the ProductGroupClient.CheckEntityExists +// method. +type ProductGroupClientCheckEntityExistsOptions struct { + // placeholder for future optional parameters +} + +// ProductGroupClientCreateOrUpdateOptions contains the optional parameters for the ProductGroupClient.CreateOrUpdate method. +type ProductGroupClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ProductGroupClientDeleteOptions contains the optional parameters for the ProductGroupClient.Delete method. +type ProductGroupClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ProductGroupClientListByProductOptions contains the optional parameters for the ProductGroupClient.NewListByProductPager +// method. +type ProductGroupClientListByProductOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | | + // | displayName | filter | eq, ne | | + // | description | filter | eq, ne | | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// ProductPolicyClientCreateOrUpdateOptions contains the optional parameters for the ProductPolicyClient.CreateOrUpdate method. +type ProductPolicyClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// ProductPolicyClientDeleteOptions contains the optional parameters for the ProductPolicyClient.Delete method. +type ProductPolicyClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ProductPolicyClientGetEntityTagOptions contains the optional parameters for the ProductPolicyClient.GetEntityTag method. +type ProductPolicyClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// ProductPolicyClientGetOptions contains the optional parameters for the ProductPolicyClient.Get method. +type ProductPolicyClientGetOptions struct { + // Policy Export Format. + Format *PolicyExportFormat +} + +// ProductPolicyClientListByProductOptions contains the optional parameters for the ProductPolicyClient.ListByProduct method. +type ProductPolicyClientListByProductOptions struct { + // placeholder for future optional parameters +} + +// ProductSubscriptionsClientListOptions contains the optional parameters for the ProductSubscriptionsClient.NewListPager +// method. +type ProductSubscriptionsClientListOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | state | filter | eq | | + // | user | expand | | | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// ProductWikiClientCreateOrUpdateOptions contains the optional parameters for the ProductWikiClient.CreateOrUpdate method. +type ProductWikiClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// ProductWikiClientDeleteOptions contains the optional parameters for the ProductWikiClient.Delete method. +type ProductWikiClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ProductWikiClientGetEntityTagOptions contains the optional parameters for the ProductWikiClient.GetEntityTag method. +type ProductWikiClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// ProductWikiClientGetOptions contains the optional parameters for the ProductWikiClient.Get method. +type ProductWikiClientGetOptions struct { + // placeholder for future optional parameters +} + +// ProductWikiClientUpdateOptions contains the optional parameters for the ProductWikiClient.Update method. +type ProductWikiClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ProductWikisClientListOptions contains the optional parameters for the ProductWikisClient.NewListPager method. +type ProductWikisClientListOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | eq | contains | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// QuotaByCounterKeysClientListByServiceOptions contains the optional parameters for the QuotaByCounterKeysClient.ListByService +// method. +type QuotaByCounterKeysClientListByServiceOptions struct { + // placeholder for future optional parameters +} + +// QuotaByCounterKeysClientUpdateOptions contains the optional parameters for the QuotaByCounterKeysClient.Update method. +type QuotaByCounterKeysClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// QuotaByPeriodKeysClientGetOptions contains the optional parameters for the QuotaByPeriodKeysClient.Get method. +type QuotaByPeriodKeysClientGetOptions struct { + // placeholder for future optional parameters +} + +// QuotaByPeriodKeysClientUpdateOptions contains the optional parameters for the QuotaByPeriodKeysClient.Update method. +type QuotaByPeriodKeysClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// RegionClientListByServiceOptions contains the optional parameters for the RegionClient.NewListByServicePager method. +type RegionClientListByServiceOptions struct { + // placeholder for future optional parameters +} + +// ReportsClientListByAPIOptions contains the optional parameters for the ReportsClient.NewListByAPIPager method. +type ReportsClientListByAPIOptions struct { + // OData order by query option. + Orderby *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// ReportsClientListByGeoOptions contains the optional parameters for the ReportsClient.NewListByGeoPager method. +type ReportsClientListByGeoOptions struct { + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// ReportsClientListByOperationOptions contains the optional parameters for the ReportsClient.NewListByOperationPager method. +type ReportsClientListByOperationOptions struct { + // OData order by query option. + Orderby *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// ReportsClientListByProductOptions contains the optional parameters for the ReportsClient.NewListByProductPager method. +type ReportsClientListByProductOptions struct { + // OData order by query option. + Orderby *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// ReportsClientListByRequestOptions contains the optional parameters for the ReportsClient.NewListByRequestPager method. +type ReportsClientListByRequestOptions struct { + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// ReportsClientListBySubscriptionOptions contains the optional parameters for the ReportsClient.NewListBySubscriptionPager +// method. +type ReportsClientListBySubscriptionOptions struct { + // OData order by query option. + Orderby *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// ReportsClientListByTimeOptions contains the optional parameters for the ReportsClient.NewListByTimePager method. +type ReportsClientListByTimeOptions struct { + // OData order by query option. + Orderby *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// ReportsClientListByUserOptions contains the optional parameters for the ReportsClient.NewListByUserPager method. +type ReportsClientListByUserOptions struct { + // OData order by query option. + Orderby *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method. +type SKUsClientListOptions struct { + // placeholder for future optional parameters +} + +// ServiceClientBeginApplyNetworkConfigurationUpdatesOptions contains the optional parameters for the ServiceClient.BeginApplyNetworkConfigurationUpdates +// method. +type ServiceClientBeginApplyNetworkConfigurationUpdatesOptions struct { + // Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, all the regions in which + // the Api Management service is deployed will be updated sequentially without + // incurring downtime in the region. + Parameters *ServiceApplyNetworkConfigurationParameters + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServiceClientBeginBackupOptions contains the optional parameters for the ServiceClient.BeginBackup method. +type ServiceClientBeginBackupOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServiceClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceClient.BeginCreateOrUpdate method. +type ServiceClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServiceClientBeginDeleteOptions contains the optional parameters for the ServiceClient.BeginDelete method. +type ServiceClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServiceClientBeginMigrateToStv2Options contains the optional parameters for the ServiceClient.BeginMigrateToStv2 method. +type ServiceClientBeginMigrateToStv2Options struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServiceClientBeginRestoreOptions contains the optional parameters for the ServiceClient.BeginRestore method. +type ServiceClientBeginRestoreOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServiceClientBeginUpdateOptions contains the optional parameters for the ServiceClient.BeginUpdate method. +type ServiceClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServiceClientCheckNameAvailabilityOptions contains the optional parameters for the ServiceClient.CheckNameAvailability +// method. +type ServiceClientCheckNameAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// ServiceClientGetDomainOwnershipIdentifierOptions contains the optional parameters for the ServiceClient.GetDomainOwnershipIdentifier +// method. +type ServiceClientGetDomainOwnershipIdentifierOptions struct { + // placeholder for future optional parameters +} + +// ServiceClientGetOptions contains the optional parameters for the ServiceClient.Get method. +type ServiceClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServiceClientGetSsoTokenOptions contains the optional parameters for the ServiceClient.GetSsoToken method. +type ServiceClientGetSsoTokenOptions struct { + // placeholder for future optional parameters +} + +// ServiceClientListByResourceGroupOptions contains the optional parameters for the ServiceClient.NewListByResourceGroupPager +// method. +type ServiceClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ServiceClientListOptions contains the optional parameters for the ServiceClient.NewListPager method. +type ServiceClientListOptions struct { + // placeholder for future optional parameters +} + +// ServiceSKUsClientListAvailableServiceSKUsOptions contains the optional parameters for the ServiceSKUsClient.NewListAvailableServiceSKUsPager +// method. +type ServiceSKUsClientListAvailableServiceSKUsOptions struct { + // placeholder for future optional parameters +} + +// SignInSettingsClientCreateOrUpdateOptions contains the optional parameters for the SignInSettingsClient.CreateOrUpdate +// method. +type SignInSettingsClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// SignInSettingsClientGetEntityTagOptions contains the optional parameters for the SignInSettingsClient.GetEntityTag method. +type SignInSettingsClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// SignInSettingsClientGetOptions contains the optional parameters for the SignInSettingsClient.Get method. +type SignInSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SignInSettingsClientUpdateOptions contains the optional parameters for the SignInSettingsClient.Update method. +type SignInSettingsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// SignUpSettingsClientCreateOrUpdateOptions contains the optional parameters for the SignUpSettingsClient.CreateOrUpdate +// method. +type SignUpSettingsClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// SignUpSettingsClientGetEntityTagOptions contains the optional parameters for the SignUpSettingsClient.GetEntityTag method. +type SignUpSettingsClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// SignUpSettingsClientGetOptions contains the optional parameters for the SignUpSettingsClient.Get method. +type SignUpSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SignUpSettingsClientUpdateOptions contains the optional parameters for the SignUpSettingsClient.Update method. +type SignUpSettingsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// SubscriptionClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionClient.CreateOrUpdate method. +type SubscriptionClientCreateOrUpdateOptions struct { + // Determines the type of application which send the create user request. Default is legacy publisher portal. + AppType *AppType + + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string + + // Notify change in Subscription State. + // * If false, do not send any email notification for change of state of subscription + // * If true, send email notification of change of state of subscription + Notify *bool +} + +// SubscriptionClientDeleteOptions contains the optional parameters for the SubscriptionClient.Delete method. +type SubscriptionClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// SubscriptionClientGetEntityTagOptions contains the optional parameters for the SubscriptionClient.GetEntityTag method. +type SubscriptionClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// SubscriptionClientGetOptions contains the optional parameters for the SubscriptionClient.Get method. +type SubscriptionClientGetOptions struct { + // placeholder for future optional parameters +} + +// SubscriptionClientListOptions contains the optional parameters for the SubscriptionClient.NewListPager method. +type SubscriptionClientListOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | state | filter | eq | | + // | user | expand | | | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// SubscriptionClientListSecretsOptions contains the optional parameters for the SubscriptionClient.ListSecrets method. +type SubscriptionClientListSecretsOptions struct { + // placeholder for future optional parameters +} + +// SubscriptionClientRegeneratePrimaryKeyOptions contains the optional parameters for the SubscriptionClient.RegeneratePrimaryKey +// method. +type SubscriptionClientRegeneratePrimaryKeyOptions struct { + // placeholder for future optional parameters +} + +// SubscriptionClientRegenerateSecondaryKeyOptions contains the optional parameters for the SubscriptionClient.RegenerateSecondaryKey +// method. +type SubscriptionClientRegenerateSecondaryKeyOptions struct { + // placeholder for future optional parameters +} + +// SubscriptionClientUpdateOptions contains the optional parameters for the SubscriptionClient.Update method. +type SubscriptionClientUpdateOptions struct { + // Determines the type of application which send the create user request. Default is legacy publisher portal. + AppType *AppType + + // Notify change in Subscription State. + // * If false, do not send any email notification for change of state of subscription + // * If true, send email notification of change of state of subscription + Notify *bool +} + +// TagClientAssignToAPIOptions contains the optional parameters for the TagClient.AssignToAPI method. +type TagClientAssignToAPIOptions struct { + // placeholder for future optional parameters +} + +// TagClientAssignToOperationOptions contains the optional parameters for the TagClient.AssignToOperation method. +type TagClientAssignToOperationOptions struct { + // placeholder for future optional parameters +} + +// TagClientAssignToProductOptions contains the optional parameters for the TagClient.AssignToProduct method. +type TagClientAssignToProductOptions struct { + // placeholder for future optional parameters +} + +// TagClientCreateOrUpdateOptions contains the optional parameters for the TagClient.CreateOrUpdate method. +type TagClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// TagClientDeleteOptions contains the optional parameters for the TagClient.Delete method. +type TagClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// TagClientDetachFromAPIOptions contains the optional parameters for the TagClient.DetachFromAPI method. +type TagClientDetachFromAPIOptions struct { + // placeholder for future optional parameters +} + +// TagClientDetachFromOperationOptions contains the optional parameters for the TagClient.DetachFromOperation method. +type TagClientDetachFromOperationOptions struct { + // placeholder for future optional parameters +} + +// TagClientDetachFromProductOptions contains the optional parameters for the TagClient.DetachFromProduct method. +type TagClientDetachFromProductOptions struct { + // placeholder for future optional parameters +} + +// TagClientGetByAPIOptions contains the optional parameters for the TagClient.GetByAPI method. +type TagClientGetByAPIOptions struct { + // placeholder for future optional parameters +} + +// TagClientGetByOperationOptions contains the optional parameters for the TagClient.GetByOperation method. +type TagClientGetByOperationOptions struct { + // placeholder for future optional parameters +} + +// TagClientGetByProductOptions contains the optional parameters for the TagClient.GetByProduct method. +type TagClientGetByProductOptions struct { + // placeholder for future optional parameters +} + +// TagClientGetEntityStateByAPIOptions contains the optional parameters for the TagClient.GetEntityStateByAPI method. +type TagClientGetEntityStateByAPIOptions struct { + // placeholder for future optional parameters +} + +// TagClientGetEntityStateByOperationOptions contains the optional parameters for the TagClient.GetEntityStateByOperation +// method. +type TagClientGetEntityStateByOperationOptions struct { + // placeholder for future optional parameters +} + +// TagClientGetEntityStateByProductOptions contains the optional parameters for the TagClient.GetEntityStateByProduct method. +type TagClientGetEntityStateByProductOptions struct { + // placeholder for future optional parameters +} + +// TagClientGetEntityStateOptions contains the optional parameters for the TagClient.GetEntityState method. +type TagClientGetEntityStateOptions struct { + // placeholder for future optional parameters +} + +// TagClientGetOptions contains the optional parameters for the TagClient.Get method. +type TagClientGetOptions struct { + // placeholder for future optional parameters +} + +// TagClientListByAPIOptions contains the optional parameters for the TagClient.NewListByAPIPager method. +type TagClientListByAPIOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// TagClientListByOperationOptions contains the optional parameters for the TagClient.NewListByOperationPager method. +type TagClientListByOperationOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// TagClientListByProductOptions contains the optional parameters for the TagClient.NewListByProductPager method. +type TagClientListByProductOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// TagClientListByServiceOptions contains the optional parameters for the TagClient.NewListByServicePager method. +type TagClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Scope like 'apis', 'products' or 'apis/{apiId} + Scope *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// TagClientUpdateOptions contains the optional parameters for the TagClient.Update method. +type TagClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// TagResourceClientListByServiceOptions contains the optional parameters for the TagResourceClient.NewListByServicePager +// method. +type TagResourceClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | aid | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | apiName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | terms | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | state | filter | eq | | + // | isCurrent | filter | eq | | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// TenantAccessClientCreateOptions contains the optional parameters for the TenantAccessClient.Create method. +type TenantAccessClientCreateOptions struct { + // placeholder for future optional parameters +} + +// TenantAccessClientGetEntityTagOptions contains the optional parameters for the TenantAccessClient.GetEntityTag method. +type TenantAccessClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// TenantAccessClientGetOptions contains the optional parameters for the TenantAccessClient.Get method. +type TenantAccessClientGetOptions struct { + // placeholder for future optional parameters +} + +// TenantAccessClientListByServiceOptions contains the optional parameters for the TenantAccessClient.NewListByServicePager +// method. +type TenantAccessClientListByServiceOptions struct { + // Not used + Filter *string +} + +// TenantAccessClientListSecretsOptions contains the optional parameters for the TenantAccessClient.ListSecrets method. +type TenantAccessClientListSecretsOptions struct { + // placeholder for future optional parameters +} + +// TenantAccessClientRegeneratePrimaryKeyOptions contains the optional parameters for the TenantAccessClient.RegeneratePrimaryKey +// method. +type TenantAccessClientRegeneratePrimaryKeyOptions struct { + // placeholder for future optional parameters +} + +// TenantAccessClientRegenerateSecondaryKeyOptions contains the optional parameters for the TenantAccessClient.RegenerateSecondaryKey +// method. +type TenantAccessClientRegenerateSecondaryKeyOptions struct { + // placeholder for future optional parameters +} + +// TenantAccessClientUpdateOptions contains the optional parameters for the TenantAccessClient.Update method. +type TenantAccessClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// TenantAccessGitClientRegeneratePrimaryKeyOptions contains the optional parameters for the TenantAccessGitClient.RegeneratePrimaryKey +// method. +type TenantAccessGitClientRegeneratePrimaryKeyOptions struct { + // placeholder for future optional parameters +} + +// TenantAccessGitClientRegenerateSecondaryKeyOptions contains the optional parameters for the TenantAccessGitClient.RegenerateSecondaryKey +// method. +type TenantAccessGitClientRegenerateSecondaryKeyOptions struct { + // placeholder for future optional parameters +} + +// TenantConfigurationClientBeginDeployOptions contains the optional parameters for the TenantConfigurationClient.BeginDeploy +// method. +type TenantConfigurationClientBeginDeployOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// TenantConfigurationClientBeginSaveOptions contains the optional parameters for the TenantConfigurationClient.BeginSave +// method. +type TenantConfigurationClientBeginSaveOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// TenantConfigurationClientBeginValidateOptions contains the optional parameters for the TenantConfigurationClient.BeginValidate +// method. +type TenantConfigurationClientBeginValidateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// TenantConfigurationClientGetSyncStateOptions contains the optional parameters for the TenantConfigurationClient.GetSyncState +// method. +type TenantConfigurationClientGetSyncStateOptions struct { + // placeholder for future optional parameters +} + +// TenantSettingsClientGetOptions contains the optional parameters for the TenantSettingsClient.Get method. +type TenantSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// TenantSettingsClientListByServiceOptions contains the optional parameters for the TenantSettingsClient.NewListByServicePager +// method. +type TenantSettingsClientListByServiceOptions struct { + // Not used + Filter *string +} + +// UserClientCreateOrUpdateOptions contains the optional parameters for the UserClient.CreateOrUpdate method. +type UserClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string + + // Send an Email notification to the User. + Notify *bool +} + +// UserClientDeleteOptions contains the optional parameters for the UserClient.Delete method. +type UserClientDeleteOptions struct { + // Determines the type of application which send the create user request. Default is legacy publisher portal. + AppType *AppType + + // Whether to delete user's subscription or not. + DeleteSubscriptions *bool + + // Send an Account Closed Email notification to the User. + Notify *bool +} + +// UserClientGenerateSsoURLOptions contains the optional parameters for the UserClient.GenerateSsoURL method. +type UserClientGenerateSsoURLOptions struct { + // placeholder for future optional parameters +} + +// UserClientGetEntityTagOptions contains the optional parameters for the UserClient.GetEntityTag method. +type UserClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// UserClientGetOptions contains the optional parameters for the UserClient.Get method. +type UserClientGetOptions struct { + // placeholder for future optional parameters +} + +// UserClientGetSharedAccessTokenOptions contains the optional parameters for the UserClient.GetSharedAccessToken method. +type UserClientGetSharedAccessTokenOptions struct { + // placeholder for future optional parameters +} + +// UserClientListByServiceOptions contains the optional parameters for the UserClient.NewListByServicePager method. +type UserClientListByServiceOptions struct { + // Detailed Group in response. + ExpandGroups *bool + + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | firstName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | lastName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | email | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | state | filter | eq | | + // | registrationDate | filter | ge, le, eq, ne, gt, lt | | + // | note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | groups | expand | | | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// UserClientUpdateOptions contains the optional parameters for the UserClient.Update method. +type UserClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// UserConfirmationPasswordClientSendOptions contains the optional parameters for the UserConfirmationPasswordClient.Send +// method. +type UserConfirmationPasswordClientSendOptions struct { + // Determines the type of application which send the create user request. Default is legacy publisher portal. + AppType *AppType +} + +// UserGroupClientListOptions contains the optional parameters for the UserGroupClient.NewListPager method. +type UserGroupClientListOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|------------------------|-----------------------------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} + +// UserIdentitiesClientListOptions contains the optional parameters for the UserIdentitiesClient.NewListPager method. +type UserIdentitiesClientListOptions struct { + // placeholder for future optional parameters +} + +// UserSubscriptionClientGetOptions contains the optional parameters for the UserSubscriptionClient.Get method. +type UserSubscriptionClientGetOptions struct { + // placeholder for future optional parameters +} + +// UserSubscriptionClientListOptions contains the optional parameters for the UserSubscriptionClient.NewListPager method. +type UserSubscriptionClientListOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|------------------------|-----------------------------------| + // |name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // |displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // |stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // |ownerId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // |scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // |userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // |productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + + // Number of records to skip. + Skip *int32 + + // Number of records to return. + Top *int32 +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/outboundnetworkdependenciesendpoints_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/outboundnetworkdependenciesendpoints_client.go index 1d0da7aa6c18..5b98584475b8 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/outboundnetworkdependenciesendpoints_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/outboundnetworkdependenciesendpoints_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type OutboundNetworkDependenciesEndpointsClient struct { } // NewOutboundNetworkDependenciesEndpointsClient creates a new instance of OutboundNetworkDependenciesEndpointsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewOutboundNetworkDependenciesEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OutboundNetworkDependenciesEndpointsClient, error) { @@ -48,24 +46,27 @@ func NewOutboundNetworkDependenciesEndpointsClient(subscriptionID string, creden // ListByService - Gets the network endpoints of all outbound dependencies of a ApiManagement service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - OutboundNetworkDependenciesEndpointsClientListByServiceOptions contains the optional parameters for the OutboundNetworkDependenciesEndpointsClient.ListByService // method. func (client *OutboundNetworkDependenciesEndpointsClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, options *OutboundNetworkDependenciesEndpointsClientListByServiceOptions) (OutboundNetworkDependenciesEndpointsClientListByServiceResponse, error) { + var err error req, err := client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return OutboundNetworkDependenciesEndpointsClientListByServiceResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OutboundNetworkDependenciesEndpointsClientListByServiceResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OutboundNetworkDependenciesEndpointsClientListByServiceResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OutboundNetworkDependenciesEndpointsClientListByServiceResponse{}, err } - return client.listByServiceHandleResponse(resp) + resp, err := client.listByServiceHandleResponse(httpResp) + return resp, err } // listByServiceCreateRequest creates the ListByService request. @@ -88,7 +89,7 @@ func (client *OutboundNetworkDependenciesEndpointsClient) listByServiceCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/outboundnetworkdependenciesendpoints_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/outboundnetworkdependenciesendpoints_client_example_test.go index 492896e75fc6..3a2b6edbac12 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/outboundnetworkdependenciesendpoints_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/outboundnetworkdependenciesendpoints_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetOutboundNetworkDependenciesEndpoints.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementServiceGetOutboundNetworkDependenciesEndpoints.json func ExampleOutboundNetworkDependenciesEndpointsClient_ListByService() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/policy_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/policy_client.go index ff25d6f5223d..13e1527f7867 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/policy_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/policy_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type PolicyClient struct { } // NewPolicyClient creates a new instance of PolicyClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPolicyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PolicyClient, error) { @@ -48,25 +46,28 @@ func NewPolicyClient(subscriptionID string, credential azcore.TokenCredential, o // CreateOrUpdate - Creates or updates the global policy configuration of the Api Management service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - policyID - The identifier of the Policy. // - parameters - The policy contents to apply. // - options - PolicyClientCreateOrUpdateOptions contains the optional parameters for the PolicyClient.CreateOrUpdate method. func (client *PolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, policyID PolicyIDName, parameters PolicyContract, options *PolicyClientCreateOrUpdateOptions) (PolicyClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, policyID, parameters, options) if err != nil { return PolicyClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PolicyClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return PolicyClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return PolicyClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -93,13 +94,16 @@ func (client *PolicyClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -117,24 +121,26 @@ func (client *PolicyClient) createOrUpdateHandleResponse(resp *http.Response) (P // Delete - Deletes the global policy configuration of the Api Management Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - policyID - The identifier of the Policy. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - options - PolicyClientDeleteOptions contains the optional parameters for the PolicyClient.Delete method. func (client *PolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, policyID PolicyIDName, ifMatch string, options *PolicyClientDeleteOptions) (PolicyClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, policyID, ifMatch, options) if err != nil { return PolicyClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PolicyClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return PolicyClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return PolicyClientDeleteResponse{}, err } return PolicyClientDeleteResponse{}, nil } @@ -163,7 +169,7 @@ func (client *PolicyClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -173,24 +179,27 @@ func (client *PolicyClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Get the Global policy definition of the Api Management service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - policyID - The identifier of the Policy. // - options - PolicyClientGetOptions contains the optional parameters for the PolicyClient.Get method. func (client *PolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, policyID PolicyIDName, options *PolicyClientGetOptions) (PolicyClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, policyID, options) if err != nil { return PolicyClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PolicyClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PolicyClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PolicyClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -220,7 +229,7 @@ func (client *PolicyClient) getCreateRequest(ctx context.Context, resourceGroupN if options != nil && options.Format != nil { reqQP.Set("format", string(*options.Format)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,24 +249,27 @@ func (client *PolicyClient) getHandleResponse(resp *http.Response) (PolicyClient // GetEntityTag - Gets the entity state (Etag) version of the Global policy definition in the Api Management service. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - policyID - The identifier of the Policy. // - options - PolicyClientGetEntityTagOptions contains the optional parameters for the PolicyClient.GetEntityTag method. func (client *PolicyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, policyID PolicyIDName, options *PolicyClientGetEntityTagOptions) (PolicyClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, policyID, options) if err != nil { return PolicyClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PolicyClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PolicyClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PolicyClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -284,7 +296,7 @@ func (client *PolicyClient) getEntityTagCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,23 +315,26 @@ func (client *PolicyClient) getEntityTagHandleResponse(resp *http.Response) (Pol // ListByService - Lists all the Global Policy definitions of the Api Management service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - PolicyClientListByServiceOptions contains the optional parameters for the PolicyClient.ListByService method. func (client *PolicyClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, options *PolicyClientListByServiceOptions) (PolicyClientListByServiceResponse, error) { + var err error req, err := client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return PolicyClientListByServiceResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PolicyClientListByServiceResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PolicyClientListByServiceResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PolicyClientListByServiceResponse{}, err } - return client.listByServiceHandleResponse(resp) + resp, err := client.listByServiceHandleResponse(httpResp) + return resp, err } // listByServiceCreateRequest creates the ListByService request. @@ -342,7 +357,7 @@ func (client *PolicyClient) listByServiceCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/policy_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/policy_client_example_test.go index 9ea92bf940bc..e8de33379658 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/policy_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/policy_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPolicies.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListPolicies.json func ExamplePolicyClient_ListByService() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -50,7 +50,7 @@ func ExamplePolicyClient_ListByService() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadPolicy.json func ExamplePolicyClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -67,7 +67,7 @@ func ExamplePolicyClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetPolicy.json func ExamplePolicyClient_Get_apiManagementGetPolicy() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -95,7 +95,7 @@ func ExamplePolicyClient_Get_apiManagementGetPolicy() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPolicyFormat.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetPolicyFormat.json func ExamplePolicyClient_Get_apiManagementGetPolicyFormat() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -124,7 +124,7 @@ func ExamplePolicyClient_Get_apiManagementGetPolicyFormat() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreatePolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreatePolicy.json func ExamplePolicyClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -157,7 +157,7 @@ func ExamplePolicyClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletePolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeletePolicy.json func ExamplePolicyClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/policydescription_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/policydescription_client.go index e65a69bdaa9c..30745a4aa910 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/policydescription_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/policydescription_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type PolicyDescriptionClient struct { } // NewPolicyDescriptionClient creates a new instance of PolicyDescriptionClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPolicyDescriptionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PolicyDescriptionClient, error) { @@ -48,24 +46,27 @@ func NewPolicyDescriptionClient(subscriptionID string, credential azcore.TokenCr // ListByService - Lists all policy descriptions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - PolicyDescriptionClientListByServiceOptions contains the optional parameters for the PolicyDescriptionClient.ListByService // method. func (client *PolicyDescriptionClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, options *PolicyDescriptionClientListByServiceOptions) (PolicyDescriptionClientListByServiceResponse, error) { + var err error req, err := client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return PolicyDescriptionClientListByServiceResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PolicyDescriptionClientListByServiceResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PolicyDescriptionClientListByServiceResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PolicyDescriptionClientListByServiceResponse{}, err } - return client.listByServiceHandleResponse(resp) + resp, err := client.listByServiceHandleResponse(httpResp) + return resp, err } // listByServiceCreateRequest creates the ListByService request. @@ -91,7 +92,7 @@ func (client *PolicyDescriptionClient) listByServiceCreateRequest(ctx context.Co if options != nil && options.Scope != nil { reqQP.Set("scope", string(*options.Scope)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/policydescription_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/policydescription_client_example_test.go index 0c638f7050a2..f6edf93ae47f 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/policydescription_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/policydescription_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPolicyDescriptions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListPolicyDescriptions.json func ExamplePolicyDescriptionClient_ListByService() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/policyfragment_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/policyfragment_client.go new file mode 100644 index 000000000000..8b094d721de9 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/policyfragment_client.go @@ -0,0 +1,467 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armapimanagement + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// PolicyFragmentClient contains the methods for the PolicyFragment group. +// Don't use this type directly, use NewPolicyFragmentClient() instead. +type PolicyFragmentClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPolicyFragmentClient creates a new instance of PolicyFragmentClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPolicyFragmentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PolicyFragmentClient, error) { + cl, err := arm.NewClient(moduleName+".PolicyFragmentClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PolicyFragmentClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a policy fragment. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - id - A resource identifier. +// - parameters - The policy fragment contents to apply. +// - options - PolicyFragmentClientBeginCreateOrUpdateOptions contains the optional parameters for the PolicyFragmentClient.BeginCreateOrUpdate +// method. +func (client *PolicyFragmentClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, id string, parameters PolicyFragmentContract, options *PolicyFragmentClientBeginCreateOrUpdateOptions) (*runtime.Poller[PolicyFragmentClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, id, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PolicyFragmentClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[PolicyFragmentClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Creates or updates a policy fragment. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +func (client *PolicyFragmentClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, id string, parameters PolicyFragmentContract, options *PolicyFragmentClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, id, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PolicyFragmentClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, id string, parameters PolicyFragmentContract, options *PolicyFragmentClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// Delete - Deletes a policy fragment. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - id - A resource identifier. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - PolicyFragmentClientDeleteOptions contains the optional parameters for the PolicyFragmentClient.Delete method. +func (client *PolicyFragmentClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, id string, ifMatch string, options *PolicyFragmentClientDeleteOptions) (PolicyFragmentClientDeleteResponse, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, id, ifMatch, options) + if err != nil { + return PolicyFragmentClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PolicyFragmentClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return PolicyFragmentClientDeleteResponse{}, err + } + return PolicyFragmentClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PolicyFragmentClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, id string, ifMatch string, options *PolicyFragmentClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a policy fragment. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - id - A resource identifier. +// - options - PolicyFragmentClientGetOptions contains the optional parameters for the PolicyFragmentClient.Get method. +func (client *PolicyFragmentClient) Get(ctx context.Context, resourceGroupName string, serviceName string, id string, options *PolicyFragmentClientGetOptions) (PolicyFragmentClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, id, options) + if err != nil { + return PolicyFragmentClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PolicyFragmentClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PolicyFragmentClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *PolicyFragmentClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, id string, options *PolicyFragmentClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + if options != nil && options.Format != nil { + reqQP.Set("format", string(*options.Format)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PolicyFragmentClient) getHandleResponse(resp *http.Response) (PolicyFragmentClientGetResponse, error) { + result := PolicyFragmentClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.PolicyFragmentContract); err != nil { + return PolicyFragmentClientGetResponse{}, err + } + return result, nil +} + +// GetEntityTag - Gets the entity state (Etag) version of a policy fragment. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - id - A resource identifier. +// - options - PolicyFragmentClientGetEntityTagOptions contains the optional parameters for the PolicyFragmentClient.GetEntityTag +// method. +func (client *PolicyFragmentClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, id string, options *PolicyFragmentClientGetEntityTagOptions) (PolicyFragmentClientGetEntityTagResponse, error) { + var err error + req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, id, options) + if err != nil { + return PolicyFragmentClientGetEntityTagResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PolicyFragmentClientGetEntityTagResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PolicyFragmentClientGetEntityTagResponse{}, err + } + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err +} + +// getEntityTagCreateRequest creates the GetEntityTag request. +func (client *PolicyFragmentClient) getEntityTagCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, id string, options *PolicyFragmentClientGetEntityTagOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getEntityTagHandleResponse handles the GetEntityTag response. +func (client *PolicyFragmentClient) getEntityTagHandleResponse(resp *http.Response) (PolicyFragmentClientGetEntityTagResponse, error) { + result := PolicyFragmentClientGetEntityTagResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + result.Success = resp.StatusCode >= 200 && resp.StatusCode < 300 + return result, nil +} + +// ListByService - Gets all policy fragments. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - PolicyFragmentClientListByServiceOptions contains the optional parameters for the PolicyFragmentClient.ListByService +// method. +func (client *PolicyFragmentClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, options *PolicyFragmentClientListByServiceOptions) (PolicyFragmentClientListByServiceResponse, error) { + var err error + req, err := client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return PolicyFragmentClientListByServiceResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PolicyFragmentClientListByServiceResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PolicyFragmentClientListByServiceResponse{}, err + } + resp, err := client.listByServiceHandleResponse(httpResp) + return resp, err +} + +// listByServiceCreateRequest creates the ListByService request. +func (client *PolicyFragmentClient) listByServiceCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *PolicyFragmentClientListByServiceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Orderby != nil { + reqQP.Set("$orderby", *options.Orderby) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServiceHandleResponse handles the ListByService response. +func (client *PolicyFragmentClient) listByServiceHandleResponse(resp *http.Response) (PolicyFragmentClientListByServiceResponse, error) { + result := PolicyFragmentClientListByServiceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PolicyFragmentCollection); err != nil { + return PolicyFragmentClientListByServiceResponse{}, err + } + return result, nil +} + +// ListReferences - Lists policy resources that reference the policy fragment. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - id - A resource identifier. +// - options - PolicyFragmentClientListReferencesOptions contains the optional parameters for the PolicyFragmentClient.ListReferences +// method. +func (client *PolicyFragmentClient) ListReferences(ctx context.Context, resourceGroupName string, serviceName string, id string, options *PolicyFragmentClientListReferencesOptions) (PolicyFragmentClientListReferencesResponse, error) { + var err error + req, err := client.listReferencesCreateRequest(ctx, resourceGroupName, serviceName, id, options) + if err != nil { + return PolicyFragmentClientListReferencesResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PolicyFragmentClientListReferencesResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PolicyFragmentClientListReferencesResponse{}, err + } + resp, err := client.listReferencesHandleResponse(httpResp) + return resp, err +} + +// listReferencesCreateRequest creates the ListReferences request. +func (client *PolicyFragmentClient) listReferencesCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, id string, options *PolicyFragmentClientListReferencesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}/listReferences" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listReferencesHandleResponse handles the ListReferences response. +func (client *PolicyFragmentClient) listReferencesHandleResponse(resp *http.Response) (PolicyFragmentClientListReferencesResponse, error) { + result := PolicyFragmentClientListReferencesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceCollection); err != nil { + return PolicyFragmentClientListReferencesResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/policyfragment_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/policyfragment_client_example_test.go new file mode 100644 index 000000000000..9ad39cf8fe6f --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/policyfragment_client_example_test.go @@ -0,0 +1,222 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListPolicyFragments.json +func ExamplePolicyFragmentClient_ListByService() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPolicyFragmentClient().ListByService(ctx, "rg1", "apimService1", &armapimanagement.PolicyFragmentClientListByServiceOptions{Filter: nil, + Orderby: nil, + Top: nil, + Skip: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.PolicyFragmentCollection = armapimanagement.PolicyFragmentCollection{ + // Count: to.Ptr[int64](1), + // Value: []*armapimanagement.PolicyFragmentContract{ + // { + // Name: to.Ptr("policyFragment1"), + // Type: to.Ptr("Microsoft.ApiManagement/service/policyFragments"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policyFragments/policyFragment1"), + // Properties: &armapimanagement.PolicyFragmentContractProperties{ + // Format: to.Ptr(armapimanagement.PolicyFragmentContentFormatXML), + // Description: to.Ptr("A policy fragment example"), + // Value: to.Ptr(""), + // }, + // }}, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadPolicyFragment.json +func ExamplePolicyFragmentClient_GetEntityTag() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewPolicyFragmentClient().GetEntityTag(ctx, "rg1", "apimService1", "policyFragment1", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetPolicyFragment.json +func ExamplePolicyFragmentClient_Get_apiManagementGetPolicyFragment() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPolicyFragmentClient().Get(ctx, "rg1", "apimService1", "policyFragment1", &armapimanagement.PolicyFragmentClientGetOptions{Format: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.PolicyFragmentContract = armapimanagement.PolicyFragmentContract{ + // Name: to.Ptr("policyFragment1"), + // Type: to.Ptr("Microsoft.ApiManagement/service/policyFragments"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policyFragments/policyFragment1"), + // Properties: &armapimanagement.PolicyFragmentContractProperties{ + // Format: to.Ptr(armapimanagement.PolicyFragmentContentFormatXML), + // Description: to.Ptr("A policy fragment example"), + // Value: to.Ptr(""), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetPolicyFragmentFormat.json +func ExamplePolicyFragmentClient_Get_apiManagementGetPolicyFragmentFormat() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPolicyFragmentClient().Get(ctx, "rg1", "apimService1", "policyFragment1", &armapimanagement.PolicyFragmentClientGetOptions{Format: to.Ptr(armapimanagement.PolicyFragmentContentFormatRawxml)}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.PolicyFragmentContract = armapimanagement.PolicyFragmentContract{ + // Name: to.Ptr("policyFragment1"), + // Type: to.Ptr("Microsoft.ApiManagement/service/policyFragments"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policyFragments/policyFragment1"), + // Properties: &armapimanagement.PolicyFragmentContractProperties{ + // Format: to.Ptr(armapimanagement.PolicyFragmentContentFormatRawxml), + // Description: to.Ptr("A policy fragment example"), + // Value: to.Ptr("\r\n @{\n var guidBinary = new byte[16];\n Array.Copy(Guid.NewGuid().ToByteArray(), 0, guidBinary, 0, 10);\n long time = DateTime.Now.Ticks;\n byte[] bytes = new byte[6];\n unchecked\n {\n bytes[5] = (byte)(time >> 40);\n bytes[4] = (byte)(time >> 32);\n bytes[3] = (byte)(time >> 24);\n bytes[2] = (byte)(time >> 16);\n bytes[1] = (byte)(time >> 8);\n bytes[0] = (byte)(time);\n }\n Array.Copy(bytes, 0, guidBinary, 10, 6);\n return new Guid(guidBinary).ToString();\n }\n \r\n "), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreatePolicyFragment.json +func ExamplePolicyFragmentClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewPolicyFragmentClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", "policyFragment1", armapimanagement.PolicyFragmentContract{ + Properties: &armapimanagement.PolicyFragmentContractProperties{ + Format: to.Ptr(armapimanagement.PolicyFragmentContentFormatXML), + Description: to.Ptr("A policy fragment example"), + Value: to.Ptr(""), + }, + }, &armapimanagement.PolicyFragmentClientBeginCreateOrUpdateOptions{IfMatch: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.PolicyFragmentContract = armapimanagement.PolicyFragmentContract{ + // Name: to.Ptr("policyFragment1"), + // Type: to.Ptr("Microsoft.ApiManagement/service/policyFragments"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policyFragments/policyFragment1"), + // Properties: &armapimanagement.PolicyFragmentContractProperties{ + // Format: to.Ptr(armapimanagement.PolicyFragmentContentFormatXML), + // Description: to.Ptr("A policy fragment example"), + // Value: to.Ptr(""), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeletePolicyFragment.json +func ExamplePolicyFragmentClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewPolicyFragmentClient().Delete(ctx, "rg1", "apimService1", "policyFragment1", "*", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListPolicyFragmentReferences.json +func ExamplePolicyFragmentClient_ListReferences() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPolicyFragmentClient().ListReferences(ctx, "rg1", "apimService1", "policyFragment1", &armapimanagement.PolicyFragmentClientListReferencesOptions{Top: nil, + Skip: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ResourceCollection = armapimanagement.ResourceCollection{ + // Count: to.Ptr[int64](1), + // Value: []*armapimanagement.ResourceCollectionValueItem{ + // { + // Name: to.Ptr("policy"), + // Type: to.Ptr("Microsoft.ApiManagement/service/policies"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/policies/policy"), + // }}, + // } +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/portalconfig_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/portalconfig_client.go new file mode 100644 index 000000000000..a53246d8ab8c --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/portalconfig_client.go @@ -0,0 +1,384 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armapimanagement + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// PortalConfigClient contains the methods for the PortalConfig group. +// Don't use this type directly, use NewPortalConfigClient() instead. +type PortalConfigClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPortalConfigClient creates a new instance of PortalConfigClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPortalConfigClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PortalConfigClient, error) { + cl, err := arm.NewClient(moduleName+".PortalConfigClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PortalConfigClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Create or update the developer portal configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - portalConfigID - Portal configuration identifier. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update the developer portal configuration. +// - options - PortalConfigClientCreateOrUpdateOptions contains the optional parameters for the PortalConfigClient.CreateOrUpdate +// method. +func (client *PortalConfigClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, portalConfigID string, ifMatch string, parameters PortalConfigContract, options *PortalConfigClientCreateOrUpdateOptions) (PortalConfigClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, portalConfigID, ifMatch, parameters, options) + if err != nil { + return PortalConfigClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PortalConfigClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PortalConfigClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PortalConfigClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, portalConfigID string, ifMatch string, parameters PortalConfigContract, options *PortalConfigClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalconfigs/{portalConfigId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if portalConfigID == "" { + return nil, errors.New("parameter portalConfigID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{portalConfigId}", url.PathEscape(portalConfigID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *PortalConfigClient) createOrUpdateHandleResponse(resp *http.Response) (PortalConfigClientCreateOrUpdateResponse, error) { + result := PortalConfigClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PortalConfigContract); err != nil { + return PortalConfigClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Get - Get the developer portal configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - portalConfigID - Portal configuration identifier. +// - options - PortalConfigClientGetOptions contains the optional parameters for the PortalConfigClient.Get method. +func (client *PortalConfigClient) Get(ctx context.Context, resourceGroupName string, serviceName string, portalConfigID string, options *PortalConfigClientGetOptions) (PortalConfigClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, portalConfigID, options) + if err != nil { + return PortalConfigClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PortalConfigClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PortalConfigClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *PortalConfigClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, portalConfigID string, options *PortalConfigClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalconfigs/{portalConfigId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if portalConfigID == "" { + return nil, errors.New("parameter portalConfigID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{portalConfigId}", url.PathEscape(portalConfigID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PortalConfigClient) getHandleResponse(resp *http.Response) (PortalConfigClientGetResponse, error) { + result := PortalConfigClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.PortalConfigContract); err != nil { + return PortalConfigClientGetResponse{}, err + } + return result, nil +} + +// GetEntityTag - Gets the entity state (Etag) version of the developer portal configuration. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - portalConfigID - Portal configuration identifier. +// - options - PortalConfigClientGetEntityTagOptions contains the optional parameters for the PortalConfigClient.GetEntityTag +// method. +func (client *PortalConfigClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, portalConfigID string, options *PortalConfigClientGetEntityTagOptions) (PortalConfigClientGetEntityTagResponse, error) { + var err error + req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, portalConfigID, options) + if err != nil { + return PortalConfigClientGetEntityTagResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PortalConfigClientGetEntityTagResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PortalConfigClientGetEntityTagResponse{}, err + } + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err +} + +// getEntityTagCreateRequest creates the GetEntityTag request. +func (client *PortalConfigClient) getEntityTagCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, portalConfigID string, options *PortalConfigClientGetEntityTagOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalconfigs/{portalConfigId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if portalConfigID == "" { + return nil, errors.New("parameter portalConfigID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{portalConfigId}", url.PathEscape(portalConfigID)) + req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getEntityTagHandleResponse handles the GetEntityTag response. +func (client *PortalConfigClient) getEntityTagHandleResponse(resp *http.Response) (PortalConfigClientGetEntityTagResponse, error) { + result := PortalConfigClientGetEntityTagResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + result.Success = resp.StatusCode >= 200 && resp.StatusCode < 300 + return result, nil +} + +// ListByService - Lists the developer portal configurations. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - PortalConfigClientListByServiceOptions contains the optional parameters for the PortalConfigClient.ListByService +// method. +func (client *PortalConfigClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, options *PortalConfigClientListByServiceOptions) (PortalConfigClientListByServiceResponse, error) { + var err error + req, err := client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return PortalConfigClientListByServiceResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PortalConfigClientListByServiceResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PortalConfigClientListByServiceResponse{}, err + } + resp, err := client.listByServiceHandleResponse(httpResp) + return resp, err +} + +// listByServiceCreateRequest creates the ListByService request. +func (client *PortalConfigClient) listByServiceCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *PortalConfigClientListByServiceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalconfigs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServiceHandleResponse handles the ListByService response. +func (client *PortalConfigClient) listByServiceHandleResponse(resp *http.Response) (PortalConfigClientListByServiceResponse, error) { + result := PortalConfigClientListByServiceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PortalConfigCollection); err != nil { + return PortalConfigClientListByServiceResponse{}, err + } + return result, nil +} + +// Update - Update the developer portal configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - portalConfigID - Portal configuration identifier. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update the developer portal configuration. +// - options - PortalConfigClientUpdateOptions contains the optional parameters for the PortalConfigClient.Update method. +func (client *PortalConfigClient) Update(ctx context.Context, resourceGroupName string, serviceName string, portalConfigID string, ifMatch string, parameters PortalConfigContract, options *PortalConfigClientUpdateOptions) (PortalConfigClientUpdateResponse, error) { + var err error + req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, portalConfigID, ifMatch, parameters, options) + if err != nil { + return PortalConfigClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PortalConfigClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PortalConfigClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *PortalConfigClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, portalConfigID string, ifMatch string, parameters PortalConfigContract, options *PortalConfigClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalconfigs/{portalConfigId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if portalConfigID == "" { + return nil, errors.New("parameter portalConfigID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{portalConfigId}", url.PathEscape(portalConfigID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *PortalConfigClient) updateHandleResponse(resp *http.Response) (PortalConfigClientUpdateResponse, error) { + result := PortalConfigClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PortalConfigContract); err != nil { + return PortalConfigClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/portalconfig_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/portalconfig_client_example_test.go new file mode 100644 index 000000000000..0cee11abc437 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/portalconfig_client_example_test.go @@ -0,0 +1,303 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListPortalConfig.json +func ExamplePortalConfigClient_ListByService() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPortalConfigClient().ListByService(ctx, "rg1", "apimService1", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.PortalConfigCollection = armapimanagement.PortalConfigCollection{ + // Value: []*armapimanagement.PortalConfigContract{ + // { + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.ApiManagement/service/portalconfigs"), + // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalconfigs/default"), + // Properties: &armapimanagement.PortalConfigProperties{ + // Cors: &armapimanagement.PortalConfigCorsProperties{ + // AllowedOrigins: []*string{ + // to.Ptr("https://contoso.com")}, + // }, + // Csp: &armapimanagement.PortalConfigCspProperties{ + // AllowedSources: []*string{ + // to.Ptr("*.contoso.com")}, + // Mode: to.Ptr(armapimanagement.PortalSettingsCspModeReportOnly), + // ReportURI: []*string{ + // to.Ptr("https://report.contoso.com")}, + // }, + // Delegation: &armapimanagement.PortalConfigDelegationProperties{ + // DelegateRegistration: to.Ptr(false), + // DelegateSubscription: to.Ptr(false), + // }, + // EnableBasicAuth: to.Ptr(true), + // Signin: &armapimanagement.PortalConfigPropertiesSignin{ + // Require: to.Ptr(false), + // }, + // Signup: &armapimanagement.PortalConfigPropertiesSignup{ + // TermsOfService: &armapimanagement.PortalConfigTermsOfServiceProperties{ + // RequireConsent: to.Ptr(false), + // Text: to.Ptr("I agree to the service terms and conditions."), + // }, + // }, + // }, + // }}, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadPortalConfig.json +func ExamplePortalConfigClient_GetEntityTag() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewPortalConfigClient().GetEntityTag(ctx, "rg1", "apimService1", "default", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementPortalConfig.json +func ExamplePortalConfigClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPortalConfigClient().Get(ctx, "rg1", "apimService1", "default", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.PortalConfigContract = armapimanagement.PortalConfigContract{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.ApiManagement/service/portalconfigs"), + // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalconfigs/default"), + // Properties: &armapimanagement.PortalConfigProperties{ + // Cors: &armapimanagement.PortalConfigCorsProperties{ + // AllowedOrigins: []*string{ + // to.Ptr("https://contoso.com")}, + // }, + // Csp: &armapimanagement.PortalConfigCspProperties{ + // AllowedSources: []*string{ + // to.Ptr("*.contoso.com")}, + // Mode: to.Ptr(armapimanagement.PortalSettingsCspModeReportOnly), + // ReportURI: []*string{ + // to.Ptr("https://report.contoso.com")}, + // }, + // Delegation: &armapimanagement.PortalConfigDelegationProperties{ + // DelegateRegistration: to.Ptr(false), + // DelegateSubscription: to.Ptr(false), + // }, + // EnableBasicAuth: to.Ptr(true), + // Signin: &armapimanagement.PortalConfigPropertiesSignin{ + // Require: to.Ptr(false), + // }, + // Signup: &armapimanagement.PortalConfigPropertiesSignup{ + // TermsOfService: &armapimanagement.PortalConfigTermsOfServiceProperties{ + // RequireConsent: to.Ptr(false), + // Text: to.Ptr("I agree to the service terms and conditions."), + // }, + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdatePortalConfig.json +func ExamplePortalConfigClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPortalConfigClient().Update(ctx, "rg1", "apimService1", "default", "*", armapimanagement.PortalConfigContract{ + Properties: &armapimanagement.PortalConfigProperties{ + Cors: &armapimanagement.PortalConfigCorsProperties{ + AllowedOrigins: []*string{ + to.Ptr("https://contoso.com")}, + }, + Csp: &armapimanagement.PortalConfigCspProperties{ + AllowedSources: []*string{ + to.Ptr("*.contoso.com")}, + Mode: to.Ptr(armapimanagement.PortalSettingsCspModeReportOnly), + ReportURI: []*string{ + to.Ptr("https://report.contoso.com")}, + }, + Delegation: &armapimanagement.PortalConfigDelegationProperties{ + DelegateRegistration: to.Ptr(false), + DelegateSubscription: to.Ptr(false), + }, + EnableBasicAuth: to.Ptr(true), + Signin: &armapimanagement.PortalConfigPropertiesSignin{ + Require: to.Ptr(false), + }, + Signup: &armapimanagement.PortalConfigPropertiesSignup{ + TermsOfService: &armapimanagement.PortalConfigTermsOfServiceProperties{ + RequireConsent: to.Ptr(false), + Text: to.Ptr("I agree to the service terms and conditions."), + }, + }, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.PortalConfigContract = armapimanagement.PortalConfigContract{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.ApiManagement/service/portalconfigs"), + // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalconfigs/default"), + // Properties: &armapimanagement.PortalConfigProperties{ + // Cors: &armapimanagement.PortalConfigCorsProperties{ + // AllowedOrigins: []*string{ + // to.Ptr("https://contoso.com")}, + // }, + // Csp: &armapimanagement.PortalConfigCspProperties{ + // AllowedSources: []*string{ + // to.Ptr("*.contoso.com")}, + // Mode: to.Ptr(armapimanagement.PortalSettingsCspModeReportOnly), + // ReportURI: []*string{ + // to.Ptr("https://report.contoso.com")}, + // }, + // Delegation: &armapimanagement.PortalConfigDelegationProperties{ + // DelegateRegistration: to.Ptr(false), + // DelegateSubscription: to.Ptr(false), + // }, + // EnableBasicAuth: to.Ptr(true), + // Signin: &armapimanagement.PortalConfigPropertiesSignin{ + // Require: to.Ptr(false), + // }, + // Signup: &armapimanagement.PortalConfigPropertiesSignup{ + // TermsOfService: &armapimanagement.PortalConfigTermsOfServiceProperties{ + // RequireConsent: to.Ptr(false), + // Text: to.Ptr("I agree to the service terms and conditions."), + // }, + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreatePortalConfig.json +func ExamplePortalConfigClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewPortalConfigClient().CreateOrUpdate(ctx, "rg1", "apimService1", "default", "*", armapimanagement.PortalConfigContract{ + Properties: &armapimanagement.PortalConfigProperties{ + Cors: &armapimanagement.PortalConfigCorsProperties{ + AllowedOrigins: []*string{ + to.Ptr("https://contoso.com")}, + }, + Csp: &armapimanagement.PortalConfigCspProperties{ + AllowedSources: []*string{ + to.Ptr("*.contoso.com")}, + Mode: to.Ptr(armapimanagement.PortalSettingsCspModeReportOnly), + ReportURI: []*string{ + to.Ptr("https://report.contoso.com")}, + }, + Delegation: &armapimanagement.PortalConfigDelegationProperties{ + DelegateRegistration: to.Ptr(false), + DelegateSubscription: to.Ptr(false), + }, + EnableBasicAuth: to.Ptr(true), + Signin: &armapimanagement.PortalConfigPropertiesSignin{ + Require: to.Ptr(false), + }, + Signup: &armapimanagement.PortalConfigPropertiesSignup{ + TermsOfService: &armapimanagement.PortalConfigTermsOfServiceProperties{ + RequireConsent: to.Ptr(false), + Text: to.Ptr("I agree to the service terms and conditions."), + }, + }, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.PortalConfigContract = armapimanagement.PortalConfigContract{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.ApiManagement/service/portalconfigs"), + // ID: to.Ptr("/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/portalconfigs/default"), + // Properties: &armapimanagement.PortalConfigProperties{ + // Cors: &armapimanagement.PortalConfigCorsProperties{ + // AllowedOrigins: []*string{ + // to.Ptr("https://contoso.com")}, + // }, + // Csp: &armapimanagement.PortalConfigCspProperties{ + // AllowedSources: []*string{ + // to.Ptr("*.contoso.com")}, + // Mode: to.Ptr(armapimanagement.PortalSettingsCspModeReportOnly), + // ReportURI: []*string{ + // to.Ptr("https://report.contoso.com")}, + // }, + // Delegation: &armapimanagement.PortalConfigDelegationProperties{ + // DelegateRegistration: to.Ptr(false), + // DelegateSubscription: to.Ptr(false), + // }, + // EnableBasicAuth: to.Ptr(true), + // Signin: &armapimanagement.PortalConfigPropertiesSignin{ + // Require: to.Ptr(false), + // }, + // Signup: &armapimanagement.PortalConfigPropertiesSignup{ + // TermsOfService: &armapimanagement.PortalConfigTermsOfServiceProperties{ + // RequireConsent: to.Ptr(false), + // Text: to.Ptr("I agree to the service terms and conditions."), + // }, + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/portalrevision_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/portalrevision_client.go index 04beae0b6fb1..77d14c69ba90 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/portalrevision_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/portalrevision_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type PortalRevisionClient struct { } // NewPortalRevisionClient creates a new instance of PortalRevisionClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPortalRevisionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PortalRevisionClient, error) { @@ -50,8 +48,8 @@ func NewPortalRevisionClient(subscriptionID string, credential azcore.TokenCrede // indicates if the revision is publicly accessible. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - portalRevisionID - Portal revision identifier. Must be unique in the current API Management service instance. // - options - PortalRevisionClientBeginCreateOrUpdateOptions contains the optional parameters for the PortalRevisionClient.BeginCreateOrUpdate @@ -62,9 +60,10 @@ func (client *PortalRevisionClient) BeginCreateOrUpdate(ctx context.Context, res if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PortalRevisionClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PortalRevisionClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[PortalRevisionClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -74,20 +73,22 @@ func (client *PortalRevisionClient) BeginCreateOrUpdate(ctx context.Context, res // if the revision is publicly accessible. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *PortalRevisionClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, portalRevisionID string, parameters PortalRevisionContract, options *PortalRevisionClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, portalRevisionID, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -114,33 +115,39 @@ func (client *PortalRevisionClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Get - Gets the developer portal's revision specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - portalRevisionID - Portal revision identifier. Must be unique in the current API Management service instance. // - options - PortalRevisionClientGetOptions contains the optional parameters for the PortalRevisionClient.Get method. func (client *PortalRevisionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, portalRevisionID string, options *PortalRevisionClientGetOptions) (PortalRevisionClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, portalRevisionID, options) if err != nil { return PortalRevisionClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PortalRevisionClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PortalRevisionClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PortalRevisionClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -167,7 +174,7 @@ func (client *PortalRevisionClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -187,25 +194,28 @@ func (client *PortalRevisionClient) getHandleResponse(resp *http.Response) (Port // GetEntityTag - Gets the developer portal revision specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - portalRevisionID - Portal revision identifier. Must be unique in the current API Management service instance. // - options - PortalRevisionClientGetEntityTagOptions contains the optional parameters for the PortalRevisionClient.GetEntityTag // method. func (client *PortalRevisionClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, portalRevisionID string, options *PortalRevisionClientGetEntityTagOptions) (PortalRevisionClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, portalRevisionID, options) if err != nil { return PortalRevisionClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PortalRevisionClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PortalRevisionClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PortalRevisionClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -232,7 +242,7 @@ func (client *PortalRevisionClient) getEntityTagCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,8 +260,8 @@ func (client *PortalRevisionClient) getEntityTagHandleResponse(resp *http.Respon // NewListByServicePager - Lists developer portal's revisions. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - PortalRevisionClientListByServiceOptions contains the optional parameters for the PortalRevisionClient.NewListByServicePager // method. @@ -312,7 +322,7 @@ func (client *PortalRevisionClient) listByServiceCreateRequest(ctx context.Conte if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,8 +340,8 @@ func (client *PortalRevisionClient) listByServiceHandleResponse(resp *http.Respo // BeginUpdate - Updates the description of specified portal revision or makes it current. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - portalRevisionID - Portal revision identifier. Must be unique in the current API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -344,9 +354,10 @@ func (client *PortalRevisionClient) BeginUpdate(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PortalRevisionClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PortalRevisionClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[PortalRevisionClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -355,20 +366,22 @@ func (client *PortalRevisionClient) BeginUpdate(ctx context.Context, resourceGro // Update - Updates the description of specified portal revision or makes it current. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *PortalRevisionClient) update(ctx context.Context, resourceGroupName string, serviceName string, portalRevisionID string, ifMatch string, parameters PortalRevisionContract, options *PortalRevisionClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, portalRevisionID, ifMatch, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -395,9 +408,12 @@ func (client *PortalRevisionClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/portalrevision_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/portalrevision_client_example_test.go index 54d365279c35..947d6b88acbb 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/portalrevision_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/portalrevision_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPortalRevisions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListPortalRevisions.json func ExamplePortalRevisionClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -73,7 +73,7 @@ func ExamplePortalRevisionClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadPortalRevision.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadPortalRevision.json func ExamplePortalRevisionClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -90,7 +90,7 @@ func ExamplePortalRevisionClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPortalRevision.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetPortalRevision.json func ExamplePortalRevisionClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -122,7 +122,7 @@ func ExamplePortalRevisionClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreatePortalRevision.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreatePortalRevision.json func ExamplePortalRevisionClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -148,7 +148,7 @@ func ExamplePortalRevisionClient_BeginCreateOrUpdate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdatePortalRevision.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdatePortalRevision.json func ExamplePortalRevisionClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/portalsettings_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/portalsettings_client.go index 734a4527066a..e667eb79fd27 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/portalsettings_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/portalsettings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type PortalSettingsClient struct { } // NewPortalSettingsClient creates a new instance of PortalSettingsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPortalSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PortalSettingsClient, error) { @@ -48,24 +46,27 @@ func NewPortalSettingsClient(subscriptionID string, credential azcore.TokenCrede // ListByService - Lists a collection of portalsettings defined within a service instance.. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - PortalSettingsClientListByServiceOptions contains the optional parameters for the PortalSettingsClient.ListByService // method. func (client *PortalSettingsClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, options *PortalSettingsClientListByServiceOptions) (PortalSettingsClientListByServiceResponse, error) { + var err error req, err := client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return PortalSettingsClientListByServiceResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PortalSettingsClientListByServiceResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PortalSettingsClientListByServiceResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PortalSettingsClientListByServiceResponse{}, err } - return client.listByServiceHandleResponse(resp) + resp, err := client.listByServiceHandleResponse(httpResp) + return resp, err } // listByServiceCreateRequest creates the ListByService request. @@ -88,7 +89,7 @@ func (client *PortalSettingsClient) listByServiceCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/portalsettings_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/portalsettings_client_example_test.go index df61edb03613..ceb1cf69b86e 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/portalsettings_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/portalsettings_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPortalSettings.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListPortalSettings.json func ExamplePortalSettingsClient_ListByService() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/privateendpointconnection_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/privateendpointconnection_client.go index 57cc2140be74..41ecdb5998ff 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/privateendpointconnection_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/privateendpointconnection_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type PrivateEndpointConnectionClient struct { } // NewPrivateEndpointConnectionClient creates a new instance of PrivateEndpointConnectionClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPrivateEndpointConnectionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionClient, error) { @@ -48,8 +46,8 @@ func NewPrivateEndpointConnectionClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - Creates a new Private Endpoint Connection or updates an existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - privateEndpointConnectionName - Name of the private endpoint connection. // - options - PrivateEndpointConnectionClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginCreateOrUpdate @@ -60,7 +58,8 @@ func (client *PrivateEndpointConnectionClient) BeginCreateOrUpdate(ctx context.C if err != nil { return nil, err } - return runtime.NewPoller[PrivateEndpointConnectionClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[PrivateEndpointConnectionClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -69,20 +68,22 @@ func (client *PrivateEndpointConnectionClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Creates a new Private Endpoint Connection or updates an existing one. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *PrivateEndpointConnectionClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, privateEndpointConnectionName string, privateEndpointConnectionRequest PrivateEndpointConnectionRequest, options *PrivateEndpointConnectionClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, privateEndpointConnectionName, privateEndpointConnectionRequest, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -109,17 +110,20 @@ func (client *PrivateEndpointConnectionClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, privateEndpointConnectionRequest) + if err := runtime.MarshalAsJSON(req, privateEndpointConnectionRequest); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes the specified Private Endpoint Connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - privateEndpointConnectionName - Name of the private endpoint connection. // - options - PrivateEndpointConnectionClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginDelete @@ -130,7 +134,8 @@ func (client *PrivateEndpointConnectionClient) BeginDelete(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[PrivateEndpointConnectionClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[PrivateEndpointConnectionClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -139,20 +144,22 @@ func (client *PrivateEndpointConnectionClient) BeginDelete(ctx context.Context, // Delete - Deletes the specified Private Endpoint Connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *PrivateEndpointConnectionClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, privateEndpointConnectionName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -179,7 +186,7 @@ func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,25 +195,28 @@ func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.C // GetByName - Gets the details of the Private Endpoint Connection specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - privateEndpointConnectionName - Name of the private endpoint connection. // - options - PrivateEndpointConnectionClientGetByNameOptions contains the optional parameters for the PrivateEndpointConnectionClient.GetByName // method. func (client *PrivateEndpointConnectionClient) GetByName(ctx context.Context, resourceGroupName string, serviceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientGetByNameOptions) (PrivateEndpointConnectionClientGetByNameResponse, error) { + var err error req, err := client.getByNameCreateRequest(ctx, resourceGroupName, serviceName, privateEndpointConnectionName, options) if err != nil { return PrivateEndpointConnectionClientGetByNameResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateEndpointConnectionClientGetByNameResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionClientGetByNameResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointConnectionClientGetByNameResponse{}, err } - return client.getByNameHandleResponse(resp) + resp, err := client.getByNameHandleResponse(httpResp) + return resp, err } // getByNameCreateRequest creates the GetByName request. @@ -233,7 +243,7 @@ func (client *PrivateEndpointConnectionClient) getByNameCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -251,25 +261,28 @@ func (client *PrivateEndpointConnectionClient) getByNameHandleResponse(resp *htt // GetPrivateLinkResource - Gets the private link resources // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - privateLinkSubResourceName - Name of the private link resource. // - options - PrivateEndpointConnectionClientGetPrivateLinkResourceOptions contains the optional parameters for the PrivateEndpointConnectionClient.GetPrivateLinkResource // method. func (client *PrivateEndpointConnectionClient) GetPrivateLinkResource(ctx context.Context, resourceGroupName string, serviceName string, privateLinkSubResourceName string, options *PrivateEndpointConnectionClientGetPrivateLinkResourceOptions) (PrivateEndpointConnectionClientGetPrivateLinkResourceResponse, error) { + var err error req, err := client.getPrivateLinkResourceCreateRequest(ctx, resourceGroupName, serviceName, privateLinkSubResourceName, options) if err != nil { return PrivateEndpointConnectionClientGetPrivateLinkResourceResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateEndpointConnectionClientGetPrivateLinkResourceResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionClientGetPrivateLinkResourceResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointConnectionClientGetPrivateLinkResourceResponse{}, err } - return client.getPrivateLinkResourceHandleResponse(resp) + resp, err := client.getPrivateLinkResourceHandleResponse(httpResp) + return resp, err } // getPrivateLinkResourceCreateRequest creates the GetPrivateLinkResource request. @@ -296,7 +309,7 @@ func (client *PrivateEndpointConnectionClient) getPrivateLinkResourceCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -313,8 +326,8 @@ func (client *PrivateEndpointConnectionClient) getPrivateLinkResourceHandleRespo // NewListByServicePager - Lists all private endpoint connections of the API Management service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - PrivateEndpointConnectionClientListByServiceOptions contains the optional parameters for the PrivateEndpointConnectionClient.NewListByServicePager // method. @@ -360,7 +373,7 @@ func (client *PrivateEndpointConnectionClient) listByServiceCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -378,24 +391,27 @@ func (client *PrivateEndpointConnectionClient) listByServiceHandleResponse(resp // ListPrivateLinkResources - Gets the private link resources // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - PrivateEndpointConnectionClientListPrivateLinkResourcesOptions contains the optional parameters for the PrivateEndpointConnectionClient.ListPrivateLinkResources // method. func (client *PrivateEndpointConnectionClient) ListPrivateLinkResources(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateEndpointConnectionClientListPrivateLinkResourcesOptions) (PrivateEndpointConnectionClientListPrivateLinkResourcesResponse, error) { + var err error req, err := client.listPrivateLinkResourcesCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return PrivateEndpointConnectionClientListPrivateLinkResourcesResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateEndpointConnectionClientListPrivateLinkResourcesResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionClientListPrivateLinkResourcesResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointConnectionClientListPrivateLinkResourcesResponse{}, err } - return client.listPrivateLinkResourcesHandleResponse(resp) + resp, err := client.listPrivateLinkResourcesHandleResponse(httpResp) + return resp, err } // listPrivateLinkResourcesCreateRequest creates the ListPrivateLinkResources request. @@ -418,7 +434,7 @@ func (client *PrivateEndpointConnectionClient) listPrivateLinkResourcesCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/privateendpointconnection_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/privateendpointconnection_client_example_test.go index 6867a03dd316..8b3cec43a6e0 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/privateendpointconnection_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/privateendpointconnection_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPrivateEndpointConnections.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListPrivateEndpointConnections.json func ExamplePrivateEndpointConnectionClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -78,7 +78,7 @@ func ExamplePrivateEndpointConnectionClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetPrivateEndpointConnection.json func ExamplePrivateEndpointConnectionClient_GetByName() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -114,7 +114,7 @@ func ExamplePrivateEndpointConnectionClient_GetByName() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementApproveOrRejectPrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementApproveOrRejectPrivateEndpointConnection.json func ExamplePrivateEndpointConnectionClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -161,7 +161,7 @@ func ExamplePrivateEndpointConnectionClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletePrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeletePrivateEndpointConnection.json func ExamplePrivateEndpointConnectionClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -182,7 +182,7 @@ func ExamplePrivateEndpointConnectionClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPrivateLinkGroupResources.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListPrivateLinkGroupResources.json func ExamplePrivateEndpointConnectionClient_ListPrivateLinkResources() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -217,7 +217,7 @@ func ExamplePrivateEndpointConnectionClient_ListPrivateLinkResources() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPrivateLinkGroupResource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetPrivateLinkGroupResource.json func ExamplePrivateEndpointConnectionClient_GetPrivateLinkResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/product_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/product_client.go index c5b0c829a973..3a5bf102e5dd 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/product_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/product_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type ProductClient struct { } // NewProductClient creates a new instance of ProductClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewProductClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductClient, error) { @@ -49,25 +47,28 @@ func NewProductClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates or Updates a product. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - parameters - Create or update parameters. // - options - ProductClientCreateOrUpdateOptions contains the optional parameters for the ProductClient.CreateOrUpdate method. func (client *ProductClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, parameters ProductContract, options *ProductClientCreateOrUpdateOptions) (ProductClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, productID, parameters, options) if err != nil { return ProductClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProductClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ProductClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ProductClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -94,13 +95,16 @@ func (client *ProductClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -118,24 +122,26 @@ func (client *ProductClient) createOrUpdateHandleResponse(resp *http.Response) ( // Delete - Delete product. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - options - ProductClientDeleteOptions contains the optional parameters for the ProductClient.Delete method. func (client *ProductClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, ifMatch string, options *ProductClientDeleteOptions) (ProductClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, productID, ifMatch, options) if err != nil { return ProductClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProductClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ProductClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ProductClientDeleteResponse{}, err } return ProductClientDeleteResponse{}, nil } @@ -167,7 +173,7 @@ func (client *ProductClient) deleteCreateRequest(ctx context.Context, resourceGr if options != nil && options.DeleteSubscriptions != nil { reqQP.Set("deleteSubscriptions", strconv.FormatBool(*options.DeleteSubscriptions)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -177,24 +183,27 @@ func (client *ProductClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets the details of the product specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - options - ProductClientGetOptions contains the optional parameters for the ProductClient.Get method. func (client *ProductClient) Get(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductClientGetOptions) (ProductClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, productID, options) if err != nil { return ProductClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProductClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProductClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProductClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -221,7 +230,7 @@ func (client *ProductClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -241,24 +250,27 @@ func (client *ProductClient) getHandleResponse(resp *http.Response) (ProductClie // GetEntityTag - Gets the entity state (Etag) version of the product specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - options - ProductClientGetEntityTagOptions contains the optional parameters for the ProductClient.GetEntityTag method. func (client *ProductClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductClientGetEntityTagOptions) (ProductClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, productID, options) if err != nil { return ProductClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProductClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProductClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProductClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -285,7 +297,7 @@ func (client *ProductClient) getEntityTagCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,8 +315,8 @@ func (client *ProductClient) getEntityTagHandleResponse(resp *http.Response) (Pr // NewListByServicePager - Lists a collection of products in the specified service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - ProductClientListByServiceOptions contains the optional parameters for the ProductClient.NewListByServicePager // method. @@ -371,7 +383,7 @@ func (client *ProductClient) listByServiceCreateRequest(ctx context.Context, res if options != nil && options.Tags != nil { reqQP.Set("tags", *options.Tags) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -388,8 +400,8 @@ func (client *ProductClient) listByServiceHandleResponse(resp *http.Response) (P // NewListByTagsPager - Lists a collection of products associated with tags. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - ProductClientListByTagsOptions contains the optional parameters for the ProductClient.NewListByTagsPager method. func (client *ProductClient) NewListByTagsPager(resourceGroupName string, serviceName string, options *ProductClientListByTagsOptions) *runtime.Pager[ProductClientListByTagsResponse] { @@ -452,7 +464,7 @@ func (client *ProductClient) listByTagsCreateRequest(ctx context.Context, resour if options != nil && options.IncludeNotTaggedProducts != nil { reqQP.Set("includeNotTaggedProducts", strconv.FormatBool(*options.IncludeNotTaggedProducts)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -470,8 +482,8 @@ func (client *ProductClient) listByTagsHandleResponse(resp *http.Response) (Prod // Update - Update existing product details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -479,18 +491,21 @@ func (client *ProductClient) listByTagsHandleResponse(resp *http.Response) (Prod // - parameters - Update parameters. // - options - ProductClientUpdateOptions contains the optional parameters for the ProductClient.Update method. func (client *ProductClient) Update(ctx context.Context, resourceGroupName string, serviceName string, productID string, ifMatch string, parameters ProductUpdateParameters, options *ProductClientUpdateOptions) (ProductClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, productID, ifMatch, parameters, options) if err != nil { return ProductClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProductClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProductClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProductClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -517,11 +532,14 @@ func (client *ProductClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/product_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/product_client_example_test.go index 23852fa30632..cede358f7aa2 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/product_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/product_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProducts.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListProducts.json func ExampleProductClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -90,7 +90,7 @@ func ExampleProductClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProduct.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadProduct.json func ExampleProductClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -107,7 +107,7 @@ func ExampleProductClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetProduct.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetProduct.json func ExampleProductClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -140,7 +140,7 @@ func ExampleProductClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProduct.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateProduct.json func ExampleProductClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -175,7 +175,7 @@ func ExampleProductClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateProduct.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateProduct.json func ExampleProductClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -212,7 +212,7 @@ func ExampleProductClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProduct.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteProduct.json func ExampleProductClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -229,7 +229,7 @@ func ExampleProductClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductsByTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListProductsByTags.json func ExampleProductClient_NewListByTagsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/productapi_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/productapi_client.go index 58331db5418f..dcc87805e0b5 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/productapi_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/productapi_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type ProductAPIClient struct { } // NewProductAPIClient creates a new instance of ProductAPIClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewProductAPIClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductAPIClient, error) { @@ -48,8 +46,8 @@ func NewProductAPIClient(subscriptionID string, credential azcore.TokenCredentia // CheckEntityExists - Checks that API entity specified by identifier is associated with the Product entity. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has @@ -57,18 +55,20 @@ func NewProductAPIClient(subscriptionID string, credential azcore.TokenCredentia // - options - ProductAPIClientCheckEntityExistsOptions contains the optional parameters for the ProductAPIClient.CheckEntityExists // method. func (client *ProductAPIClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, productID string, apiID string, options *ProductAPIClientCheckEntityExistsOptions) (ProductAPIClientCheckEntityExistsResponse, error) { + var err error req, err := client.checkEntityExistsCreateRequest(ctx, resourceGroupName, serviceName, productID, apiID, options) if err != nil { return ProductAPIClientCheckEntityExistsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProductAPIClientCheckEntityExistsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return ProductAPIClientCheckEntityExistsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ProductAPIClientCheckEntityExistsResponse{}, err } - return ProductAPIClientCheckEntityExistsResponse{Success: resp.StatusCode >= 200 && resp.StatusCode < 300}, nil + return ProductAPIClientCheckEntityExistsResponse{Success: httpResp.StatusCode >= 200 && httpResp.StatusCode < 300}, nil } // checkEntityExistsCreateRequest creates the CheckEntityExists request. @@ -99,7 +99,7 @@ func (client *ProductAPIClient) checkEntityExistsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,8 +108,8 @@ func (client *ProductAPIClient) checkEntityExistsCreateRequest(ctx context.Conte // CreateOrUpdate - Adds an API to the specified product. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has @@ -117,18 +117,21 @@ func (client *ProductAPIClient) checkEntityExistsCreateRequest(ctx context.Conte // - options - ProductAPIClientCreateOrUpdateOptions contains the optional parameters for the ProductAPIClient.CreateOrUpdate // method. func (client *ProductAPIClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, apiID string, options *ProductAPIClientCreateOrUpdateOptions) (ProductAPIClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, productID, apiID, options) if err != nil { return ProductAPIClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProductAPIClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ProductAPIClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ProductAPIClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -159,7 +162,7 @@ func (client *ProductAPIClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -177,24 +180,26 @@ func (client *ProductAPIClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes the specified API from the specified product. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. // - options - ProductAPIClientDeleteOptions contains the optional parameters for the ProductAPIClient.Delete method. func (client *ProductAPIClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, apiID string, options *ProductAPIClientDeleteOptions) (ProductAPIClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, productID, apiID, options) if err != nil { return ProductAPIClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProductAPIClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ProductAPIClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ProductAPIClientDeleteResponse{}, err } return ProductAPIClientDeleteResponse{}, nil } @@ -227,7 +232,7 @@ func (client *ProductAPIClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -235,8 +240,8 @@ func (client *ProductAPIClient) deleteCreateRequest(ctx context.Context, resourc // NewListByProductPager - Lists a collection of the APIs associated with a product. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - options - ProductAPIClientListByProductOptions contains the optional parameters for the ProductAPIClient.NewListByProductPager @@ -302,7 +307,7 @@ func (client *ProductAPIClient) listByProductCreateRequest(ctx context.Context, if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/productapi_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/productapi_client_example_test.go index 7771a8aa5143..cf020b8b9f1f 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/productapi_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/productapi_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductApis.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListProductApis.json func ExampleProductAPIClient_NewListByProductPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -64,7 +64,7 @@ func ExampleProductAPIClient_NewListByProductPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductApi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadProductApi.json func ExampleProductAPIClient_CheckEntityExists() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -81,7 +81,7 @@ func ExampleProductAPIClient_CheckEntityExists() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductApi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateProductApi.json func ExampleProductAPIClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -120,7 +120,7 @@ func ExampleProductAPIClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductApi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteProductApi.json func ExampleProductAPIClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/productgroup_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/productgroup_client.go index 7f4661af899d..8fdc59b98efb 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/productgroup_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/productgroup_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type ProductGroupClient struct { } // NewProductGroupClient creates a new instance of ProductGroupClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewProductGroupClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductGroupClient, error) { @@ -48,26 +46,28 @@ func NewProductGroupClient(subscriptionID string, credential azcore.TokenCredent // CheckEntityExists - Checks that Group entity specified by identifier is associated with the Product entity. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - groupID - Group identifier. Must be unique in the current API Management service instance. // - options - ProductGroupClientCheckEntityExistsOptions contains the optional parameters for the ProductGroupClient.CheckEntityExists // method. func (client *ProductGroupClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, productID string, groupID string, options *ProductGroupClientCheckEntityExistsOptions) (ProductGroupClientCheckEntityExistsResponse, error) { + var err error req, err := client.checkEntityExistsCreateRequest(ctx, resourceGroupName, serviceName, productID, groupID, options) if err != nil { return ProductGroupClientCheckEntityExistsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProductGroupClientCheckEntityExistsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return ProductGroupClientCheckEntityExistsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ProductGroupClientCheckEntityExistsResponse{}, err } - return ProductGroupClientCheckEntityExistsResponse{Success: resp.StatusCode >= 200 && resp.StatusCode < 300}, nil + return ProductGroupClientCheckEntityExistsResponse{Success: httpResp.StatusCode >= 200 && httpResp.StatusCode < 300}, nil } // checkEntityExistsCreateRequest creates the CheckEntityExists request. @@ -98,7 +98,7 @@ func (client *ProductGroupClient) checkEntityExistsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -107,26 +107,29 @@ func (client *ProductGroupClient) checkEntityExistsCreateRequest(ctx context.Con // CreateOrUpdate - Adds the association between the specified developer group with the specified product. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - groupID - Group identifier. Must be unique in the current API Management service instance. // - options - ProductGroupClientCreateOrUpdateOptions contains the optional parameters for the ProductGroupClient.CreateOrUpdate // method. func (client *ProductGroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, groupID string, options *ProductGroupClientCreateOrUpdateOptions) (ProductGroupClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, productID, groupID, options) if err != nil { return ProductGroupClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProductGroupClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ProductGroupClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ProductGroupClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -157,7 +160,7 @@ func (client *ProductGroupClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -175,23 +178,25 @@ func (client *ProductGroupClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Deletes the association between the specified group and product. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - groupID - Group identifier. Must be unique in the current API Management service instance. // - options - ProductGroupClientDeleteOptions contains the optional parameters for the ProductGroupClient.Delete method. func (client *ProductGroupClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, groupID string, options *ProductGroupClientDeleteOptions) (ProductGroupClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, productID, groupID, options) if err != nil { return ProductGroupClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProductGroupClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ProductGroupClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ProductGroupClientDeleteResponse{}, err } return ProductGroupClientDeleteResponse{}, nil } @@ -224,7 +229,7 @@ func (client *ProductGroupClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,8 +237,8 @@ func (client *ProductGroupClient) deleteCreateRequest(ctx context.Context, resou // NewListByProductPager - Lists the collection of developer groups associated with the specified product. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - options - ProductGroupClientListByProductOptions contains the optional parameters for the ProductGroupClient.NewListByProductPager @@ -299,7 +304,7 @@ func (client *ProductGroupClient) listByProductCreateRequest(ctx context.Context if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/productgroup_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/productgroup_client_example_test.go index 55e19ec6b89f..79aa3fc152e4 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/productgroup_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/productgroup_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductGroups.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListProductGroups.json func ExampleProductGroupClient_NewListByProductPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -82,7 +82,7 @@ func ExampleProductGroupClient_NewListByProductPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadProductGroup.json func ExampleProductGroupClient_CheckEntityExists() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -99,7 +99,7 @@ func ExampleProductGroupClient_CheckEntityExists() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateProductGroup.json func ExampleProductGroupClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -130,7 +130,7 @@ func ExampleProductGroupClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteProductGroup.json func ExampleProductGroupClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/productpolicy_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/productpolicy_client.go index 40396eb6c4ac..d169cdaa90f1 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/productpolicy_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/productpolicy_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type ProductPolicyClient struct { } // NewProductPolicyClient creates a new instance of ProductPolicyClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewProductPolicyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductPolicyClient, error) { @@ -48,8 +46,8 @@ func NewProductPolicyClient(subscriptionID string, credential azcore.TokenCreden // CreateOrUpdate - Creates or updates policy configuration for the Product. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - policyID - The identifier of the Policy. @@ -57,18 +55,21 @@ func NewProductPolicyClient(subscriptionID string, credential azcore.TokenCreden // - options - ProductPolicyClientCreateOrUpdateOptions contains the optional parameters for the ProductPolicyClient.CreateOrUpdate // method. func (client *ProductPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, policyID PolicyIDName, parameters PolicyContract, options *ProductPolicyClientCreateOrUpdateOptions) (ProductPolicyClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, productID, policyID, parameters, options) if err != nil { return ProductPolicyClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProductPolicyClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ProductPolicyClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ProductPolicyClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -99,13 +100,16 @@ func (client *ProductPolicyClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -123,8 +127,8 @@ func (client *ProductPolicyClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Deletes the policy configuration at the Product. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - policyID - The identifier of the Policy. @@ -132,16 +136,18 @@ func (client *ProductPolicyClient) createOrUpdateHandleResponse(resp *http.Respo // it should be * for unconditional update. // - options - ProductPolicyClientDeleteOptions contains the optional parameters for the ProductPolicyClient.Delete method. func (client *ProductPolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, policyID PolicyIDName, ifMatch string, options *ProductPolicyClientDeleteOptions) (ProductPolicyClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, productID, policyID, ifMatch, options) if err != nil { return ProductPolicyClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProductPolicyClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ProductPolicyClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ProductPolicyClientDeleteResponse{}, err } return ProductPolicyClientDeleteResponse{}, nil } @@ -174,7 +180,7 @@ func (client *ProductPolicyClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -184,25 +190,28 @@ func (client *ProductPolicyClient) deleteCreateRequest(ctx context.Context, reso // Get - Get the policy configuration at the Product level. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - policyID - The identifier of the Policy. // - options - ProductPolicyClientGetOptions contains the optional parameters for the ProductPolicyClient.Get method. func (client *ProductPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, productID string, policyID PolicyIDName, options *ProductPolicyClientGetOptions) (ProductPolicyClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, productID, policyID, options) if err != nil { return ProductPolicyClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProductPolicyClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProductPolicyClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProductPolicyClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -236,7 +245,7 @@ func (client *ProductPolicyClient) getCreateRequest(ctx context.Context, resourc if options != nil && options.Format != nil { reqQP.Set("format", string(*options.Format)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,26 +265,29 @@ func (client *ProductPolicyClient) getHandleResponse(resp *http.Response) (Produ // GetEntityTag - Get the ETag of the policy configuration at the Product level. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - policyID - The identifier of the Policy. // - options - ProductPolicyClientGetEntityTagOptions contains the optional parameters for the ProductPolicyClient.GetEntityTag // method. func (client *ProductPolicyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, productID string, policyID PolicyIDName, options *ProductPolicyClientGetEntityTagOptions) (ProductPolicyClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, productID, policyID, options) if err != nil { return ProductPolicyClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProductPolicyClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProductPolicyClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProductPolicyClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -306,7 +318,7 @@ func (client *ProductPolicyClient) getEntityTagCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,25 +337,28 @@ func (client *ProductPolicyClient) getEntityTagHandleResponse(resp *http.Respons // ListByProduct - Get the policy configuration at the Product level. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - options - ProductPolicyClientListByProductOptions contains the optional parameters for the ProductPolicyClient.ListByProduct // method. func (client *ProductPolicyClient) ListByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductPolicyClientListByProductOptions) (ProductPolicyClientListByProductResponse, error) { + var err error req, err := client.listByProductCreateRequest(ctx, resourceGroupName, serviceName, productID, options) if err != nil { return ProductPolicyClientListByProductResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProductPolicyClientListByProductResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProductPolicyClientListByProductResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProductPolicyClientListByProductResponse{}, err } - return client.listByProductHandleResponse(resp) + resp, err := client.listByProductHandleResponse(httpResp) + return resp, err } // listByProductCreateRequest creates the ListByProduct request. @@ -370,7 +385,7 @@ func (client *ProductPolicyClient) listByProductCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/productpolicy_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/productpolicy_client_example_test.go index e104a274b437..7764c61a3be6 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/productpolicy_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/productpolicy_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductPolicies.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListProductPolicies.json func ExampleProductPolicyClient_ListByProduct() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -50,7 +50,7 @@ func ExampleProductPolicyClient_ListByProduct() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadProductPolicy.json func ExampleProductPolicyClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -67,7 +67,7 @@ func ExampleProductPolicyClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetProductPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetProductPolicy.json func ExampleProductPolicyClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -95,7 +95,7 @@ func ExampleProductPolicyClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateProductPolicy.json func ExampleProductPolicyClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -128,7 +128,7 @@ func ExampleProductPolicyClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteProductPolicy.json func ExampleProductPolicyClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/productsubscriptions_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/productsubscriptions_client.go index b90c83351142..b657b64947cc 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/productsubscriptions_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/productsubscriptions_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type ProductSubscriptionsClient struct { } // NewProductSubscriptionsClient creates a new instance of ProductSubscriptionsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewProductSubscriptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductSubscriptionsClient, error) { @@ -48,8 +46,8 @@ func NewProductSubscriptionsClient(subscriptionID string, credential azcore.Toke // NewListPager - Lists the collection of subscriptions to the specified product. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - options - ProductSubscriptionsClientListOptions contains the optional parameters for the ProductSubscriptionsClient.NewListPager @@ -115,7 +113,7 @@ func (client *ProductSubscriptionsClient) listCreateRequest(ctx context.Context, if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/productsubscriptions_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/productsubscriptions_client_example_test.go index 60f59dee2f66..441208fc867f 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/productsubscriptions_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/productsubscriptions_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductSubscriptions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListProductSubscriptions.json func ExampleProductSubscriptionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/productwiki_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/productwiki_client.go new file mode 100644 index 000000000000..2ab12b306149 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/productwiki_client.go @@ -0,0 +1,387 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armapimanagement + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ProductWikiClient contains the methods for the ProductWiki group. +// Don't use this type directly, use NewProductWikiClient() instead. +type ProductWikiClient struct { + internal *arm.Client + subscriptionID string +} + +// NewProductWikiClient creates a new instance of ProductWikiClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewProductWikiClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductWikiClient, error) { + cl, err := arm.NewClient(moduleName+".ProductWikiClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ProductWikiClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates a new Wiki for a Product or updates an existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - parameters - Create parameters. +// - options - ProductWikiClientCreateOrUpdateOptions contains the optional parameters for the ProductWikiClient.CreateOrUpdate +// method. +func (client *ProductWikiClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, parameters WikiContract, options *ProductWikiClientCreateOrUpdateOptions) (ProductWikiClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, productID, parameters, options) + if err != nil { + return ProductWikiClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ProductWikiClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ProductWikiClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ProductWikiClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, productID string, parameters WikiContract, options *ProductWikiClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if productID == "" { + return nil, errors.New("parameter productID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{productId}", url.PathEscape(productID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ProductWikiClient) createOrUpdateHandleResponse(resp *http.Response) (ProductWikiClientCreateOrUpdateResponse, error) { + result := ProductWikiClientCreateOrUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.WikiContract); err != nil { + return ProductWikiClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes the specified Wiki from a Product. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - ProductWikiClientDeleteOptions contains the optional parameters for the ProductWikiClient.Delete method. +func (client *ProductWikiClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, ifMatch string, options *ProductWikiClientDeleteOptions) (ProductWikiClientDeleteResponse, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, productID, ifMatch, options) + if err != nil { + return ProductWikiClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ProductWikiClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ProductWikiClientDeleteResponse{}, err + } + return ProductWikiClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ProductWikiClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, productID string, ifMatch string, options *ProductWikiClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if productID == "" { + return nil, errors.New("parameter productID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{productId}", url.PathEscape(productID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the details of the Wiki for a Product specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - options - ProductWikiClientGetOptions contains the optional parameters for the ProductWikiClient.Get method. +func (client *ProductWikiClient) Get(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductWikiClientGetOptions) (ProductWikiClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, productID, options) + if err != nil { + return ProductWikiClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ProductWikiClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProductWikiClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ProductWikiClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductWikiClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if productID == "" { + return nil, errors.New("parameter productID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{productId}", url.PathEscape(productID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ProductWikiClient) getHandleResponse(resp *http.Response) (ProductWikiClientGetResponse, error) { + result := ProductWikiClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.WikiContract); err != nil { + return ProductWikiClientGetResponse{}, err + } + return result, nil +} + +// GetEntityTag - Gets the entity state (Etag) version of the Wiki for a Product specified by its identifier. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - options - ProductWikiClientGetEntityTagOptions contains the optional parameters for the ProductWikiClient.GetEntityTag +// method. +func (client *ProductWikiClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductWikiClientGetEntityTagOptions) (ProductWikiClientGetEntityTagResponse, error) { + var err error + req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, productID, options) + if err != nil { + return ProductWikiClientGetEntityTagResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ProductWikiClientGetEntityTagResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProductWikiClientGetEntityTagResponse{}, err + } + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err +} + +// getEntityTagCreateRequest creates the GetEntityTag request. +func (client *ProductWikiClient) getEntityTagCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductWikiClientGetEntityTagOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if productID == "" { + return nil, errors.New("parameter productID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{productId}", url.PathEscape(productID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getEntityTagHandleResponse handles the GetEntityTag response. +func (client *ProductWikiClient) getEntityTagHandleResponse(resp *http.Response) (ProductWikiClientGetEntityTagResponse, error) { + result := ProductWikiClientGetEntityTagResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + result.Success = resp.StatusCode >= 200 && resp.StatusCode < 300 + return result, nil +} + +// Update - Updates the details of the Wiki for a Product specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Wiki Update parameters. +// - options - ProductWikiClientUpdateOptions contains the optional parameters for the ProductWikiClient.Update method. +func (client *ProductWikiClient) Update(ctx context.Context, resourceGroupName string, serviceName string, productID string, ifMatch string, parameters WikiUpdateContract, options *ProductWikiClientUpdateOptions) (ProductWikiClientUpdateResponse, error) { + var err error + req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, productID, ifMatch, parameters, options) + if err != nil { + return ProductWikiClientUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ProductWikiClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProductWikiClientUpdateResponse{}, err + } + resp, err := client.updateHandleResponse(httpResp) + return resp, err +} + +// updateCreateRequest creates the Update request. +func (client *ProductWikiClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, productID string, ifMatch string, parameters WikiUpdateContract, options *ProductWikiClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if productID == "" { + return nil, errors.New("parameter productID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{productId}", url.PathEscape(productID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// updateHandleResponse handles the Update response. +func (client *ProductWikiClient) updateHandleResponse(resp *http.Response) (ProductWikiClientUpdateResponse, error) { + result := ProductWikiClientUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.WikiContract); err != nil { + return ProductWikiClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/productwiki_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/productwiki_client_example_test.go new file mode 100644 index 000000000000..70a9022160fe --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/productwiki_client_example_test.go @@ -0,0 +1,169 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadProductWiki.json +func ExampleProductWikiClient_GetEntityTag() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewProductWikiClient().GetEntityTag(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetProductWiki.json +func ExampleProductWikiClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewProductWikiClient().Get(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.WikiContract = armapimanagement.WikiContract{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.ApiManagement/service/products/wikis"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/57d1f7558aa04f15146d9d8a/wikis/default"), + // Properties: &armapimanagement.WikiContractProperties{ + // Documents: []*armapimanagement.WikiDocumentationContract{ + // { + // DocumentationID: to.Ptr("docId1"), + // }, + // { + // DocumentationID: to.Ptr("docId2"), + // }}, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateProductWiki.json +func ExampleProductWikiClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewProductWikiClient().CreateOrUpdate(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", armapimanagement.WikiContract{ + Properties: &armapimanagement.WikiContractProperties{ + Documents: []*armapimanagement.WikiDocumentationContract{ + { + DocumentationID: to.Ptr("docId1"), + }, + { + DocumentationID: to.Ptr("docId2"), + }}, + }, + }, &armapimanagement.ProductWikiClientCreateOrUpdateOptions{IfMatch: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.WikiContract = armapimanagement.WikiContract{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.ApiManagement/service/products/wikis"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/57d1f7558aa04f15146d9d8a/wikis/default"), + // Properties: &armapimanagement.WikiContractProperties{ + // Documents: []*armapimanagement.WikiDocumentationContract{ + // { + // DocumentationID: to.Ptr("docId1"), + // }, + // { + // DocumentationID: to.Ptr("docId2"), + // }}, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateProductWiki.json +func ExampleProductWikiClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewProductWikiClient().Update(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "*", armapimanagement.WikiUpdateContract{ + Properties: &armapimanagement.WikiContractProperties{ + Documents: []*armapimanagement.WikiDocumentationContract{ + { + DocumentationID: to.Ptr("docId1"), + }}, + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.WikiContract = armapimanagement.WikiContract{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.ApiManagement/service/products/wikis"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/57d1f7558aa04f15146d9d8a/wikis/default"), + // Properties: &armapimanagement.WikiContractProperties{ + // Documents: []*armapimanagement.WikiDocumentationContract{ + // { + // DocumentationID: to.Ptr("docId1"), + // }}, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteProductWiki.json +func ExampleProductWikiClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = clientFactory.NewProductWikiClient().Delete(ctx, "rg1", "apimService1", "57d1f7558aa04f15146d9d8a", "*", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/productwikis_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/productwikis_client.go new file mode 100644 index 000000000000..4bbc090fc0e4 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/productwikis_client.go @@ -0,0 +1,131 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armapimanagement + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// ProductWikisClient contains the methods for the ProductWikis group. +// Don't use this type directly, use NewProductWikisClient() instead. +type ProductWikisClient struct { + internal *arm.Client + subscriptionID string +} + +// NewProductWikisClient creates a new instance of ProductWikisClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewProductWikisClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductWikisClient, error) { + cl, err := arm.NewClient(moduleName+".ProductWikisClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ProductWikisClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Gets the details of the Wiki for a Product specified by its identifier. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - options - ProductWikisClientListOptions contains the optional parameters for the ProductWikisClient.NewListPager method. +func (client *ProductWikisClient) NewListPager(resourceGroupName string, serviceName string, productID string, options *ProductWikisClientListOptions) *runtime.Pager[ProductWikisClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ProductWikisClientListResponse]{ + More: func(page ProductWikisClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ProductWikisClientListResponse) (ProductWikisClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, productID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ProductWikisClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ProductWikisClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ProductWikisClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ProductWikisClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductWikisClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/wikis" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if productID == "" { + return nil, errors.New("parameter productID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{productId}", url.PathEscape(productID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + } + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ProductWikisClient) listHandleResponse(resp *http.Response) (ProductWikisClientListResponse, error) { + result := ProductWikisClientListResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.WikiCollection); err != nil { + return ProductWikisClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/productwikis_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/productwikis_client_example_test.go new file mode 100644 index 000000000000..0dd83ba6afb1 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/productwikis_client_example_test.go @@ -0,0 +1,63 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListProductWikis.json +func ExampleProductWikisClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewProductWikisClient().NewListPager("rg1", "apimService1", "57d1f7558aa04f15146d9d8a", &armapimanagement.ProductWikisClientListOptions{Filter: nil, + Top: nil, + Skip: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.WikiCollection = armapimanagement.WikiCollection{ + // Value: []*armapimanagement.WikiContract{ + // { + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.ApiManagement/service/products/wikis"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/57d1f7558aa04f15146d9d8a/wikis/default"), + // Properties: &armapimanagement.WikiContractProperties{ + // Documents: []*armapimanagement.WikiDocumentationContract{ + // { + // DocumentationID: to.Ptr("docId1"), + // }, + // { + // DocumentationID: to.Ptr("docId2"), + // }}, + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/quotabycounterkeys_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/quotabycounterkeys_client.go index c20cda83d625..dddb881248b6 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/quotabycounterkeys_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/quotabycounterkeys_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type QuotaByCounterKeysClient struct { } // NewQuotaByCounterKeysClient creates a new instance of QuotaByCounterKeysClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewQuotaByCounterKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QuotaByCounterKeysClient, error) { @@ -49,8 +47,8 @@ func NewQuotaByCounterKeysClient(subscriptionID string, credential azcore.TokenC // on the specified service instance. The api does not support paging yet. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - quotaCounterKey - Quota counter key identifier.This is the result of expression defined in counter-key attribute of the // quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s @@ -58,18 +56,21 @@ func NewQuotaByCounterKeysClient(subscriptionID string, credential azcore.TokenC // - options - QuotaByCounterKeysClientListByServiceOptions contains the optional parameters for the QuotaByCounterKeysClient.ListByService // method. func (client *QuotaByCounterKeysClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string, options *QuotaByCounterKeysClientListByServiceOptions) (QuotaByCounterKeysClientListByServiceResponse, error) { + var err error req, err := client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, quotaCounterKey, options) if err != nil { return QuotaByCounterKeysClientListByServiceResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return QuotaByCounterKeysClientListByServiceResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return QuotaByCounterKeysClientListByServiceResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return QuotaByCounterKeysClientListByServiceResponse{}, err } - return client.listByServiceHandleResponse(resp) + resp, err := client.listByServiceHandleResponse(httpResp) + return resp, err } // listByServiceCreateRequest creates the ListByService request. @@ -96,7 +97,7 @@ func (client *QuotaByCounterKeysClient) listByServiceCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,8 +116,8 @@ func (client *QuotaByCounterKeysClient) listByServiceHandleResponse(resp *http.R // service instance. This should be used for reset of the quota counter values. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - quotaCounterKey - Quota counter key identifier.This is the result of expression defined in counter-key attribute of the // quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s @@ -125,18 +126,21 @@ func (client *QuotaByCounterKeysClient) listByServiceHandleResponse(resp *http.R // - options - QuotaByCounterKeysClientUpdateOptions contains the optional parameters for the QuotaByCounterKeysClient.Update // method. func (client *QuotaByCounterKeysClient) Update(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string, parameters QuotaCounterValueUpdateContract, options *QuotaByCounterKeysClientUpdateOptions) (QuotaByCounterKeysClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, quotaCounterKey, parameters, options) if err != nil { return QuotaByCounterKeysClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return QuotaByCounterKeysClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return QuotaByCounterKeysClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return QuotaByCounterKeysClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -163,10 +167,13 @@ func (client *QuotaByCounterKeysClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/quotabycounterkeys_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/quotabycounterkeys_client_example_test.go index 895e4dd8d149..55ebe189999f 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/quotabycounterkeys_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/quotabycounterkeys_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetQuotaCounterKeys.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetQuotaCounterKeys.json func ExampleQuotaByCounterKeysClient_ListByService() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -51,7 +51,7 @@ func ExampleQuotaByCounterKeysClient_ListByService() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateQuotaCounterKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateQuotaCounterKey.json func ExampleQuotaByCounterKeysClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/quotabyperiodkeys_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/quotabyperiodkeys_client.go index 38ebc24c8081..7fa1c2cb0589 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/quotabyperiodkeys_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/quotabyperiodkeys_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type QuotaByPeriodKeysClient struct { } // NewQuotaByPeriodKeysClient creates a new instance of QuotaByPeriodKeysClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewQuotaByPeriodKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QuotaByPeriodKeysClient, error) { @@ -49,8 +47,8 @@ func NewQuotaByPeriodKeysClient(subscriptionID string, credential azcore.TokenCr // instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - quotaCounterKey - Quota counter key identifier.This is the result of expression defined in counter-key attribute of the // quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s @@ -58,18 +56,21 @@ func NewQuotaByPeriodKeysClient(subscriptionID string, credential azcore.TokenCr // - quotaPeriodKey - Quota period key identifier. // - options - QuotaByPeriodKeysClientGetOptions contains the optional parameters for the QuotaByPeriodKeysClient.Get method. func (client *QuotaByPeriodKeysClient) Get(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string, quotaPeriodKey string, options *QuotaByPeriodKeysClientGetOptions) (QuotaByPeriodKeysClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, quotaCounterKey, quotaPeriodKey, options) if err != nil { return QuotaByPeriodKeysClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return QuotaByPeriodKeysClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return QuotaByPeriodKeysClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return QuotaByPeriodKeysClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -100,7 +101,7 @@ func (client *QuotaByPeriodKeysClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -118,8 +119,8 @@ func (client *QuotaByPeriodKeysClient) getHandleResponse(resp *http.Response) (Q // Update - Updates an existing quota counter value in the specified service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - quotaCounterKey - Quota counter key identifier.This is the result of expression defined in counter-key attribute of the // quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s @@ -129,18 +130,21 @@ func (client *QuotaByPeriodKeysClient) getHandleResponse(resp *http.Response) (Q // - options - QuotaByPeriodKeysClientUpdateOptions contains the optional parameters for the QuotaByPeriodKeysClient.Update // method. func (client *QuotaByPeriodKeysClient) Update(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string, quotaPeriodKey string, parameters QuotaCounterValueUpdateContract, options *QuotaByPeriodKeysClientUpdateOptions) (QuotaByPeriodKeysClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, quotaCounterKey, quotaPeriodKey, parameters, options) if err != nil { return QuotaByPeriodKeysClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return QuotaByPeriodKeysClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return QuotaByPeriodKeysClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return QuotaByPeriodKeysClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -171,10 +175,13 @@ func (client *QuotaByPeriodKeysClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/quotabyperiodkeys_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/quotabyperiodkeys_client_example_test.go index fb2a34c535ff..0ce760d557c4 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/quotabyperiodkeys_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/quotabyperiodkeys_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetQuotaCounterKeysByQuotaPeriod.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetQuotaCounterKeysByQuotaPeriod.json func ExampleQuotaByPeriodKeysClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -48,7 +48,7 @@ func ExampleQuotaByPeriodKeysClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateQuotaCounterKeyByQuotaPeriod.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateQuotaCounterKeyByQuotaPeriod.json func ExampleQuotaByPeriodKeysClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/region_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/region_client.go index 325ff0efa0da..7e8126e88e88 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/region_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/region_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type RegionClient struct { } // NewRegionClient creates a new instance of RegionClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewRegionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegionClient, error) { @@ -47,8 +45,8 @@ func NewRegionClient(subscriptionID string, credential azcore.TokenCredential, o // NewListByServicePager - Lists all azure regions in which the service exists. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - RegionClientListByServiceOptions contains the optional parameters for the RegionClient.NewListByServicePager // method. @@ -100,7 +98,7 @@ func (client *RegionClient) listByServiceCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/region_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/region_client_example_test.go index 12546e3d0cc7..e5df019ad713 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/region_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/region_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListRegions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListRegions.json func ExampleRegionClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/reports_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/reports_client.go index b5bf31465f36..76ba4946d500 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/reports_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/reports_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type ReportsClient struct { } // NewReportsClient creates a new instance of ReportsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewReportsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReportsClient, error) { @@ -48,8 +46,8 @@ func NewReportsClient(subscriptionID string, credential azcore.TokenCredential, // NewListByAPIPager - Lists report records by API. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - filter - The filter to apply on the operation. // - options - ReportsClientListByAPIOptions contains the optional parameters for the ReportsClient.NewListByAPIPager method. @@ -111,7 +109,7 @@ func (client *ReportsClient) listByAPICreateRequest(ctx context.Context, resourc if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -128,8 +126,8 @@ func (client *ReportsClient) listByAPIHandleResponse(resp *http.Response) (Repor // NewListByGeoPager - Lists report records by geography. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - filter - | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -212,7 +210,7 @@ func (client *ReportsClient) listByGeoCreateRequest(ctx context.Context, resourc if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -229,8 +227,8 @@ func (client *ReportsClient) listByGeoHandleResponse(resp *http.Response) (Repor // NewListByOperationPager - Lists report records by API Operations. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - filter - | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -316,7 +314,7 @@ func (client *ReportsClient) listByOperationCreateRequest(ctx context.Context, r if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -333,8 +331,8 @@ func (client *ReportsClient) listByOperationHandleResponse(resp *http.Response) // NewListByProductPager - Lists report records by Product. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - filter - | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -418,7 +416,7 @@ func (client *ReportsClient) listByProductCreateRequest(ctx context.Context, res if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -435,8 +433,8 @@ func (client *ReportsClient) listByProductHandleResponse(resp *http.Response) (R // NewListByRequestPager - Lists report records by Request. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - filter - | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -498,7 +496,7 @@ func (client *ReportsClient) listByRequestCreateRequest(ctx context.Context, res if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -515,8 +513,8 @@ func (client *ReportsClient) listByRequestHandleResponse(resp *http.Response) (R // NewListBySubscriptionPager - Lists report records by subscription. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - filter - | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -600,7 +598,7 @@ func (client *ReportsClient) listBySubscriptionCreateRequest(ctx context.Context if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -617,8 +615,8 @@ func (client *ReportsClient) listBySubscriptionHandleResponse(resp *http.Respons // NewListByTimePager - Lists report records by Time. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - filter - | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -706,7 +704,7 @@ func (client *ReportsClient) listByTimeCreateRequest(ctx context.Context, resour reqQP.Set("$orderby", *options.Orderby) } reqQP.Set("interval", interval) - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -723,8 +721,8 @@ func (client *ReportsClient) listByTimeHandleResponse(resp *http.Response) (Repo // NewListByUserPager - Lists report records by User. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - filter - | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -809,7 +807,7 @@ func (client *ReportsClient) listByUserCreateRequest(ctx context.Context, resour if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/reports_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/reports_client_example_test.go index 1cb1d238282a..ae438f00f949 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/reports_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/reports_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByApi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetReportsByApi.json func ExampleReportsClient_NewListByAPIPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -85,7 +85,7 @@ func ExampleReportsClient_NewListByAPIPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByUser.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetReportsByUser.json func ExampleReportsClient_NewListByUserPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -171,7 +171,7 @@ func ExampleReportsClient_NewListByUserPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByOperation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetReportsByOperation.json func ExampleReportsClient_NewListByOperationPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -260,7 +260,7 @@ func ExampleReportsClient_NewListByOperationPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByProduct.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetReportsByProduct.json func ExampleReportsClient_NewListByProductPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -328,7 +328,7 @@ func ExampleReportsClient_NewListByProductPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByGeo.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetReportsByGeo.json func ExampleReportsClient_NewListByGeoPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -377,7 +377,7 @@ func ExampleReportsClient_NewListByGeoPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetReportsBySubscription.json func ExampleReportsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -469,7 +469,7 @@ func ExampleReportsClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByTime.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetReportsByTime.json func ExampleReportsClient_NewListByTimePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -537,7 +537,7 @@ func ExampleReportsClient_NewListByTimePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByRequest.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetReportsByRequest.json func ExampleReportsClient_NewListByRequestPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/response_types.go b/sdk/resourcemanager/apimanagement/armapimanagement/response_types.go index 4cd90d97a3b8..95f5584a911e 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/response_types.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/response_types.go @@ -3,14 +3,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement // APIClientCreateOrUpdateResponse contains the response from method APIClient.BeginCreateOrUpdate. type APIClientCreateOrUpdateResponse struct { + // API details. APIContract } @@ -30,31 +30,39 @@ type APIClientGetEntityTagResponse struct { // APIClientGetResponse contains the response from method APIClient.Get. type APIClientGetResponse struct { + // API details. APIContract + // ETag contains the information returned from the ETag header response. ETag *string } // APIClientListByServiceResponse contains the response from method APIClient.NewListByServicePager. type APIClientListByServiceResponse struct { + // Paged API list representation. APICollection } // APIClientListByTagsResponse contains the response from method APIClient.NewListByTagsPager. type APIClientListByTagsResponse struct { + // Paged Tag list representation. TagResourceCollection } // APIClientUpdateResponse contains the response from method APIClient.Update. type APIClientUpdateResponse struct { + // API details. APIContract + // ETag contains the information returned from the ETag header response. ETag *string } // APIDiagnosticClientCreateOrUpdateResponse contains the response from method APIDiagnosticClient.CreateOrUpdate. type APIDiagnosticClientCreateOrUpdateResponse struct { + // Diagnostic details. DiagnosticContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -75,31 +83,39 @@ type APIDiagnosticClientGetEntityTagResponse struct { // APIDiagnosticClientGetResponse contains the response from method APIDiagnosticClient.Get. type APIDiagnosticClientGetResponse struct { + // Diagnostic details. DiagnosticContract + // ETag contains the information returned from the ETag header response. ETag *string } // APIDiagnosticClientListByServiceResponse contains the response from method APIDiagnosticClient.NewListByServicePager. type APIDiagnosticClientListByServiceResponse struct { + // Paged Diagnostic list representation. DiagnosticCollection } // APIDiagnosticClientUpdateResponse contains the response from method APIDiagnosticClient.Update. type APIDiagnosticClientUpdateResponse struct { + // Diagnostic details. DiagnosticContract + // ETag contains the information returned from the ETag header response. ETag *string } // APIExportClientGetResponse contains the response from method APIExportClient.Get. type APIExportClientGetResponse struct { + // API Export result. APIExportResult } // APIIssueAttachmentClientCreateOrUpdateResponse contains the response from method APIIssueAttachmentClient.CreateOrUpdate. type APIIssueAttachmentClientCreateOrUpdateResponse struct { + // Issue Attachment Contract details. IssueAttachmentContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -120,19 +136,24 @@ type APIIssueAttachmentClientGetEntityTagResponse struct { // APIIssueAttachmentClientGetResponse contains the response from method APIIssueAttachmentClient.Get. type APIIssueAttachmentClientGetResponse struct { + // Issue Attachment Contract details. IssueAttachmentContract + // ETag contains the information returned from the ETag header response. ETag *string } // APIIssueAttachmentClientListByServiceResponse contains the response from method APIIssueAttachmentClient.NewListByServicePager. type APIIssueAttachmentClientListByServiceResponse struct { + // Paged Issue Attachment list representation. IssueAttachmentCollection } // APIIssueClientCreateOrUpdateResponse contains the response from method APIIssueClient.CreateOrUpdate. type APIIssueClientCreateOrUpdateResponse struct { + // Issue Contract details. IssueContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -153,26 +174,33 @@ type APIIssueClientGetEntityTagResponse struct { // APIIssueClientGetResponse contains the response from method APIIssueClient.Get. type APIIssueClientGetResponse struct { + // Issue Contract details. IssueContract + // ETag contains the information returned from the ETag header response. ETag *string } // APIIssueClientListByServiceResponse contains the response from method APIIssueClient.NewListByServicePager. type APIIssueClientListByServiceResponse struct { + // Paged Issue list representation. IssueCollection } // APIIssueClientUpdateResponse contains the response from method APIIssueClient.Update. type APIIssueClientUpdateResponse struct { + // Issue Contract details. IssueContract + // ETag contains the information returned from the ETag header response. ETag *string } // APIIssueCommentClientCreateOrUpdateResponse contains the response from method APIIssueCommentClient.CreateOrUpdate. type APIIssueCommentClientCreateOrUpdateResponse struct { + // Issue Comment Contract details. IssueCommentContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -193,19 +221,24 @@ type APIIssueCommentClientGetEntityTagResponse struct { // APIIssueCommentClientGetResponse contains the response from method APIIssueCommentClient.Get. type APIIssueCommentClientGetResponse struct { + // Issue Comment Contract details. IssueCommentContract + // ETag contains the information returned from the ETag header response. ETag *string } // APIIssueCommentClientListByServiceResponse contains the response from method APIIssueCommentClient.NewListByServicePager. type APIIssueCommentClientListByServiceResponse struct { + // Paged Issue Comment list representation. IssueCommentCollection } // APIOperationClientCreateOrUpdateResponse contains the response from method APIOperationClient.CreateOrUpdate. type APIOperationClientCreateOrUpdateResponse struct { + // API Operation details. OperationContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -226,26 +259,33 @@ type APIOperationClientGetEntityTagResponse struct { // APIOperationClientGetResponse contains the response from method APIOperationClient.Get. type APIOperationClientGetResponse struct { + // API Operation details. OperationContract + // ETag contains the information returned from the ETag header response. ETag *string } // APIOperationClientListByAPIResponse contains the response from method APIOperationClient.NewListByAPIPager. type APIOperationClientListByAPIResponse struct { + // Paged Operation list representation. OperationCollection } // APIOperationClientUpdateResponse contains the response from method APIOperationClient.Update. type APIOperationClientUpdateResponse struct { + // API Operation details. OperationContract + // ETag contains the information returned from the ETag header response. ETag *string } // APIOperationPolicyClientCreateOrUpdateResponse contains the response from method APIOperationPolicyClient.CreateOrUpdate. type APIOperationPolicyClientCreateOrUpdateResponse struct { + // Policy Contract details. PolicyContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -266,19 +306,24 @@ type APIOperationPolicyClientGetEntityTagResponse struct { // APIOperationPolicyClientGetResponse contains the response from method APIOperationPolicyClient.Get. type APIOperationPolicyClientGetResponse struct { + // Policy Contract details. PolicyContract + // ETag contains the information returned from the ETag header response. ETag *string } // APIOperationPolicyClientListByOperationResponse contains the response from method APIOperationPolicyClient.ListByOperation. type APIOperationPolicyClientListByOperationResponse struct { + // The response of the list policy operation. PolicyCollection } // APIPolicyClientCreateOrUpdateResponse contains the response from method APIPolicyClient.CreateOrUpdate. type APIPolicyClientCreateOrUpdateResponse struct { + // Policy Contract details. PolicyContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -299,24 +344,30 @@ type APIPolicyClientGetEntityTagResponse struct { // APIPolicyClientGetResponse contains the response from method APIPolicyClient.Get. type APIPolicyClientGetResponse struct { + // Policy Contract details. PolicyContract + // ETag contains the information returned from the ETag header response. ETag *string } // APIPolicyClientListByAPIResponse contains the response from method APIPolicyClient.ListByAPI. type APIPolicyClientListByAPIResponse struct { + // The response of the list policy operation. PolicyCollection } // APIProductClientListByApisResponse contains the response from method APIProductClient.NewListByApisPager. type APIProductClientListByApisResponse struct { + // Paged Products list representation. ProductCollection } // APIReleaseClientCreateOrUpdateResponse contains the response from method APIReleaseClient.CreateOrUpdate. type APIReleaseClientCreateOrUpdateResponse struct { + // ApiRelease details. APIReleaseContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -337,30 +388,37 @@ type APIReleaseClientGetEntityTagResponse struct { // APIReleaseClientGetResponse contains the response from method APIReleaseClient.Get. type APIReleaseClientGetResponse struct { + // ApiRelease details. APIReleaseContract + // ETag contains the information returned from the ETag header response. ETag *string } // APIReleaseClientListByServiceResponse contains the response from method APIReleaseClient.NewListByServicePager. type APIReleaseClientListByServiceResponse struct { + // Paged ApiRelease list representation. APIReleaseCollection } // APIReleaseClientUpdateResponse contains the response from method APIReleaseClient.Update. type APIReleaseClientUpdateResponse struct { + // ApiRelease details. APIReleaseContract + // ETag contains the information returned from the ETag header response. ETag *string } // APIRevisionClientListByServiceResponse contains the response from method APIRevisionClient.NewListByServicePager. type APIRevisionClientListByServiceResponse struct { + // Paged API Revision list representation. APIRevisionCollection } // APISchemaClientCreateOrUpdateResponse contains the response from method APISchemaClient.BeginCreateOrUpdate. type APISchemaClientCreateOrUpdateResponse struct { + // API Schema Contract details. SchemaContract } @@ -380,19 +438,24 @@ type APISchemaClientGetEntityTagResponse struct { // APISchemaClientGetResponse contains the response from method APISchemaClient.Get. type APISchemaClientGetResponse struct { + // API Schema Contract details. SchemaContract + // ETag contains the information returned from the ETag header response. ETag *string } // APISchemaClientListByAPIResponse contains the response from method APISchemaClient.NewListByAPIPager. type APISchemaClientListByAPIResponse struct { + // The response of the list schema operation. SchemaCollection } // APITagDescriptionClientCreateOrUpdateResponse contains the response from method APITagDescriptionClient.CreateOrUpdate. type APITagDescriptionClientCreateOrUpdateResponse struct { + // Contract details. TagDescriptionContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -413,19 +476,24 @@ type APITagDescriptionClientGetEntityTagResponse struct { // APITagDescriptionClientGetResponse contains the response from method APITagDescriptionClient.Get. type APITagDescriptionClientGetResponse struct { + // Contract details. TagDescriptionContract + // ETag contains the information returned from the ETag header response. ETag *string } // APITagDescriptionClientListByServiceResponse contains the response from method APITagDescriptionClient.NewListByServicePager. type APITagDescriptionClientListByServiceResponse struct { + // Paged TagDescription list representation. TagDescriptionCollection } // APIVersionSetClientCreateOrUpdateResponse contains the response from method APIVersionSetClient.CreateOrUpdate. type APIVersionSetClientCreateOrUpdateResponse struct { + // API Version Set Contract details. APIVersionSetContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -446,26 +514,182 @@ type APIVersionSetClientGetEntityTagResponse struct { // APIVersionSetClientGetResponse contains the response from method APIVersionSetClient.Get. type APIVersionSetClientGetResponse struct { + // API Version Set Contract details. APIVersionSetContract + // ETag contains the information returned from the ETag header response. ETag *string } // APIVersionSetClientListByServiceResponse contains the response from method APIVersionSetClient.NewListByServicePager. type APIVersionSetClientListByServiceResponse struct { + // Paged API Version Set list representation. APIVersionSetCollection } // APIVersionSetClientUpdateResponse contains the response from method APIVersionSetClient.Update. type APIVersionSetClientUpdateResponse struct { + // API Version Set Contract details. APIVersionSetContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// APIWikiClientCreateOrUpdateResponse contains the response from method APIWikiClient.CreateOrUpdate. +type APIWikiClientCreateOrUpdateResponse struct { + // Wiki properties + WikiContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// APIWikiClientDeleteResponse contains the response from method APIWikiClient.Delete. +type APIWikiClientDeleteResponse struct { + // placeholder for future response values +} + +// APIWikiClientGetEntityTagResponse contains the response from method APIWikiClient.GetEntityTag. +type APIWikiClientGetEntityTagResponse struct { + // ETag contains the information returned from the ETag header response. + ETag *string + + // Success indicates if the operation succeeded or failed. + Success bool +} + +// APIWikiClientGetResponse contains the response from method APIWikiClient.Get. +type APIWikiClientGetResponse struct { + // Wiki properties + WikiContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// APIWikiClientUpdateResponse contains the response from method APIWikiClient.Update. +type APIWikiClientUpdateResponse struct { + // Wiki properties + WikiContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// APIWikisClientListResponse contains the response from method APIWikisClient.NewListPager. +type APIWikisClientListResponse struct { + // Paged Wiki list representation. + WikiCollection +} + +// AuthorizationAccessPolicyClientCreateOrUpdateResponse contains the response from method AuthorizationAccessPolicyClient.CreateOrUpdate. +type AuthorizationAccessPolicyClientCreateOrUpdateResponse struct { + // Authorization access policy contract. + AuthorizationAccessPolicyContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// AuthorizationAccessPolicyClientDeleteResponse contains the response from method AuthorizationAccessPolicyClient.Delete. +type AuthorizationAccessPolicyClientDeleteResponse struct { + // placeholder for future response values +} + +// AuthorizationAccessPolicyClientGetResponse contains the response from method AuthorizationAccessPolicyClient.Get. +type AuthorizationAccessPolicyClientGetResponse struct { + // Authorization access policy contract. + AuthorizationAccessPolicyContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// AuthorizationAccessPolicyClientListByAuthorizationResponse contains the response from method AuthorizationAccessPolicyClient.NewListByAuthorizationPager. +type AuthorizationAccessPolicyClientListByAuthorizationResponse struct { + // Paged Authorization Access Policy list representation. + AuthorizationAccessPolicyCollection +} + +// AuthorizationClientConfirmConsentCodeResponse contains the response from method AuthorizationClient.ConfirmConsentCode. +type AuthorizationClientConfirmConsentCodeResponse struct { + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// AuthorizationClientCreateOrUpdateResponse contains the response from method AuthorizationClient.CreateOrUpdate. +type AuthorizationClientCreateOrUpdateResponse struct { + // Authorization contract. + AuthorizationContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// AuthorizationClientDeleteResponse contains the response from method AuthorizationClient.Delete. +type AuthorizationClientDeleteResponse struct { + // placeholder for future response values +} + +// AuthorizationClientGetResponse contains the response from method AuthorizationClient.Get. +type AuthorizationClientGetResponse struct { + // Authorization contract. + AuthorizationContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// AuthorizationClientListByAuthorizationProviderResponse contains the response from method AuthorizationClient.NewListByAuthorizationProviderPager. +type AuthorizationClientListByAuthorizationProviderResponse struct { + // Paged Authorization list representation. + AuthorizationCollection +} + +// AuthorizationLoginLinksClientPostResponse contains the response from method AuthorizationLoginLinksClient.Post. +type AuthorizationLoginLinksClientPostResponse struct { + // Authorization login response contract. + AuthorizationLoginResponseContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// AuthorizationProviderClientCreateOrUpdateResponse contains the response from method AuthorizationProviderClient.CreateOrUpdate. +type AuthorizationProviderClientCreateOrUpdateResponse struct { + // Authorization Provider contract. + AuthorizationProviderContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// AuthorizationProviderClientDeleteResponse contains the response from method AuthorizationProviderClient.Delete. +type AuthorizationProviderClientDeleteResponse struct { + // placeholder for future response values +} + +// AuthorizationProviderClientGetResponse contains the response from method AuthorizationProviderClient.Get. +type AuthorizationProviderClientGetResponse struct { + // Authorization Provider contract. + AuthorizationProviderContract + // ETag contains the information returned from the ETag header response. ETag *string } +// AuthorizationProviderClientListByServiceResponse contains the response from method AuthorizationProviderClient.NewListByServicePager. +type AuthorizationProviderClientListByServiceResponse struct { + // Paged Authorization Provider list representation. + AuthorizationProviderCollection +} + // AuthorizationServerClientCreateOrUpdateResponse contains the response from method AuthorizationServerClient.CreateOrUpdate. type AuthorizationServerClientCreateOrUpdateResponse struct { + // External OAuth authorization server settings. AuthorizationServerContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -486,33 +710,42 @@ type AuthorizationServerClientGetEntityTagResponse struct { // AuthorizationServerClientGetResponse contains the response from method AuthorizationServerClient.Get. type AuthorizationServerClientGetResponse struct { + // External OAuth authorization server settings. AuthorizationServerContract + // ETag contains the information returned from the ETag header response. ETag *string } // AuthorizationServerClientListByServiceResponse contains the response from method AuthorizationServerClient.NewListByServicePager. type AuthorizationServerClientListByServiceResponse struct { + // Paged OAuth2 Authorization Servers list representation. AuthorizationServerCollection } // AuthorizationServerClientListSecretsResponse contains the response from method AuthorizationServerClient.ListSecrets. type AuthorizationServerClientListSecretsResponse struct { + // OAuth Server Secrets Contract. AuthorizationServerSecretsContract + // ETag contains the information returned from the ETag header response. ETag *string } // AuthorizationServerClientUpdateResponse contains the response from method AuthorizationServerClient.Update. type AuthorizationServerClientUpdateResponse struct { + // External OAuth authorization server settings. AuthorizationServerContract + // ETag contains the information returned from the ETag header response. ETag *string } // BackendClientCreateOrUpdateResponse contains the response from method BackendClient.CreateOrUpdate. type BackendClientCreateOrUpdateResponse struct { + // Backend details. BackendContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -533,13 +766,16 @@ type BackendClientGetEntityTagResponse struct { // BackendClientGetResponse contains the response from method BackendClient.Get. type BackendClientGetResponse struct { + // Backend details. BackendContract + // ETag contains the information returned from the ETag header response. ETag *string } // BackendClientListByServiceResponse contains the response from method BackendClient.NewListByServicePager. type BackendClientListByServiceResponse struct { + // Paged Backend list representation. BackendCollection } @@ -550,14 +786,18 @@ type BackendClientReconnectResponse struct { // BackendClientUpdateResponse contains the response from method BackendClient.Update. type BackendClientUpdateResponse struct { + // Backend details. BackendContract + // ETag contains the information returned from the ETag header response. ETag *string } // CacheClientCreateOrUpdateResponse contains the response from method CacheClient.CreateOrUpdate. type CacheClientCreateOrUpdateResponse struct { + // Cache details. CacheContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -578,26 +818,33 @@ type CacheClientGetEntityTagResponse struct { // CacheClientGetResponse contains the response from method CacheClient.Get. type CacheClientGetResponse struct { + // Cache details. CacheContract + // ETag contains the information returned from the ETag header response. ETag *string } // CacheClientListByServiceResponse contains the response from method CacheClient.NewListByServicePager. type CacheClientListByServiceResponse struct { + // Paged Caches list representation. CacheCollection } // CacheClientUpdateResponse contains the response from method CacheClient.Update. type CacheClientUpdateResponse struct { + // Cache details. CacheContract + // ETag contains the information returned from the ETag header response. ETag *string } // CertificateClientCreateOrUpdateResponse contains the response from method CertificateClient.CreateOrUpdate. type CertificateClientCreateOrUpdateResponse struct { + // Certificate details. CertificateContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -618,31 +865,39 @@ type CertificateClientGetEntityTagResponse struct { // CertificateClientGetResponse contains the response from method CertificateClient.Get. type CertificateClientGetResponse struct { + // Certificate details. CertificateContract + // ETag contains the information returned from the ETag header response. ETag *string } // CertificateClientListByServiceResponse contains the response from method CertificateClient.NewListByServicePager. type CertificateClientListByServiceResponse struct { + // Paged Certificates list representation. CertificateCollection } // CertificateClientRefreshSecretResponse contains the response from method CertificateClient.RefreshSecret. type CertificateClientRefreshSecretResponse struct { + // Certificate details. CertificateContract + // ETag contains the information returned from the ETag header response. ETag *string } // ClientPerformConnectivityCheckAsyncResponse contains the response from method Client.BeginPerformConnectivityCheckAsync. type ClientPerformConnectivityCheckAsyncResponse struct { + // Information on the connectivity status. ConnectivityCheckResponse } // ContentItemClientCreateOrUpdateResponse contains the response from method ContentItemClient.CreateOrUpdate. type ContentItemClientCreateOrUpdateResponse struct { + // Content type contract details. ContentItemContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -663,19 +918,24 @@ type ContentItemClientGetEntityTagResponse struct { // ContentItemClientGetResponse contains the response from method ContentItemClient.Get. type ContentItemClientGetResponse struct { + // Content type contract details. ContentItemContract + // ETag contains the information returned from the ETag header response. ETag *string } // ContentItemClientListByServiceResponse contains the response from method ContentItemClient.NewListByServicePager. type ContentItemClientListByServiceResponse struct { + // Paged list of content items. ContentItemCollection } // ContentTypeClientCreateOrUpdateResponse contains the response from method ContentTypeClient.CreateOrUpdate. type ContentTypeClientCreateOrUpdateResponse struct { + // Content type contract details. ContentTypeContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -687,18 +947,22 @@ type ContentTypeClientDeleteResponse struct { // ContentTypeClientGetResponse contains the response from method ContentTypeClient.Get. type ContentTypeClientGetResponse struct { + // Content type contract details. ContentTypeContract + // ETag contains the information returned from the ETag header response. ETag *string } // ContentTypeClientListByServiceResponse contains the response from method ContentTypeClient.NewListByServicePager. type ContentTypeClientListByServiceResponse struct { + // Paged list of content types. ContentTypeCollection } // DelegationSettingsClientCreateOrUpdateResponse contains the response from method DelegationSettingsClient.CreateOrUpdate. type DelegationSettingsClientCreateOrUpdateResponse struct { + // Delegation settings for a developer portal. PortalDelegationSettings } @@ -713,13 +977,16 @@ type DelegationSettingsClientGetEntityTagResponse struct { // DelegationSettingsClientGetResponse contains the response from method DelegationSettingsClient.Get. type DelegationSettingsClientGetResponse struct { + // Delegation settings for a developer portal. PortalDelegationSettings + // ETag contains the information returned from the ETag header response. ETag *string } // DelegationSettingsClientListSecretsResponse contains the response from method DelegationSettingsClient.ListSecrets. type DelegationSettingsClientListSecretsResponse struct { + // Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. PortalSettingValidationKeyContract } @@ -730,22 +997,27 @@ type DelegationSettingsClientUpdateResponse struct { // DeletedServicesClientGetByNameResponse contains the response from method DeletedServicesClient.GetByName. type DeletedServicesClientGetByNameResponse struct { + // Deleted API Management Service information. DeletedServiceContract } // DeletedServicesClientListBySubscriptionResponse contains the response from method DeletedServicesClient.NewListBySubscriptionPager. type DeletedServicesClientListBySubscriptionResponse struct { + // Paged deleted API Management Services List Representation. DeletedServicesCollection } // DeletedServicesClientPurgeResponse contains the response from method DeletedServicesClient.BeginPurge. type DeletedServicesClientPurgeResponse struct { + // Deleted API Management Service information. DeletedServiceContract } // DiagnosticClientCreateOrUpdateResponse contains the response from method DiagnosticClient.CreateOrUpdate. type DiagnosticClientCreateOrUpdateResponse struct { + // Diagnostic details. DiagnosticContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -766,25 +1038,78 @@ type DiagnosticClientGetEntityTagResponse struct { // DiagnosticClientGetResponse contains the response from method DiagnosticClient.Get. type DiagnosticClientGetResponse struct { + // Diagnostic details. DiagnosticContract + // ETag contains the information returned from the ETag header response. ETag *string } // DiagnosticClientListByServiceResponse contains the response from method DiagnosticClient.NewListByServicePager. type DiagnosticClientListByServiceResponse struct { + // Paged Diagnostic list representation. DiagnosticCollection } // DiagnosticClientUpdateResponse contains the response from method DiagnosticClient.Update. type DiagnosticClientUpdateResponse struct { + // Diagnostic details. DiagnosticContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// DocumentationClientCreateOrUpdateResponse contains the response from method DocumentationClient.CreateOrUpdate. +type DocumentationClientCreateOrUpdateResponse struct { + // Markdown documentation details. + DocumentationContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// DocumentationClientDeleteResponse contains the response from method DocumentationClient.Delete. +type DocumentationClientDeleteResponse struct { + // placeholder for future response values +} + +// DocumentationClientGetEntityTagResponse contains the response from method DocumentationClient.GetEntityTag. +type DocumentationClientGetEntityTagResponse struct { + // ETag contains the information returned from the ETag header response. + ETag *string + + // Success indicates if the operation succeeded or failed. + Success bool +} + +// DocumentationClientGetResponse contains the response from method DocumentationClient.Get. +type DocumentationClientGetResponse struct { + // Markdown documentation details. + DocumentationContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// DocumentationClientListByServiceResponse contains the response from method DocumentationClient.NewListByServicePager. +type DocumentationClientListByServiceResponse struct { + // Paged Documentation list representation. + DocumentationCollection +} + +// DocumentationClientUpdateResponse contains the response from method DocumentationClient.Update. +type DocumentationClientUpdateResponse struct { + // Markdown documentation details. + DocumentationContract + // ETag contains the information returned from the ETag header response. ETag *string } // EmailTemplateClientCreateOrUpdateResponse contains the response from method EmailTemplateClient.CreateOrUpdate. type EmailTemplateClientCreateOrUpdateResponse struct { + // Email Template details. EmailTemplateContract } @@ -804,25 +1129,31 @@ type EmailTemplateClientGetEntityTagResponse struct { // EmailTemplateClientGetResponse contains the response from method EmailTemplateClient.Get. type EmailTemplateClientGetResponse struct { + // Email Template details. EmailTemplateContract + // ETag contains the information returned from the ETag header response. ETag *string } // EmailTemplateClientListByServiceResponse contains the response from method EmailTemplateClient.NewListByServicePager. type EmailTemplateClientListByServiceResponse struct { + // Paged email template list representation. EmailTemplateCollection } // EmailTemplateClientUpdateResponse contains the response from method EmailTemplateClient.Update. type EmailTemplateClientUpdateResponse struct { + // Email Template details. EmailTemplateContract + // ETag contains the information returned from the ETag header response. ETag *string } // GatewayAPIClientCreateOrUpdateResponse contains the response from method GatewayAPIClient.CreateOrUpdate. type GatewayAPIClientCreateOrUpdateResponse struct { + // API details. APIContract } @@ -842,12 +1173,15 @@ type GatewayAPIClientGetEntityTagResponse struct { // GatewayAPIClientListByServiceResponse contains the response from method GatewayAPIClient.NewListByServicePager. type GatewayAPIClientListByServiceResponse struct { + // Paged API list representation. APICollection } // GatewayCertificateAuthorityClientCreateOrUpdateResponse contains the response from method GatewayCertificateAuthorityClient.CreateOrUpdate. type GatewayCertificateAuthorityClientCreateOrUpdateResponse struct { + // Gateway certificate authority details. GatewayCertificateAuthorityContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -868,19 +1202,24 @@ type GatewayCertificateAuthorityClientGetEntityTagResponse struct { // GatewayCertificateAuthorityClientGetResponse contains the response from method GatewayCertificateAuthorityClient.Get. type GatewayCertificateAuthorityClientGetResponse struct { + // Gateway certificate authority details. GatewayCertificateAuthorityContract + // ETag contains the information returned from the ETag header response. ETag *string } // GatewayCertificateAuthorityClientListByServiceResponse contains the response from method GatewayCertificateAuthorityClient.NewListByServicePager. type GatewayCertificateAuthorityClientListByServiceResponse struct { + // Paged Gateway certificate authority list representation. GatewayCertificateAuthorityCollection } // GatewayClientCreateOrUpdateResponse contains the response from method GatewayClient.CreateOrUpdate. type GatewayClientCreateOrUpdateResponse struct { + // Gateway details. GatewayContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -892,6 +1231,7 @@ type GatewayClientDeleteResponse struct { // GatewayClientGenerateTokenResponse contains the response from method GatewayClient.GenerateToken. type GatewayClientGenerateTokenResponse struct { + // Gateway access token. GatewayTokenContract } @@ -906,19 +1246,24 @@ type GatewayClientGetEntityTagResponse struct { // GatewayClientGetResponse contains the response from method GatewayClient.Get. type GatewayClientGetResponse struct { + // Gateway details. GatewayContract + // ETag contains the information returned from the ETag header response. ETag *string } // GatewayClientListByServiceResponse contains the response from method GatewayClient.NewListByServicePager. type GatewayClientListByServiceResponse struct { + // Paged Gateway list representation. GatewayCollection } // GatewayClientListKeysResponse contains the response from method GatewayClient.ListKeys. type GatewayClientListKeysResponse struct { + // Gateway authentication keys. GatewayKeysContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -930,14 +1275,18 @@ type GatewayClientRegenerateKeyResponse struct { // GatewayClientUpdateResponse contains the response from method GatewayClient.Update. type GatewayClientUpdateResponse struct { + // Gateway details. GatewayContract + // ETag contains the information returned from the ETag header response. ETag *string } // GatewayHostnameConfigurationClientCreateOrUpdateResponse contains the response from method GatewayHostnameConfigurationClient.CreateOrUpdate. type GatewayHostnameConfigurationClientCreateOrUpdateResponse struct { + // Gateway hostname configuration details. GatewayHostnameConfigurationContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -958,18 +1307,22 @@ type GatewayHostnameConfigurationClientGetEntityTagResponse struct { // GatewayHostnameConfigurationClientGetResponse contains the response from method GatewayHostnameConfigurationClient.Get. type GatewayHostnameConfigurationClientGetResponse struct { + // Gateway hostname configuration details. GatewayHostnameConfigurationContract + // ETag contains the information returned from the ETag header response. ETag *string } // GatewayHostnameConfigurationClientListByServiceResponse contains the response from method GatewayHostnameConfigurationClient.NewListByServicePager. type GatewayHostnameConfigurationClientListByServiceResponse struct { + // Paged Gateway hostname configuration list representation. GatewayHostnameConfigurationCollection } // GlobalSchemaClientCreateOrUpdateResponse contains the response from method GlobalSchemaClient.BeginCreateOrUpdate. type GlobalSchemaClientCreateOrUpdateResponse struct { + // Global Schema Contract details. GlobalSchemaContract } @@ -989,19 +1342,109 @@ type GlobalSchemaClientGetEntityTagResponse struct { // GlobalSchemaClientGetResponse contains the response from method GlobalSchemaClient.Get. type GlobalSchemaClientGetResponse struct { + // Global Schema Contract details. GlobalSchemaContract + // ETag contains the information returned from the ETag header response. ETag *string } // GlobalSchemaClientListByServiceResponse contains the response from method GlobalSchemaClient.NewListByServicePager. type GlobalSchemaClientListByServiceResponse struct { + // The response of the list schema operation. GlobalSchemaCollection } +// GraphQLAPIResolverClientCreateOrUpdateResponse contains the response from method GraphQLAPIResolverClient.CreateOrUpdate. +type GraphQLAPIResolverClientCreateOrUpdateResponse struct { + // GraphQL API Resolver details. + ResolverContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// GraphQLAPIResolverClientDeleteResponse contains the response from method GraphQLAPIResolverClient.Delete. +type GraphQLAPIResolverClientDeleteResponse struct { + // placeholder for future response values +} + +// GraphQLAPIResolverClientGetEntityTagResponse contains the response from method GraphQLAPIResolverClient.GetEntityTag. +type GraphQLAPIResolverClientGetEntityTagResponse struct { + // ETag contains the information returned from the ETag header response. + ETag *string + + // Success indicates if the operation succeeded or failed. + Success bool +} + +// GraphQLAPIResolverClientGetResponse contains the response from method GraphQLAPIResolverClient.Get. +type GraphQLAPIResolverClientGetResponse struct { + // GraphQL API Resolver details. + ResolverContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// GraphQLAPIResolverClientListByAPIResponse contains the response from method GraphQLAPIResolverClient.NewListByAPIPager. +type GraphQLAPIResolverClientListByAPIResponse struct { + // Paged Resolver list representation. + ResolverCollection +} + +// GraphQLAPIResolverClientUpdateResponse contains the response from method GraphQLAPIResolverClient.Update. +type GraphQLAPIResolverClientUpdateResponse struct { + // GraphQL API Resolver details. + ResolverContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// GraphQLAPIResolverPolicyClientCreateOrUpdateResponse contains the response from method GraphQLAPIResolverPolicyClient.CreateOrUpdate. +type GraphQLAPIResolverPolicyClientCreateOrUpdateResponse struct { + // Policy Contract details. + PolicyContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// GraphQLAPIResolverPolicyClientDeleteResponse contains the response from method GraphQLAPIResolverPolicyClient.Delete. +type GraphQLAPIResolverPolicyClientDeleteResponse struct { + // placeholder for future response values +} + +// GraphQLAPIResolverPolicyClientGetEntityTagResponse contains the response from method GraphQLAPIResolverPolicyClient.GetEntityTag. +type GraphQLAPIResolverPolicyClientGetEntityTagResponse struct { + // ETag contains the information returned from the ETag header response. + ETag *string + + // Success indicates if the operation succeeded or failed. + Success bool +} + +// GraphQLAPIResolverPolicyClientGetResponse contains the response from method GraphQLAPIResolverPolicyClient.Get. +type GraphQLAPIResolverPolicyClientGetResponse struct { + // Policy Contract details. + PolicyContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// GraphQLAPIResolverPolicyClientListByResolverResponse contains the response from method GraphQLAPIResolverPolicyClient.NewListByResolverPager. +type GraphQLAPIResolverPolicyClientListByResolverResponse struct { + // The response of the list policy operation. + PolicyCollection +} + // GroupClientCreateOrUpdateResponse contains the response from method GroupClient.CreateOrUpdate. type GroupClientCreateOrUpdateResponse struct { + // Contract details. GroupContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -1022,19 +1465,24 @@ type GroupClientGetEntityTagResponse struct { // GroupClientGetResponse contains the response from method GroupClient.Get. type GroupClientGetResponse struct { + // Contract details. GroupContract + // ETag contains the information returned from the ETag header response. ETag *string } // GroupClientListByServiceResponse contains the response from method GroupClient.NewListByServicePager. type GroupClientListByServiceResponse struct { + // Paged Group list representation. GroupCollection } // GroupClientUpdateResponse contains the response from method GroupClient.Update. type GroupClientUpdateResponse struct { + // Contract details. GroupContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -1047,6 +1495,7 @@ type GroupUserClientCheckEntityExistsResponse struct { // GroupUserClientCreateResponse contains the response from method GroupUserClient.Create. type GroupUserClientCreateResponse struct { + // User details. UserContract } @@ -1057,12 +1506,15 @@ type GroupUserClientDeleteResponse struct { // GroupUserClientListResponse contains the response from method GroupUserClient.NewListPager. type GroupUserClientListResponse struct { + // Paged Users list representation. UserCollection } // IdentityProviderClientCreateOrUpdateResponse contains the response from method IdentityProviderClient.CreateOrUpdate. type IdentityProviderClientCreateOrUpdateResponse struct { + // Identity Provider details. IdentityProviderContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -1083,45 +1535,57 @@ type IdentityProviderClientGetEntityTagResponse struct { // IdentityProviderClientGetResponse contains the response from method IdentityProviderClient.Get. type IdentityProviderClientGetResponse struct { + // Identity Provider details. IdentityProviderContract + // ETag contains the information returned from the ETag header response. ETag *string } // IdentityProviderClientListByServiceResponse contains the response from method IdentityProviderClient.NewListByServicePager. type IdentityProviderClientListByServiceResponse struct { + // List of all the Identity Providers configured on the service instance. IdentityProviderList } // IdentityProviderClientListSecretsResponse contains the response from method IdentityProviderClient.ListSecrets. type IdentityProviderClientListSecretsResponse struct { + // Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. ClientSecretContract + // ETag contains the information returned from the ETag header response. ETag *string } // IdentityProviderClientUpdateResponse contains the response from method IdentityProviderClient.Update. type IdentityProviderClientUpdateResponse struct { + // Identity Provider details. IdentityProviderContract + // ETag contains the information returned from the ETag header response. ETag *string } // IssueClientGetResponse contains the response from method IssueClient.Get. type IssueClientGetResponse struct { + // Issue Contract details. IssueContract + // ETag contains the information returned from the ETag header response. ETag *string } // IssueClientListByServiceResponse contains the response from method IssueClient.NewListByServicePager. type IssueClientListByServiceResponse struct { + // Paged Issue list representation. IssueCollection } // LoggerClientCreateOrUpdateResponse contains the response from method LoggerClient.CreateOrUpdate. type LoggerClientCreateOrUpdateResponse struct { + // Logger details. LoggerContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -1142,25 +1606,31 @@ type LoggerClientGetEntityTagResponse struct { // LoggerClientGetResponse contains the response from method LoggerClient.Get. type LoggerClientGetResponse struct { + // Logger details. LoggerContract + // ETag contains the information returned from the ETag header response. ETag *string } // LoggerClientListByServiceResponse contains the response from method LoggerClient.NewListByServicePager. type LoggerClientListByServiceResponse struct { + // Paged Logger list representation. LoggerCollection } // LoggerClientUpdateResponse contains the response from method LoggerClient.Update. type LoggerClientUpdateResponse struct { + // Logger details. LoggerContract + // ETag contains the information returned from the ETag header response. ETag *string } // NamedValueClientCreateOrUpdateResponse contains the response from method NamedValueClient.BeginCreateOrUpdate. type NamedValueClientCreateOrUpdateResponse struct { + // NamedValue details. NamedValueContract } @@ -1180,35 +1650,43 @@ type NamedValueClientGetEntityTagResponse struct { // NamedValueClientGetResponse contains the response from method NamedValueClient.Get. type NamedValueClientGetResponse struct { + // NamedValue details. NamedValueContract + // ETag contains the information returned from the ETag header response. ETag *string } // NamedValueClientListByServiceResponse contains the response from method NamedValueClient.NewListByServicePager. type NamedValueClientListByServiceResponse struct { + // Paged NamedValue list representation. NamedValueCollection } // NamedValueClientListValueResponse contains the response from method NamedValueClient.ListValue. type NamedValueClientListValueResponse struct { + // Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. NamedValueSecretContract + // ETag contains the information returned from the ETag header response. ETag *string } // NamedValueClientRefreshSecretResponse contains the response from method NamedValueClient.BeginRefreshSecret. type NamedValueClientRefreshSecretResponse struct { + // NamedValue details. NamedValueContract } // NamedValueClientUpdateResponse contains the response from method NamedValueClient.BeginUpdate. type NamedValueClientUpdateResponse struct { + // NamedValue details. NamedValueContract } // NetworkStatusClientListByLocationResponse contains the response from method NetworkStatusClient.ListByLocation. type NetworkStatusClientListByLocationResponse struct { + // Network Status details. NetworkStatusContract } @@ -1220,16 +1698,19 @@ type NetworkStatusClientListByServiceResponse struct { // NotificationClientCreateOrUpdateResponse contains the response from method NotificationClient.CreateOrUpdate. type NotificationClientCreateOrUpdateResponse struct { + // Notification details. NotificationContract } // NotificationClientGetResponse contains the response from method NotificationClient.Get. type NotificationClientGetResponse struct { + // Notification details. NotificationContract } // NotificationClientListByServiceResponse contains the response from method NotificationClient.NewListByServicePager. type NotificationClientListByServiceResponse struct { + // Paged Notification list representation. NotificationCollection } @@ -1241,6 +1722,7 @@ type NotificationRecipientEmailClientCheckEntityExistsResponse struct { // NotificationRecipientEmailClientCreateOrUpdateResponse contains the response from method NotificationRecipientEmailClient.CreateOrUpdate. type NotificationRecipientEmailClientCreateOrUpdateResponse struct { + // Recipient Email details. RecipientEmailContract } @@ -1251,6 +1733,7 @@ type NotificationRecipientEmailClientDeleteResponse struct { // NotificationRecipientEmailClientListByNotificationResponse contains the response from method NotificationRecipientEmailClient.ListByNotification. type NotificationRecipientEmailClientListByNotificationResponse struct { + // Paged Recipient User list representation. RecipientEmailCollection } @@ -1262,6 +1745,7 @@ type NotificationRecipientUserClientCheckEntityExistsResponse struct { // NotificationRecipientUserClientCreateOrUpdateResponse contains the response from method NotificationRecipientUserClient.CreateOrUpdate. type NotificationRecipientUserClientCreateOrUpdateResponse struct { + // Recipient User details. RecipientUserContract } @@ -1272,12 +1756,15 @@ type NotificationRecipientUserClientDeleteResponse struct { // NotificationRecipientUserClientListByNotificationResponse contains the response from method NotificationRecipientUserClient.ListByNotification. type NotificationRecipientUserClientListByNotificationResponse struct { + // Paged Recipient User list representation. RecipientUserCollection } // OpenIDConnectProviderClientCreateOrUpdateResponse contains the response from method OpenIDConnectProviderClient.CreateOrUpdate. type OpenIDConnectProviderClientCreateOrUpdateResponse struct { + // OpenId Connect Provider details. OpenidConnectProviderContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -1298,48 +1785,61 @@ type OpenIDConnectProviderClientGetEntityTagResponse struct { // OpenIDConnectProviderClientGetResponse contains the response from method OpenIDConnectProviderClient.Get. type OpenIDConnectProviderClientGetResponse struct { + // OpenId Connect Provider details. OpenidConnectProviderContract + // ETag contains the information returned from the ETag header response. ETag *string } // OpenIDConnectProviderClientListByServiceResponse contains the response from method OpenIDConnectProviderClient.NewListByServicePager. type OpenIDConnectProviderClientListByServiceResponse struct { + // Paged OpenIdProviders list representation. OpenIDConnectProviderCollection } // OpenIDConnectProviderClientListSecretsResponse contains the response from method OpenIDConnectProviderClient.ListSecrets. type OpenIDConnectProviderClientListSecretsResponse struct { + // Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. ClientSecretContract + // ETag contains the information returned from the ETag header response. ETag *string } // OpenIDConnectProviderClientUpdateResponse contains the response from method OpenIDConnectProviderClient.Update. type OpenIDConnectProviderClientUpdateResponse struct { + // OpenId Connect Provider details. OpenidConnectProviderContract + // ETag contains the information returned from the ETag header response. ETag *string } // OperationClientListByTagsResponse contains the response from method OperationClient.NewListByTagsPager. type OperationClientListByTagsResponse struct { + // Paged Tag list representation. TagResourceCollection } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the next + // set of results. OperationListResult } // OutboundNetworkDependenciesEndpointsClientListByServiceResponse contains the response from method OutboundNetworkDependenciesEndpointsClient.ListByService. type OutboundNetworkDependenciesEndpointsClientListByServiceResponse struct { + // Collection of Outbound Environment Endpoints OutboundEnvironmentEndpointList } // PolicyClientCreateOrUpdateResponse contains the response from method PolicyClient.CreateOrUpdate. type PolicyClientCreateOrUpdateResponse struct { + // Policy Contract details. PolicyContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -1360,23 +1860,105 @@ type PolicyClientGetEntityTagResponse struct { // PolicyClientGetResponse contains the response from method PolicyClient.Get. type PolicyClientGetResponse struct { + // Policy Contract details. PolicyContract + // ETag contains the information returned from the ETag header response. ETag *string } // PolicyClientListByServiceResponse contains the response from method PolicyClient.ListByService. type PolicyClientListByServiceResponse struct { + // The response of the list policy operation. PolicyCollection } // PolicyDescriptionClientListByServiceResponse contains the response from method PolicyDescriptionClient.ListByService. type PolicyDescriptionClientListByServiceResponse struct { + // Descriptions of API Management policies. PolicyDescriptionCollection } +// PolicyFragmentClientCreateOrUpdateResponse contains the response from method PolicyFragmentClient.BeginCreateOrUpdate. +type PolicyFragmentClientCreateOrUpdateResponse struct { + // Policy fragment contract details. + PolicyFragmentContract +} + +// PolicyFragmentClientDeleteResponse contains the response from method PolicyFragmentClient.Delete. +type PolicyFragmentClientDeleteResponse struct { + // placeholder for future response values +} + +// PolicyFragmentClientGetEntityTagResponse contains the response from method PolicyFragmentClient.GetEntityTag. +type PolicyFragmentClientGetEntityTagResponse struct { + // ETag contains the information returned from the ETag header response. + ETag *string + + // Success indicates if the operation succeeded or failed. + Success bool +} + +// PolicyFragmentClientGetResponse contains the response from method PolicyFragmentClient.Get. +type PolicyFragmentClientGetResponse struct { + // Policy fragment contract details. + PolicyFragmentContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// PolicyFragmentClientListByServiceResponse contains the response from method PolicyFragmentClient.ListByService. +type PolicyFragmentClientListByServiceResponse struct { + // The response of the get policy fragments operation. + PolicyFragmentCollection +} + +// PolicyFragmentClientListReferencesResponse contains the response from method PolicyFragmentClient.ListReferences. +type PolicyFragmentClientListReferencesResponse struct { + // A collection of resources. + ResourceCollection +} + +// PortalConfigClientCreateOrUpdateResponse contains the response from method PortalConfigClient.CreateOrUpdate. +type PortalConfigClientCreateOrUpdateResponse struct { + // The developer portal configuration contract. + PortalConfigContract +} + +// PortalConfigClientGetEntityTagResponse contains the response from method PortalConfigClient.GetEntityTag. +type PortalConfigClientGetEntityTagResponse struct { + // ETag contains the information returned from the ETag header response. + ETag *string + + // Success indicates if the operation succeeded or failed. + Success bool +} + +// PortalConfigClientGetResponse contains the response from method PortalConfigClient.Get. +type PortalConfigClientGetResponse struct { + // The developer portal configuration contract. + PortalConfigContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// PortalConfigClientListByServiceResponse contains the response from method PortalConfigClient.ListByService. +type PortalConfigClientListByServiceResponse struct { + // The collection of the developer portal configurations. + PortalConfigCollection +} + +// PortalConfigClientUpdateResponse contains the response from method PortalConfigClient.Update. +type PortalConfigClientUpdateResponse struct { + // The developer portal configuration contract. + PortalConfigContract +} + // PortalRevisionClientCreateOrUpdateResponse contains the response from method PortalRevisionClient.BeginCreateOrUpdate. type PortalRevisionClientCreateOrUpdateResponse struct { + // Portal Revision's contract details. PortalRevisionContract } @@ -1391,28 +1973,34 @@ type PortalRevisionClientGetEntityTagResponse struct { // PortalRevisionClientGetResponse contains the response from method PortalRevisionClient.Get. type PortalRevisionClientGetResponse struct { + // Portal Revision's contract details. PortalRevisionContract + // ETag contains the information returned from the ETag header response. ETag *string } // PortalRevisionClientListByServiceResponse contains the response from method PortalRevisionClient.NewListByServicePager. type PortalRevisionClientListByServiceResponse struct { + // Paged list of portal revisions. PortalRevisionCollection } // PortalRevisionClientUpdateResponse contains the response from method PortalRevisionClient.BeginUpdate. type PortalRevisionClientUpdateResponse struct { + // Portal Revision's contract details. PortalRevisionContract } // PortalSettingsClientListByServiceResponse contains the response from method PortalSettingsClient.ListByService. type PortalSettingsClientListByServiceResponse struct { + // Descriptions of API Management policies. PortalSettingsCollection } // PrivateEndpointConnectionClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionClient.BeginCreateOrUpdate. type PrivateEndpointConnectionClientCreateOrUpdateResponse struct { + // The Private Endpoint Connection resource. PrivateEndpointConnection } @@ -1423,21 +2011,25 @@ type PrivateEndpointConnectionClientDeleteResponse struct { // PrivateEndpointConnectionClientGetByNameResponse contains the response from method PrivateEndpointConnectionClient.GetByName. type PrivateEndpointConnectionClientGetByNameResponse struct { + // The Private Endpoint Connection resource. PrivateEndpointConnection } // PrivateEndpointConnectionClientGetPrivateLinkResourceResponse contains the response from method PrivateEndpointConnectionClient.GetPrivateLinkResource. type PrivateEndpointConnectionClientGetPrivateLinkResourceResponse struct { + // A private link resource PrivateLinkResource } // PrivateEndpointConnectionClientListByServiceResponse contains the response from method PrivateEndpointConnectionClient.NewListByServicePager. type PrivateEndpointConnectionClientListByServiceResponse struct { + // List of private endpoint connection associated with the specified storage account PrivateEndpointConnectionListResult } // PrivateEndpointConnectionClientListPrivateLinkResourcesResponse contains the response from method PrivateEndpointConnectionClient.ListPrivateLinkResources. type PrivateEndpointConnectionClientListPrivateLinkResourcesResponse struct { + // A list of private link resources PrivateLinkResourceListResult } @@ -1449,6 +2041,7 @@ type ProductAPIClientCheckEntityExistsResponse struct { // ProductAPIClientCreateOrUpdateResponse contains the response from method ProductAPIClient.CreateOrUpdate. type ProductAPIClientCreateOrUpdateResponse struct { + // API details. APIContract } @@ -1459,12 +2052,15 @@ type ProductAPIClientDeleteResponse struct { // ProductAPIClientListByProductResponse contains the response from method ProductAPIClient.NewListByProductPager. type ProductAPIClientListByProductResponse struct { + // Paged API list representation. APICollection } // ProductClientCreateOrUpdateResponse contains the response from method ProductClient.CreateOrUpdate. type ProductClientCreateOrUpdateResponse struct { + // Product details. ProductContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -1485,24 +2081,30 @@ type ProductClientGetEntityTagResponse struct { // ProductClientGetResponse contains the response from method ProductClient.Get. type ProductClientGetResponse struct { + // Product details. ProductContract + // ETag contains the information returned from the ETag header response. ETag *string } // ProductClientListByServiceResponse contains the response from method ProductClient.NewListByServicePager. type ProductClientListByServiceResponse struct { + // Paged Products list representation. ProductCollection } // ProductClientListByTagsResponse contains the response from method ProductClient.NewListByTagsPager. type ProductClientListByTagsResponse struct { + // Paged Tag list representation. TagResourceCollection } // ProductClientUpdateResponse contains the response from method ProductClient.Update. type ProductClientUpdateResponse struct { + // Product details. ProductContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -1515,6 +2117,7 @@ type ProductGroupClientCheckEntityExistsResponse struct { // ProductGroupClientCreateOrUpdateResponse contains the response from method ProductGroupClient.CreateOrUpdate. type ProductGroupClientCreateOrUpdateResponse struct { + // Contract details. GroupContract } @@ -1525,12 +2128,15 @@ type ProductGroupClientDeleteResponse struct { // ProductGroupClientListByProductResponse contains the response from method ProductGroupClient.NewListByProductPager. type ProductGroupClientListByProductResponse struct { + // Paged Group list representation. GroupCollection } // ProductPolicyClientCreateOrUpdateResponse contains the response from method ProductPolicyClient.CreateOrUpdate. type ProductPolicyClientCreateOrUpdateResponse struct { + // Policy Contract details. PolicyContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -1551,158 +2157,246 @@ type ProductPolicyClientGetEntityTagResponse struct { // ProductPolicyClientGetResponse contains the response from method ProductPolicyClient.Get. type ProductPolicyClientGetResponse struct { + // Policy Contract details. PolicyContract + // ETag contains the information returned from the ETag header response. ETag *string } // ProductPolicyClientListByProductResponse contains the response from method ProductPolicyClient.ListByProduct. type ProductPolicyClientListByProductResponse struct { + // The response of the list policy operation. PolicyCollection } // ProductSubscriptionsClientListResponse contains the response from method ProductSubscriptionsClient.NewListPager. type ProductSubscriptionsClientListResponse struct { + // Paged Subscriptions list representation. SubscriptionCollection } +// ProductWikiClientCreateOrUpdateResponse contains the response from method ProductWikiClient.CreateOrUpdate. +type ProductWikiClientCreateOrUpdateResponse struct { + // Wiki properties + WikiContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// ProductWikiClientDeleteResponse contains the response from method ProductWikiClient.Delete. +type ProductWikiClientDeleteResponse struct { + // placeholder for future response values +} + +// ProductWikiClientGetEntityTagResponse contains the response from method ProductWikiClient.GetEntityTag. +type ProductWikiClientGetEntityTagResponse struct { + // ETag contains the information returned from the ETag header response. + ETag *string + + // Success indicates if the operation succeeded or failed. + Success bool +} + +// ProductWikiClientGetResponse contains the response from method ProductWikiClient.Get. +type ProductWikiClientGetResponse struct { + // Wiki properties + WikiContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// ProductWikiClientUpdateResponse contains the response from method ProductWikiClient.Update. +type ProductWikiClientUpdateResponse struct { + // Wiki properties + WikiContract + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// ProductWikisClientListResponse contains the response from method ProductWikisClient.NewListPager. +type ProductWikisClientListResponse struct { + // Paged Wiki list representation. + WikiCollection + + // ETag contains the information returned from the ETag header response. + ETag *string +} + // QuotaByCounterKeysClientListByServiceResponse contains the response from method QuotaByCounterKeysClient.ListByService. type QuotaByCounterKeysClientListByServiceResponse struct { + // Paged Quota Counter list representation. QuotaCounterCollection } // QuotaByCounterKeysClientUpdateResponse contains the response from method QuotaByCounterKeysClient.Update. type QuotaByCounterKeysClientUpdateResponse struct { + // Paged Quota Counter list representation. QuotaCounterCollection } // QuotaByPeriodKeysClientGetResponse contains the response from method QuotaByPeriodKeysClient.Get. type QuotaByPeriodKeysClientGetResponse struct { + // Quota counter details. QuotaCounterContract } // QuotaByPeriodKeysClientUpdateResponse contains the response from method QuotaByPeriodKeysClient.Update. type QuotaByPeriodKeysClientUpdateResponse struct { + // Quota counter details. QuotaCounterContract } // RegionClientListByServiceResponse contains the response from method RegionClient.NewListByServicePager. type RegionClientListByServiceResponse struct { + // Lists Regions operation response details. RegionListResult } // ReportsClientListByAPIResponse contains the response from method ReportsClient.NewListByAPIPager. type ReportsClientListByAPIResponse struct { + // Paged Report records list representation. ReportCollection } // ReportsClientListByGeoResponse contains the response from method ReportsClient.NewListByGeoPager. type ReportsClientListByGeoResponse struct { + // Paged Report records list representation. ReportCollection } // ReportsClientListByOperationResponse contains the response from method ReportsClient.NewListByOperationPager. type ReportsClientListByOperationResponse struct { + // Paged Report records list representation. ReportCollection } // ReportsClientListByProductResponse contains the response from method ReportsClient.NewListByProductPager. type ReportsClientListByProductResponse struct { + // Paged Report records list representation. ReportCollection } // ReportsClientListByRequestResponse contains the response from method ReportsClient.NewListByRequestPager. type ReportsClientListByRequestResponse struct { + // Paged Report records list representation. RequestReportCollection } // ReportsClientListBySubscriptionResponse contains the response from method ReportsClient.NewListBySubscriptionPager. type ReportsClientListBySubscriptionResponse struct { + // Paged Report records list representation. ReportCollection } // ReportsClientListByTimeResponse contains the response from method ReportsClient.NewListByTimePager. type ReportsClientListByTimeResponse struct { + // Paged Report records list representation. ReportCollection } // ReportsClientListByUserResponse contains the response from method ReportsClient.NewListByUserPager. type ReportsClientListByUserResponse struct { + // Paged Report records list representation. ReportCollection } // SKUsClientListResponse contains the response from method SKUsClient.NewListPager. type SKUsClientListResponse struct { + // The List Resource Skus operation response. SKUsResult } // ServiceClientApplyNetworkConfigurationUpdatesResponse contains the response from method ServiceClient.BeginApplyNetworkConfigurationUpdates. type ServiceClientApplyNetworkConfigurationUpdatesResponse struct { + // A single API Management service resource in List or Get response. ServiceResource } // ServiceClientBackupResponse contains the response from method ServiceClient.BeginBackup. type ServiceClientBackupResponse struct { + // A single API Management service resource in List or Get response. ServiceResource } // ServiceClientCheckNameAvailabilityResponse contains the response from method ServiceClient.CheckNameAvailability. type ServiceClientCheckNameAvailabilityResponse struct { + // Response of the CheckNameAvailability operation. ServiceNameAvailabilityResult } // ServiceClientCreateOrUpdateResponse contains the response from method ServiceClient.BeginCreateOrUpdate. type ServiceClientCreateOrUpdateResponse struct { + // A single API Management service resource in List or Get response. ServiceResource } // ServiceClientDeleteResponse contains the response from method ServiceClient.BeginDelete. type ServiceClientDeleteResponse struct { + // A single API Management service resource in List or Get response. ServiceResource } // ServiceClientGetDomainOwnershipIdentifierResponse contains the response from method ServiceClient.GetDomainOwnershipIdentifier. type ServiceClientGetDomainOwnershipIdentifierResponse struct { + // Response of the GetDomainOwnershipIdentifier operation. ServiceGetDomainOwnershipIdentifierResult } // ServiceClientGetResponse contains the response from method ServiceClient.Get. type ServiceClientGetResponse struct { + // A single API Management service resource in List or Get response. ServiceResource } // ServiceClientGetSsoTokenResponse contains the response from method ServiceClient.GetSsoToken. type ServiceClientGetSsoTokenResponse struct { + // The response of the GetSsoToken operation. ServiceGetSsoTokenResult } // ServiceClientListByResourceGroupResponse contains the response from method ServiceClient.NewListByResourceGroupPager. type ServiceClientListByResourceGroupResponse struct { + // The response of the List API Management services operation. ServiceListResult } // ServiceClientListResponse contains the response from method ServiceClient.NewListPager. type ServiceClientListResponse struct { + // The response of the List API Management services operation. ServiceListResult } +// ServiceClientMigrateToStv2Response contains the response from method ServiceClient.BeginMigrateToStv2. +type ServiceClientMigrateToStv2Response struct { + // A single API Management service resource in List or Get response. + ServiceResource +} + // ServiceClientRestoreResponse contains the response from method ServiceClient.BeginRestore. type ServiceClientRestoreResponse struct { + // A single API Management service resource in List or Get response. ServiceResource } // ServiceClientUpdateResponse contains the response from method ServiceClient.BeginUpdate. type ServiceClientUpdateResponse struct { + // A single API Management service resource in List or Get response. ServiceResource } // ServiceSKUsClientListAvailableServiceSKUsResponse contains the response from method ServiceSKUsClient.NewListAvailableServiceSKUsPager. type ServiceSKUsClientListAvailableServiceSKUsResponse struct { + // The API Management service SKUs operation response. ResourceSKUResults } // SignInSettingsClientCreateOrUpdateResponse contains the response from method SignInSettingsClient.CreateOrUpdate. type SignInSettingsClientCreateOrUpdateResponse struct { + // Sign-In settings for the Developer Portal. PortalSigninSettings } @@ -1717,7 +2411,9 @@ type SignInSettingsClientGetEntityTagResponse struct { // SignInSettingsClientGetResponse contains the response from method SignInSettingsClient.Get. type SignInSettingsClientGetResponse struct { + // Sign-In settings for the Developer Portal. PortalSigninSettings + // ETag contains the information returned from the ETag header response. ETag *string } @@ -1729,6 +2425,7 @@ type SignInSettingsClientUpdateResponse struct { // SignUpSettingsClientCreateOrUpdateResponse contains the response from method SignUpSettingsClient.CreateOrUpdate. type SignUpSettingsClientCreateOrUpdateResponse struct { + // Sign-Up settings for a developer portal. PortalSignupSettings } @@ -1743,7 +2440,9 @@ type SignUpSettingsClientGetEntityTagResponse struct { // SignUpSettingsClientGetResponse contains the response from method SignUpSettingsClient.Get. type SignUpSettingsClientGetResponse struct { + // Sign-Up settings for a developer portal. PortalSignupSettings + // ETag contains the information returned from the ETag header response. ETag *string } @@ -1755,7 +2454,9 @@ type SignUpSettingsClientUpdateResponse struct { // SubscriptionClientCreateOrUpdateResponse contains the response from method SubscriptionClient.CreateOrUpdate. type SubscriptionClientCreateOrUpdateResponse struct { + // Subscription details. SubscriptionContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -1776,19 +2477,24 @@ type SubscriptionClientGetEntityTagResponse struct { // SubscriptionClientGetResponse contains the response from method SubscriptionClient.Get. type SubscriptionClientGetResponse struct { + // Subscription details. SubscriptionContract + // ETag contains the information returned from the ETag header response. ETag *string } // SubscriptionClientListResponse contains the response from method SubscriptionClient.NewListPager. type SubscriptionClientListResponse struct { + // Paged Subscriptions list representation. SubscriptionCollection } // SubscriptionClientListSecretsResponse contains the response from method SubscriptionClient.ListSecrets. type SubscriptionClientListSecretsResponse struct { + // Subscription keys. SubscriptionKeysContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -1805,31 +2511,39 @@ type SubscriptionClientRegenerateSecondaryKeyResponse struct { // SubscriptionClientUpdateResponse contains the response from method SubscriptionClient.Update. type SubscriptionClientUpdateResponse struct { + // Subscription details. SubscriptionContract + // ETag contains the information returned from the ETag header response. ETag *string } // TagClientAssignToAPIResponse contains the response from method TagClient.AssignToAPI. type TagClientAssignToAPIResponse struct { + // Tag Contract details. TagContract + // ETag contains the information returned from the ETag header response. ETag *string } // TagClientAssignToOperationResponse contains the response from method TagClient.AssignToOperation. type TagClientAssignToOperationResponse struct { + // Tag Contract details. TagContract } // TagClientAssignToProductResponse contains the response from method TagClient.AssignToProduct. type TagClientAssignToProductResponse struct { + // Tag Contract details. TagContract } // TagClientCreateOrUpdateResponse contains the response from method TagClient.CreateOrUpdate. type TagClientCreateOrUpdateResponse struct { + // Tag Contract details. TagContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -1856,21 +2570,27 @@ type TagClientDetachFromProductResponse struct { // TagClientGetByAPIResponse contains the response from method TagClient.GetByAPI. type TagClientGetByAPIResponse struct { + // Tag Contract details. TagContract + // ETag contains the information returned from the ETag header response. ETag *string } // TagClientGetByOperationResponse contains the response from method TagClient.GetByOperation. type TagClientGetByOperationResponse struct { + // Tag Contract details. TagContract + // ETag contains the information returned from the ETag header response. ETag *string } // TagClientGetByProductResponse contains the response from method TagClient.GetByProduct. type TagClientGetByProductResponse struct { + // Tag Contract details. TagContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -1913,46 +2633,57 @@ type TagClientGetEntityStateResponse struct { // TagClientGetResponse contains the response from method TagClient.Get. type TagClientGetResponse struct { + // Tag Contract details. TagContract + // ETag contains the information returned from the ETag header response. ETag *string } // TagClientListByAPIResponse contains the response from method TagClient.NewListByAPIPager. type TagClientListByAPIResponse struct { + // Paged Tag list representation. TagCollection } // TagClientListByOperationResponse contains the response from method TagClient.NewListByOperationPager. type TagClientListByOperationResponse struct { + // Paged Tag list representation. TagCollection } // TagClientListByProductResponse contains the response from method TagClient.NewListByProductPager. type TagClientListByProductResponse struct { + // Paged Tag list representation. TagCollection } // TagClientListByServiceResponse contains the response from method TagClient.NewListByServicePager. type TagClientListByServiceResponse struct { + // Paged Tag list representation. TagCollection } // TagClientUpdateResponse contains the response from method TagClient.Update. type TagClientUpdateResponse struct { + // Tag Contract details. TagContract + // ETag contains the information returned from the ETag header response. ETag *string } // TagResourceClientListByServiceResponse contains the response from method TagResourceClient.NewListByServicePager. type TagResourceClientListByServiceResponse struct { + // Paged Tag list representation. TagResourceCollection } // TenantAccessClientCreateResponse contains the response from method TenantAccessClient.Create. type TenantAccessClientCreateResponse struct { + // Tenant Settings. AccessInformationContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -1968,19 +2699,24 @@ type TenantAccessClientGetEntityTagResponse struct { // TenantAccessClientGetResponse contains the response from method TenantAccessClient.Get. type TenantAccessClientGetResponse struct { + // Tenant Settings. AccessInformationContract + // ETag contains the information returned from the ETag header response. ETag *string } // TenantAccessClientListByServiceResponse contains the response from method TenantAccessClient.NewListByServicePager. type TenantAccessClientListByServiceResponse struct { + // Paged AccessInformation list representation. AccessInformationCollection } // TenantAccessClientListSecretsResponse contains the response from method TenantAccessClient.ListSecrets. type TenantAccessClientListSecretsResponse struct { + // Tenant access information contract of the API Management service. AccessInformationSecretsContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -1997,7 +2733,9 @@ type TenantAccessClientRegenerateSecondaryKeyResponse struct { // TenantAccessClientUpdateResponse contains the response from method TenantAccessClient.Update. type TenantAccessClientUpdateResponse struct { + // Tenant Settings. AccessInformationContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -2014,39 +2752,48 @@ type TenantAccessGitClientRegenerateSecondaryKeyResponse struct { // TenantConfigurationClientDeployResponse contains the response from method TenantConfigurationClient.BeginDeploy. type TenantConfigurationClientDeployResponse struct { + // Long Running Git Operation Results. OperationResultContract } // TenantConfigurationClientGetSyncStateResponse contains the response from method TenantConfigurationClient.GetSyncState. type TenantConfigurationClientGetSyncStateResponse struct { + // Result of Tenant Configuration Sync State. TenantConfigurationSyncStateContract } // TenantConfigurationClientSaveResponse contains the response from method TenantConfigurationClient.BeginSave. type TenantConfigurationClientSaveResponse struct { + // Long Running Git Operation Results. OperationResultContract } // TenantConfigurationClientValidateResponse contains the response from method TenantConfigurationClient.BeginValidate. type TenantConfigurationClientValidateResponse struct { + // Long Running Git Operation Results. OperationResultContract } // TenantSettingsClientGetResponse contains the response from method TenantSettingsClient.Get. type TenantSettingsClientGetResponse struct { + // Tenant Settings. TenantSettingsContract + // ETag contains the information returned from the ETag header response. ETag *string } // TenantSettingsClientListByServiceResponse contains the response from method TenantSettingsClient.NewListByServicePager. type TenantSettingsClientListByServiceResponse struct { + // Paged AccessInformation list representation. TenantSettingsCollection } // UserClientCreateOrUpdateResponse contains the response from method UserClient.CreateOrUpdate. type UserClientCreateOrUpdateResponse struct { + // User details. UserContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -2058,6 +2805,7 @@ type UserClientDeleteResponse struct { // UserClientGenerateSsoURLResponse contains the response from method UserClient.GenerateSsoURL. type UserClientGenerateSsoURLResponse struct { + // Generate SSO Url operations response details. GenerateSsoURLResult } @@ -2072,24 +2820,30 @@ type UserClientGetEntityTagResponse struct { // UserClientGetResponse contains the response from method UserClient.Get. type UserClientGetResponse struct { + // User details. UserContract + // ETag contains the information returned from the ETag header response. ETag *string } // UserClientGetSharedAccessTokenResponse contains the response from method UserClient.GetSharedAccessToken. type UserClientGetSharedAccessTokenResponse struct { + // Get User Token response details. UserTokenResult } // UserClientListByServiceResponse contains the response from method UserClient.NewListByServicePager. type UserClientListByServiceResponse struct { + // Paged Users list representation. UserCollection } // UserClientUpdateResponse contains the response from method UserClient.Update. type UserClientUpdateResponse struct { + // User details. UserContract + // ETag contains the information returned from the ETag header response. ETag *string } @@ -2101,22 +2855,27 @@ type UserConfirmationPasswordClientSendResponse struct { // UserGroupClientListResponse contains the response from method UserGroupClient.NewListPager. type UserGroupClientListResponse struct { + // Paged Group list representation. GroupCollection } // UserIdentitiesClientListResponse contains the response from method UserIdentitiesClient.NewListPager. type UserIdentitiesClientListResponse struct { + // List of Users Identity list representation. UserIdentityCollection } // UserSubscriptionClientGetResponse contains the response from method UserSubscriptionClient.Get. type UserSubscriptionClientGetResponse struct { + // Subscription details. SubscriptionContract + // ETag contains the information returned from the ETag header response. ETag *string } // UserSubscriptionClientListResponse contains the response from method UserSubscriptionClient.NewListPager. type UserSubscriptionClientListResponse struct { + // Paged Subscriptions list representation. SubscriptionCollection } diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/service_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/service_client.go index 427fb118ffcd..a667924bd957 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/service_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/service_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type ServiceClient struct { } // NewServiceClient creates a new instance of ServiceClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewServiceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceClient, error) { @@ -49,8 +47,8 @@ func NewServiceClient(subscriptionID string, credential azcore.TokenCredential, // pick the updated DNS changes. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - ServiceClientBeginApplyNetworkConfigurationUpdatesOptions contains the optional parameters for the ServiceClient.BeginApplyNetworkConfigurationUpdates // method. @@ -60,9 +58,10 @@ func (client *ServiceClient) BeginApplyNetworkConfigurationUpdates(ctx context.C if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceClientApplyNetworkConfigurationUpdatesResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceClientApplyNetworkConfigurationUpdatesResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServiceClientApplyNetworkConfigurationUpdatesResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,20 +71,22 @@ func (client *ServiceClient) BeginApplyNetworkConfigurationUpdates(ctx context.C // the updated DNS changes. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *ServiceClient) applyNetworkConfigurationUpdates(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientBeginApplyNetworkConfigurationUpdatesOptions) (*http.Response, error) { + var err error req, err := client.applyNetworkConfigurationUpdatesCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // applyNetworkConfigurationUpdatesCreateRequest creates the ApplyNetworkConfigurationUpdates request. @@ -108,11 +109,14 @@ func (client *ServiceClient) applyNetworkConfigurationUpdatesCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) + if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -121,8 +125,8 @@ func (client *ServiceClient) applyNetworkConfigurationUpdatesCreateRequest(ctx c // and could take several minutes to complete. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - parameters - Parameters supplied to the ApiManagementService_Backup operation. // - options - ServiceClientBeginBackupOptions contains the optional parameters for the ServiceClient.BeginBackup method. @@ -132,9 +136,10 @@ func (client *ServiceClient) BeginBackup(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceClientBackupResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceClientBackupResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServiceClientBackupResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -144,20 +149,22 @@ func (client *ServiceClient) BeginBackup(ctx context.Context, resourceGroupName // and could take several minutes to complete. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *ServiceClient) backup(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceBackupRestoreParameters, options *ServiceClientBeginBackupOptions) (*http.Response, error) { + var err error req, err := client.backupCreateRequest(ctx, resourceGroupName, serviceName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // backupCreateRequest creates the Backup request. @@ -180,32 +187,38 @@ func (client *ServiceClient) backupCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // CheckNameAvailability - Checks availability and correctness of a name for an API Management service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 // - parameters - Parameters supplied to the CheckNameAvailability operation. // - options - ServiceClientCheckNameAvailabilityOptions contains the optional parameters for the ServiceClient.CheckNameAvailability // method. func (client *ServiceClient) CheckNameAvailability(ctx context.Context, parameters ServiceCheckNameAvailabilityParameters, options *ServiceClientCheckNameAvailabilityOptions) (ServiceClientCheckNameAvailabilityResponse, error) { + var err error req, err := client.checkNameAvailabilityCreateRequest(ctx, parameters, options) if err != nil { return ServiceClientCheckNameAvailabilityResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServiceClientCheckNameAvailabilityResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceClientCheckNameAvailabilityResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServiceClientCheckNameAvailabilityResponse{}, err } - return client.checkNameAvailabilityHandleResponse(resp) + resp, err := client.checkNameAvailabilityHandleResponse(httpResp) + return resp, err } // checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. @@ -220,10 +233,13 @@ func (client *ServiceClient) checkNameAvailabilityCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // checkNameAvailabilityHandleResponse handles the CheckNameAvailability response. @@ -239,8 +255,8 @@ func (client *ServiceClient) checkNameAvailabilityHandleResponse(resp *http.Resp // minutes to complete. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - parameters - Parameters supplied to the CreateOrUpdate API Management service operation. // - options - ServiceClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceClient.BeginCreateOrUpdate @@ -251,7 +267,8 @@ func (client *ServiceClient) BeginCreateOrUpdate(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller[ServiceClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServiceClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServiceClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -261,20 +278,22 @@ func (client *ServiceClient) BeginCreateOrUpdate(ctx context.Context, resourceGr // to complete. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *ServiceClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceResource, options *ServiceClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -297,17 +316,20 @@ func (client *ServiceClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes an existing API Management service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - ServiceClientBeginDeleteOptions contains the optional parameters for the ServiceClient.BeginDelete method. func (client *ServiceClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientBeginDeleteOptions) (*runtime.Poller[ServiceClientDeleteResponse], error) { @@ -316,7 +338,8 @@ func (client *ServiceClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ServiceClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServiceClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServiceClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -325,20 +348,22 @@ func (client *ServiceClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes an existing API Management service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *ServiceClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -361,7 +386,7 @@ func (client *ServiceClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -370,23 +395,26 @@ func (client *ServiceClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets an API Management service resource description. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - ServiceClientGetOptions contains the optional parameters for the ServiceClient.Get method. func (client *ServiceClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientGetOptions) (ServiceClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return ServiceClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServiceClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServiceClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -409,7 +437,7 @@ func (client *ServiceClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -427,22 +455,25 @@ func (client *ServiceClient) getHandleResponse(resp *http.Response) (ServiceClie // GetDomainOwnershipIdentifier - Get the custom domain ownership identifier for an API Management service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 // - options - ServiceClientGetDomainOwnershipIdentifierOptions contains the optional parameters for the ServiceClient.GetDomainOwnershipIdentifier // method. func (client *ServiceClient) GetDomainOwnershipIdentifier(ctx context.Context, options *ServiceClientGetDomainOwnershipIdentifierOptions) (ServiceClientGetDomainOwnershipIdentifierResponse, error) { + var err error req, err := client.getDomainOwnershipIdentifierCreateRequest(ctx, options) if err != nil { return ServiceClientGetDomainOwnershipIdentifierResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServiceClientGetDomainOwnershipIdentifierResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceClientGetDomainOwnershipIdentifierResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServiceClientGetDomainOwnershipIdentifierResponse{}, err } - return client.getDomainOwnershipIdentifierHandleResponse(resp) + resp, err := client.getDomainOwnershipIdentifierHandleResponse(httpResp) + return resp, err } // getDomainOwnershipIdentifierCreateRequest creates the GetDomainOwnershipIdentifier request. @@ -457,7 +488,7 @@ func (client *ServiceClient) getDomainOwnershipIdentifierCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -475,23 +506,26 @@ func (client *ServiceClient) getDomainOwnershipIdentifierHandleResponse(resp *ht // GetSsoToken - Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - ServiceClientGetSsoTokenOptions contains the optional parameters for the ServiceClient.GetSsoToken method. func (client *ServiceClient) GetSsoToken(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientGetSsoTokenOptions) (ServiceClientGetSsoTokenResponse, error) { + var err error req, err := client.getSsoTokenCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return ServiceClientGetSsoTokenResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServiceClientGetSsoTokenResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceClientGetSsoTokenResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServiceClientGetSsoTokenResponse{}, err } - return client.getSsoTokenHandleResponse(resp) + resp, err := client.getSsoTokenHandleResponse(httpResp) + return resp, err } // getSsoTokenCreateRequest creates the GetSsoToken request. @@ -514,7 +548,7 @@ func (client *ServiceClient) getSsoTokenCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -531,7 +565,7 @@ func (client *ServiceClient) getSsoTokenHandleResponse(resp *http.Response) (Ser // NewListPager - Lists all API Management services within an Azure subscription. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 // - options - ServiceClientListOptions contains the optional parameters for the ServiceClient.NewListPager method. func (client *ServiceClient) NewListPager(options *ServiceClientListOptions) *runtime.Pager[ServiceClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ServiceClientListResponse]{ @@ -573,7 +607,7 @@ func (client *ServiceClient) listCreateRequest(ctx context.Context, options *Ser return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -590,8 +624,8 @@ func (client *ServiceClient) listHandleResponse(resp *http.Response) (ServiceCli // NewListByResourceGroupPager - List all API Management services within a resource group. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ServiceClientListByResourceGroupOptions contains the optional parameters for the ServiceClient.NewListByResourceGroupPager // method. func (client *ServiceClient) NewListByResourceGroupPager(resourceGroupName string, options *ServiceClientListByResourceGroupOptions) *runtime.Pager[ServiceClientListByResourceGroupResponse] { @@ -638,7 +672,7 @@ func (client *ServiceClient) listByResourceGroupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -653,13 +687,87 @@ func (client *ServiceClient) listByResourceGroupHandleResponse(resp *http.Respon return result, nil } +// BeginMigrateToStv2 - Upgrades an API Management service to the Stv2 platform. For details refer to https://aka.ms/apim-migrate-stv2. +// This change is not reversible. This is long running operation and could take several +// minutes to complete. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - ServiceClientBeginMigrateToStv2Options contains the optional parameters for the ServiceClient.BeginMigrateToStv2 +// method. +func (client *ServiceClient) BeginMigrateToStv2(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientBeginMigrateToStv2Options) (*runtime.Poller[ServiceClientMigrateToStv2Response], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.migrateToStv2(ctx, resourceGroupName, serviceName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceClientMigrateToStv2Response]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ServiceClientMigrateToStv2Response](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// MigrateToStv2 - Upgrades an API Management service to the Stv2 platform. For details refer to https://aka.ms/apim-migrate-stv2. +// This change is not reversible. This is long running operation and could take several +// minutes to complete. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +func (client *ServiceClient) migrateToStv2(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientBeginMigrateToStv2Options) (*http.Response, error) { + var err error + req, err := client.migrateToStv2CreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// migrateToStv2CreateRequest creates the MigrateToStv2 request. +func (client *ServiceClient) migrateToStv2CreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientBeginMigrateToStv2Options) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/migrateToStv2" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // BeginRestore - Restores a backup of an API Management service created using the ApiManagementService_Backup operation on // the current service. This is a long running operation and could take several minutes to // complete. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - parameters - Parameters supplied to the Restore API Management service from backup operation. // - options - ServiceClientBeginRestoreOptions contains the optional parameters for the ServiceClient.BeginRestore method. @@ -669,9 +777,10 @@ func (client *ServiceClient) BeginRestore(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceClientRestoreResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceClientRestoreResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServiceClientRestoreResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -682,20 +791,22 @@ func (client *ServiceClient) BeginRestore(ctx context.Context, resourceGroupName // complete. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *ServiceClient) restore(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceBackupRestoreParameters, options *ServiceClientBeginRestoreOptions) (*http.Response, error) { + var err error req, err := client.restoreCreateRequest(ctx, resourceGroupName, serviceName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // restoreCreateRequest creates the Restore request. @@ -718,17 +829,20 @@ func (client *ServiceClient) restoreCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginUpdate - Updates an existing API Management service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - parameters - Parameters supplied to the CreateOrUpdate API Management service operation. // - options - ServiceClientBeginUpdateOptions contains the optional parameters for the ServiceClient.BeginUpdate method. @@ -738,7 +852,8 @@ func (client *ServiceClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ServiceClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServiceClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServiceClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -747,20 +862,22 @@ func (client *ServiceClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Updates an existing API Management service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *ServiceClient) update(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceUpdateParameters, options *ServiceClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -783,8 +900,11 @@ func (client *ServiceClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/service_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/service_client_example_test.go index 68055e6f6d13..57981456dc96 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/service_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/service_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementRestoreWithAccessKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementRestoreWithAccessKey.json func ExampleServiceClient_BeginRestore() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -147,7 +147,7 @@ func ExampleServiceClient_BeginRestore() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementBackupWithAccessKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementBackupWithAccessKey.json func ExampleServiceClient_BeginBackup_apiManagementBackupWithAccessKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -276,7 +276,7 @@ func ExampleServiceClient_BeginBackup_apiManagementBackupWithAccessKey() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementBackupWithSystemManagedIdentity.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementBackupWithSystemManagedIdentity.json func ExampleServiceClient_BeginBackup_apiManagementBackupWithSystemManagedIdentity() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -313,16 +313,16 @@ func ExampleServiceClient_BeginBackup_apiManagementBackupWithSystemManagedIdenti // Etag: to.Ptr("AAAAAAAQM8o="), // Identity: &armapimanagement.ServiceIdentity{ // Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("XXXXX-5fb4-4916-95d4-64b306f9d924"), - // TenantID: to.Ptr("XXXXX-86f1-XXXXX-91ab-2d7cd011db47"), + // PrincipalID: to.Ptr("00000000-5fb4-4916-95d4-64b306f9d924"), + // TenantID: to.Ptr("00000000-86f1-0000-91ab-2d7cd011db47"), // UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{ // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/rg1UserIdentity": &armapimanagement.UserIdentityProperties{ - // ClientID: to.Ptr("XXXXX-a154-4830-XXXX-46a12da1a1e2"), - // PrincipalID: to.Ptr("XXXXX-a100-4478-XXXX-d65d98118ba0"), + // ClientID: to.Ptr("00000000-a154-4830-0000-46a12da1a1e2"), + // PrincipalID: to.Ptr("00000000-a100-4478-0000-d65d98118ba0"), // }, // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/vpnpremium": &armapimanagement.UserIdentityProperties{ - // ClientID: to.Ptr("XXXX-6328-4db2-XXXX-ab0e3e7806cf"), - // PrincipalID: to.Ptr("XXXXX-9208-4128-af2d-a10d2af9b5a3"), + // ClientID: to.Ptr("00000000-6328-4db2-0000-ab0e3e7806cf"), + // PrincipalID: to.Ptr("00000000-9208-4128-af2d-a10d2af9b5a3"), // }, // }, // }, @@ -377,7 +377,7 @@ func ExampleServiceClient_BeginBackup_apiManagementBackupWithSystemManagedIdenti // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementBackupWithUserAssignedManagedIdentity.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementBackupWithUserAssignedManagedIdentity.json func ExampleServiceClient_BeginBackup_apiManagementBackupWithUserAssignedManagedIdentity() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -415,16 +415,16 @@ func ExampleServiceClient_BeginBackup_apiManagementBackupWithUserAssignedManaged // Etag: to.Ptr("AAAAAAAQM8o="), // Identity: &armapimanagement.ServiceIdentity{ // Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("XXXXX-5fb4-4916-95d4-64b306f9d924"), - // TenantID: to.Ptr("XXXXX-86f1-XXXXX-91ab-2d7cd011db47"), + // PrincipalID: to.Ptr("00000000-5fb4-4916-95d4-64b306f9d924"), + // TenantID: to.Ptr("00000000-86f1-0000-91ab-2d7cd011db47"), // UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{ // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/rg1UserIdentity": &armapimanagement.UserIdentityProperties{ - // ClientID: to.Ptr("XXXXX-a154-4830-XXXX-46a12da1a1e2"), - // PrincipalID: to.Ptr("XXXXX-a100-4478-XXXX-d65d98118ba0"), + // ClientID: to.Ptr("00000000-a154-4830-0000-46a12da1a1e2"), + // PrincipalID: to.Ptr("00000000-a100-4478-0000-d65d98118ba0"), // }, // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/vpnpremium": &armapimanagement.UserIdentityProperties{ - // ClientID: to.Ptr("XXXX-6328-4db2-XXXX-ab0e3e7806cf"), - // PrincipalID: to.Ptr("XXXXX-9208-4128-af2d-a10d2af9b5a3"), + // ClientID: to.Ptr("00000000-6328-4db2-0000-ab0e3e7806cf"), + // PrincipalID: to.Ptr("00000000-9208-4128-af2d-a10d2af9b5a3"), // }, // }, // }, @@ -479,7 +479,7 @@ func ExampleServiceClient_BeginBackup_apiManagementBackupWithUserAssignedManaged // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateMultiRegionServiceWithCustomHostname.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateMultiRegionServiceWithCustomHostname.json func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateMultiRegionServiceWithCustomHostname() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -650,7 +650,7 @@ func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateMultiRegionServ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateService.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateService.json func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateService() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -691,15 +691,12 @@ func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateService() { // Type: to.Ptr("Microsoft.ApiManagement/service"), // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"), // Tags: map[string]*string{ - // "Name": to.Ptr("Contoso"), - // "Test": to.Ptr("User"), + // "api-version": to.Ptr("2022-08-01"), // }, - // Etag: to.Ptr("AAAAAAAp3T4="), - // Location: to.Ptr("South Central US"), + // Etag: to.Ptr("AAAAAAAmREI="), + // Location: to.Ptr("East US"), // Properties: &armapimanagement.ServiceProperties{ - // APIVersionConstraint: &armapimanagement.APIVersionConstraint{ - // }, - // CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-18T06:10:56.0327105Z"); return t}()), + // CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-11T18:41:01.2506031Z"); return t}()), // CustomProperties: map[string]*string{ // "Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("False"), // "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"), @@ -712,7 +709,7 @@ func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateService() { // }, // DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"), // DisableGateway: to.Ptr(false), - // GatewayRegionalURL: to.Ptr("https://apimService1-southcentralus-01.regional.azure-api.net"), + // GatewayRegionalURL: to.Ptr("https://apimService1-eastus-01.regional.azure-api.net"), // GatewayURL: to.Ptr("https://apimService1.azure-api.net"), // HostnameConfigurations: []*armapimanagement.HostnameConfiguration{ // { @@ -724,32 +721,34 @@ func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateService() { // }}, // ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"), // NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"), + // PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv1), // PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"), // ProvisioningState: to.Ptr("Succeeded"), // PublicIPAddresses: []*string{ - // to.Ptr("23.102.171.124")}, + // to.Ptr("13.90.229.33")}, + // PublicNetworkAccess: to.Ptr(armapimanagement.PublicNetworkAccessEnabled), // ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"), // TargetProvisioningState: to.Ptr(""), // VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone), - // PublisherEmail: to.Ptr("foo@contoso.com"), + // PublisherEmail: to.Ptr("samir@microsoft.com"), // PublisherName: to.Ptr("foo"), // }, // SKU: &armapimanagement.ServiceSKUProperties{ - // Name: to.Ptr(armapimanagement.SKUTypeDeveloper), + // Name: to.Ptr(armapimanagement.SKUTypeStandard), // Capacity: to.Ptr[int32](1), // }, // SystemData: &armapimanagement.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-01T01:01:01.1075056Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armapimanagement.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-02T02:03:01.1974346Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeApplication), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-11T18:41:00.9390609Z"); return t}()), + // CreatedBy: to.Ptr("user@contoso.com"), + // CreatedByType: to.Ptr(armapimanagement.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-11T18:41:00.9390609Z"); return t}()), + // LastModifiedBy: to.Ptr("user@contoso.com"), + // LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeUser), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateServiceHavingMsi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceHavingMsi.json func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceHavingMsi() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -802,7 +801,7 @@ func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceHavingMs // Identity: &armapimanagement.ServiceIdentity{ // Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssigned), // PrincipalID: to.Ptr("dfb9a757-df69-4966-a8d0-711a9cd8ffb4"), - // TenantID: to.Ptr("XXXXXX-86f1-41af-91ab-2d7cd011db47"), + // TenantID: to.Ptr("00000000-86f1-41af-91ab-2d7cd011db47"), // }, // Location: to.Ptr("West US"), // Properties: &armapimanagement.ServiceProperties{ @@ -840,7 +839,7 @@ func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceHavingMs // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateServiceInVnetWithPublicIP.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceInVnetWithPublicIP.json func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceInVnetWithPublicIp() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -954,7 +953,7 @@ func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceInVnetWi // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateServiceInZones.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceInZones.json func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceInZones() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1059,7 +1058,7 @@ func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceInZones( // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateServiceWithCustomHostnameKeyVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceWithCustomHostnameKeyVault.json func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceWithCustomHostnameKeyVault() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1138,11 +1137,11 @@ func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceWithCust // Etag: to.Ptr("AAAAAAAigjU="), // Identity: &armapimanagement.ServiceIdentity{ // Type: to.Ptr(armapimanagement.ApimIdentityTypeUserAssigned), - // TenantID: to.Ptr("f686d426-8d16-xxxx-xxxx-ab578e110ccd"), + // TenantID: to.Ptr("f686d426-8d16-0000-0000-ab578e110ccd"), // UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{ // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armapimanagement.UserIdentityProperties{ // ClientID: to.Ptr("329419bc-adec-4dce-9568-25a6d486e468"), - // PrincipalID: to.Ptr("15e769b2-xxxx-xxxx-xxxx-3fd9a923ac3a"), + // PrincipalID: to.Ptr("15e769b2-0000-0000-0000-3fd9a923ac3a"), // }, // }, // }, @@ -1244,7 +1243,112 @@ func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceWithCust // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateServiceWithSystemCertificates.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceWithNatGatewayEnabled.json +func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceWithNatGatewayEnabled() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServiceClient().BeginCreateOrUpdate(ctx, "rg1", "apimService1", armapimanagement.ServiceResource{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + "tag3": to.Ptr("value3"), + }, + Location: to.Ptr("East US"), + Properties: &armapimanagement.ServiceProperties{ + NatGatewayState: to.Ptr(armapimanagement.NatGatewayStateEnabled), + PublisherEmail: to.Ptr("apim@autorestsdk.com"), + PublisherName: to.Ptr("autorestsdk"), + }, + SKU: &armapimanagement.ServiceSKUProperties{ + Name: to.Ptr(armapimanagement.SKUTypePremium), + Capacity: to.Ptr[int32](1), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ServiceResource = armapimanagement.ServiceResource{ + // Name: to.Ptr("apimService1"), + // Type: to.Ptr("Microsoft.ApiManagement/service"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"), + // Tags: map[string]*string{ + // "api-version": to.Ptr("2022-08-01"), + // }, + // Etag: to.Ptr("AAAAAAAmREI="), + // Location: to.Ptr("East US"), + // Properties: &armapimanagement.ServiceProperties{ + // APIVersionConstraint: &armapimanagement.APIVersionConstraint{ + // }, + // CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-26T18:41:01.2506031Z"); return t}()), + // CustomProperties: map[string]*string{ + // "Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2": to.Ptr("false"), + // "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("false"), + // "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("false"), + // "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("false"), + // "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("false"), + // "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("false"), + // "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("false"), + // "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("false"), + // }, + // DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"), + // DisableGateway: to.Ptr(false), + // GatewayRegionalURL: to.Ptr("https://apimService1-eastus-01.regional.azure-api.net"), + // GatewayURL: to.Ptr("https://apimService1.azure-api.net"), + // HostnameConfigurations: []*armapimanagement.HostnameConfiguration{ + // { + // Type: to.Ptr(armapimanagement.HostnameTypeProxy), + // CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn), + // DefaultSSLBinding: to.Ptr(true), + // HostName: to.Ptr("apimService1.azure-api.net"), + // NegotiateClientCertificate: to.Ptr(false), + // }}, + // ManagementAPIURL: to.Ptr("https://apimService1.management.azure-api.net"), + // NatGatewayState: to.Ptr(armapimanagement.NatGatewayStateEnabled), + // NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"), + // OutboundPublicIPAddresses: []*string{ + // to.Ptr("60.0.0.0/31")}, + // PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv2), + // PortalURL: to.Ptr("https://apimService1.portal.azure-api.net"), + // ProvisioningState: to.Ptr("Succeeded"), + // PublicIPAddresses: []*string{ + // to.Ptr("13.90.229.33")}, + // PublicNetworkAccess: to.Ptr(armapimanagement.PublicNetworkAccessEnabled), + // ScmURL: to.Ptr("https://apimService1.scm.azure-api.net"), + // TargetProvisioningState: to.Ptr(""), + // VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone), + // PublisherEmail: to.Ptr("apim@autorestsdk.com"), + // PublisherName: to.Ptr("autorestsdk"), + // }, + // SKU: &armapimanagement.ServiceSKUProperties{ + // Name: to.Ptr(armapimanagement.SKUTypePremium), + // Capacity: to.Ptr[int32](1), + // }, + // SystemData: &armapimanagement.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-11T18:41:00.9390609Z"); return t}()), + // CreatedBy: to.Ptr("user@contoso.com"), + // CreatedByType: to.Ptr(armapimanagement.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-11T18:41:00.9390609Z"); return t}()), + // LastModifiedBy: to.Ptr("user@contoso.com"), + // LastModifiedByType: to.Ptr(armapimanagement.CreatedByTypeUser), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceWithSystemCertificates.json func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceWithSystemCertificates() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1361,7 +1465,7 @@ func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceWithSyst // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateServiceWithUserAssignedIdentity.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateServiceWithUserAssignedIdentity.json func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceWithUserAssignedIdentity() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1416,11 +1520,11 @@ func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceWithUser // Etag: to.Ptr("AAAAAAAFzyk="), // Identity: &armapimanagement.ServiceIdentity{ // Type: to.Ptr(armapimanagement.ApimIdentityTypeUserAssigned), - // TenantID: to.Ptr("XXXXX-86f1-41af-XXXX-2d7cd011db47"), + // TenantID: to.Ptr("00000000-86f1-41af-0000-2d7cd011db47"), // UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{ // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/apimService1": &armapimanagement.UserIdentityProperties{ - // ClientID: to.Ptr("5a2c6b8e-0905-XXXX-a772-993c9418137f"), - // PrincipalID: to.Ptr("XXXXX-6e62-4649-9f54-a119fc1ba85e"), + // ClientID: to.Ptr("5a2c6b8e-0905-0000-a772-993c9418137f"), + // PrincipalID: to.Ptr("00000000-6e62-4649-9f54-a119fc1ba85e"), // }, // }, // }, @@ -1468,7 +1572,7 @@ func ExampleServiceClient_BeginCreateOrUpdate_apiManagementCreateServiceWithUser // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUndelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUndelete.json func ExampleServiceClient_BeginCreateOrUpdate_apiManagementUndelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1551,7 +1655,7 @@ func ExampleServiceClient_BeginCreateOrUpdate_apiManagementUndelete() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateServiceDisableTls10.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateServiceDisableTls10.json func ExampleServiceClient_BeginUpdate_apiManagementUpdateServiceDisableTls10() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1620,7 +1724,7 @@ func ExampleServiceClient_BeginUpdate_apiManagementUpdateServiceDisableTls10() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateServicePublisherDetails.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateServicePublisherDetails.json func ExampleServiceClient_BeginUpdate_apiManagementUpdateServicePublisherDetails() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1688,7 +1792,7 @@ func ExampleServiceClient_BeginUpdate_apiManagementUpdateServicePublisherDetails // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateServiceToNewVnetAndAZs.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateServiceToNewVnetAndAZs.json func ExampleServiceClient_BeginUpdate_apiManagementUpdateServiceToNewVnetAndAvailabilityZones() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1846,7 +1950,7 @@ func ExampleServiceClient_BeginUpdate_apiManagementUpdateServiceToNewVnetAndAvai // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetMultiRegionInternalVnet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementServiceGetMultiRegionInternalVnet.json func ExampleServiceClient_Get_apiManagementServiceGetMultiRegionInternalVnet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1950,7 +2054,7 @@ func ExampleServiceClient_Get_apiManagementServiceGetMultiRegionInternalVnet() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetService.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementServiceGetService.json func ExampleServiceClient_Get_apiManagementServiceGetService() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2120,7 +2224,7 @@ func ExampleServiceClient_Get_apiManagementServiceGetService() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetServiceHavingMsi.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementServiceGetServiceHavingMsi.json func ExampleServiceClient_Get_apiManagementServiceGetServiceHavingMsi() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2147,12 +2251,12 @@ func ExampleServiceClient_Get_apiManagementServiceGetServiceHavingMsi() { // Etag: to.Ptr("AAAAAAAENfI="), // Identity: &armapimanagement.ServiceIdentity{ // Type: to.Ptr(armapimanagement.ApimIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("ca1d33f7-xxxx-42ec-xxxx-d526a1ee953a"), - // TenantID: to.Ptr("72f988bf-xxxx-41af-xxxx-2d7cd011db47"), + // PrincipalID: to.Ptr("ca1d33f7-0000-42ec-0000-d526a1ee953a"), + // TenantID: to.Ptr("72f988bf-0000-41af-0000-2d7cd011db47"), // UserAssignedIdentities: map[string]*armapimanagement.UserIdentityProperties{ // "/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/apimService1": &armapimanagement.UserIdentityProperties{ - // ClientID: to.Ptr("aaff9c7d-xxxx-4db2-xxxx-ab0e3e7806cf"), - // PrincipalID: to.Ptr("95194df2-9208-xxxx-xxxx-a10d2af9b5a3"), + // ClientID: to.Ptr("aaff9c7d-0000-4db2-0000-ab0e3e7806cf"), + // PrincipalID: to.Ptr("95194df2-9208-0000-0000-a10d2af9b5a3"), // }, // }, // }, @@ -2216,7 +2320,7 @@ func ExampleServiceClient_Get_apiManagementServiceGetServiceHavingMsi() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceDeleteService.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementServiceDeleteService.json func ExampleServiceClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2237,7 +2341,116 @@ func ExampleServiceClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListServiceBySubscriptionAndResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementServiceMigrateToStv2.json +func ExampleServiceClient_BeginMigrateToStv2() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armapimanagement.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServiceClient().BeginMigrateToStv2(ctx, "rg1", "apimService1", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ServiceResource = armapimanagement.ServiceResource{ + // Name: to.Ptr("apimservice1"), + // Type: to.Ptr("Microsoft.ApiManagement/service"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimservice1"), + // Tags: map[string]*string{ + // }, + // Etag: to.Ptr("AAAAAADqC0c="), + // Location: to.Ptr("West US"), + // Properties: &armapimanagement.ServiceProperties{ + // AdditionalLocations: []*armapimanagement.AdditionalLocation{ + // { + // DisableGateway: to.Ptr(false), + // GatewayRegionalURL: to.Ptr("https://apimservice1-westus2-01.regional.azure-api.net"), + // Location: to.Ptr("West US 2"), + // PrivateIPAddresses: []*string{ + // to.Ptr("10.0.X.6")}, + // PublicIPAddresses: []*string{ + // to.Ptr("40.XXX.79.187")}, + // SKU: &armapimanagement.ServiceSKUProperties{ + // Name: to.Ptr(armapimanagement.SKUTypePremium), + // Capacity: to.Ptr[int32](1), + // }, + // VirtualNetworkConfiguration: &armapimanagement.VirtualNetworkConfiguration{ + // SubnetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/APIMVNet/subnets/apim-internal-sub"), + // }, + // }}, + // APIVersionConstraint: &armapimanagement.APIVersionConstraint{ + // }, + // CreatedAtUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-02T01:42:09.1268424Z"); return t}()), + // CustomProperties: map[string]*string{ + // "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Ssl30": to.Ptr("False"), + // "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10": to.Ptr("True"), + // "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11": to.Ptr("True"), + // "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168": to.Ptr("True"), + // "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Ssl30": to.Ptr("False"), + // "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("True"), + // "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11": to.Ptr("True"), + // }, + // DeveloperPortalURL: to.Ptr("https://apimService1.developer.azure-api.net"), + // DisableGateway: to.Ptr(false), + // GatewayRegionalURL: to.Ptr("https://apimservice1-westus-01.regional.azure-api.net"), + // GatewayURL: to.Ptr("https://apimservice1.azure-api.net"), + // HostnameConfigurations: []*armapimanagement.HostnameConfiguration{ + // { + // Type: to.Ptr(armapimanagement.HostnameTypeProxy), + // CertificateSource: to.Ptr(armapimanagement.CertificateSourceBuiltIn), + // DefaultSSLBinding: to.Ptr(false), + // HostName: to.Ptr("apimService1.azure-api.net"), + // NegotiateClientCertificate: to.Ptr(false), + // }, + // { + // Type: to.Ptr(armapimanagement.HostnameTypeProxy), + // Certificate: &armapimanagement.CertificateInformation{ + // Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-08-16T16:51:34+00:00"); return t}()), + // Subject: to.Ptr("CN=*.preview.net"), + // Thumbprint: to.Ptr("B4330123DBAXXXXXXXXX1F35E84493476"), + // }, + // CertificateSource: to.Ptr(armapimanagement.CertificateSourceCustom), + // DefaultSSLBinding: to.Ptr(true), + // HostName: to.Ptr("apimgatewaytest.preview.net"), + // NegotiateClientCertificate: to.Ptr(false), + // }}, + // ManagementAPIURL: to.Ptr("https://apimservice1.management.azure-api.net"), + // NotificationSenderEmail: to.Ptr("apimgmt-noreply@mail.windowsazure.com"), + // PlatformVersion: to.Ptr(armapimanagement.PlatformVersionStv1), + // PortalURL: to.Ptr("https://apimservice1.portal.azure-api.net"), + // PrivateIPAddresses: []*string{ + // to.Ptr("172.XX.0.5")}, + // ProvisioningState: to.Ptr("Succeeded"), + // PublicIPAddresses: []*string{ + // to.Ptr("137.XXX.11.74")}, + // ScmURL: to.Ptr("https://apimservice1.scm.azure-api.net"), + // TargetProvisioningState: to.Ptr(""), + // VirtualNetworkConfiguration: &armapimanagement.VirtualNetworkConfiguration{ + // SubnetResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/apim-appGateway-vnet/subnets/apim-subnet"), + // }, + // VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeInternal), + // PublisherEmail: to.Ptr("abcs@contoso.com"), + // PublisherName: to.Ptr("contoso publisher"), + // }, + // SKU: &armapimanagement.ServiceSKUProperties{ + // Name: to.Ptr(armapimanagement.SKUTypePremium), + // Capacity: to.Ptr[int32](1), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListServiceBySubscriptionAndResourceGroup.json func ExampleServiceClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2599,7 +2812,7 @@ func ExampleServiceClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListServiceBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListServiceBySubscription.json func ExampleServiceClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2961,7 +3174,7 @@ func ExampleServiceClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetSsoToken.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementServiceGetSsoToken.json func ExampleServiceClient_GetSsoToken() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -2984,7 +3197,7 @@ func ExampleServiceClient_GetSsoToken() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceCheckNameAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementServiceCheckNameAvailability.json func ExampleServiceClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -3011,7 +3224,7 @@ func ExampleServiceClient_CheckNameAvailability() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetDomainOwnershipIdentifier.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementServiceGetDomainOwnershipIdentifier.json func ExampleServiceClient_GetDomainOwnershipIdentifier() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -3034,7 +3247,7 @@ func ExampleServiceClient_GetDomainOwnershipIdentifier() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementApplyNetworkConfigurationUpdates.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementApplyNetworkConfigurationUpdates.json func ExampleServiceClient_BeginApplyNetworkConfigurationUpdates() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/serviceskus_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/serviceskus_client.go index 94f4397cd246..0d3b0f84e688 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/serviceskus_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/serviceskus_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type ServiceSKUsClient struct { } // NewServiceSKUsClient creates a new instance of ServiceSKUsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewServiceSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceSKUsClient, error) { @@ -47,8 +45,8 @@ func NewServiceSKUsClient(subscriptionID string, credential azcore.TokenCredenti // NewListAvailableServiceSKUsPager - Gets all available SKU for a given API Management service // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - ServiceSKUsClientListAvailableServiceSKUsOptions contains the optional parameters for the ServiceSKUsClient.NewListAvailableServiceSKUsPager // method. @@ -100,7 +98,7 @@ func (client *ServiceSKUsClient) listAvailableServiceSKUsCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/serviceskus_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/serviceskus_client_example_test.go index 2bf4a6656e94..8959741ec5e7 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/serviceskus_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/serviceskus_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSKUs-Consumption.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListSKUs-Consumption.json func ExampleServiceSKUsClient_NewListAvailableServiceSKUsPager_apiManagementListSkUsConsumption() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -51,7 +51,7 @@ func ExampleServiceSKUsClient_NewListAvailableServiceSKUsPager_apiManagementList } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSKUs-Dedicated.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListSKUs-Dedicated.json func ExampleServiceSKUsClient_NewListAvailableServiceSKUsPager_apiManagementListSkUsDedicated() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/signinsettings_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/signinsettings_client.go index 0437d061891c..11c0a5fedad2 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/signinsettings_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/signinsettings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type SignInSettingsClient struct { } // NewSignInSettingsClient creates a new instance of SignInSettingsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewSignInSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SignInSettingsClient, error) { @@ -48,25 +46,28 @@ func NewSignInSettingsClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Create or Update Sign-In settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - parameters - Create or update parameters. // - options - SignInSettingsClientCreateOrUpdateOptions contains the optional parameters for the SignInSettingsClient.CreateOrUpdate // method. func (client *SignInSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSigninSettings, options *SignInSettingsClientCreateOrUpdateOptions) (SignInSettingsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, parameters, options) if err != nil { return SignInSettingsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SignInSettingsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SignInSettingsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SignInSettingsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -89,13 +90,16 @@ func (client *SignInSettingsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -110,23 +114,26 @@ func (client *SignInSettingsClient) createOrUpdateHandleResponse(resp *http.Resp // Get - Get Sign In Settings for the Portal // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - SignInSettingsClientGetOptions contains the optional parameters for the SignInSettingsClient.Get method. func (client *SignInSettingsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *SignInSettingsClientGetOptions) (SignInSettingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return SignInSettingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SignInSettingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SignInSettingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SignInSettingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -149,7 +156,7 @@ func (client *SignInSettingsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -169,24 +176,27 @@ func (client *SignInSettingsClient) getHandleResponse(resp *http.Response) (Sign // GetEntityTag - Gets the entity state (Etag) version of the SignInSettings. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - SignInSettingsClientGetEntityTagOptions contains the optional parameters for the SignInSettingsClient.GetEntityTag // method. func (client *SignInSettingsClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, options *SignInSettingsClientGetEntityTagOptions) (SignInSettingsClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return SignInSettingsClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SignInSettingsClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SignInSettingsClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SignInSettingsClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -209,7 +219,7 @@ func (client *SignInSettingsClient) getEntityTagCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -228,24 +238,26 @@ func (client *SignInSettingsClient) getEntityTagHandleResponse(resp *http.Respon // Update - Update Sign-In settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - parameters - Update Sign-In settings. // - options - SignInSettingsClientUpdateOptions contains the optional parameters for the SignInSettingsClient.Update method. func (client *SignInSettingsClient) Update(ctx context.Context, resourceGroupName string, serviceName string, ifMatch string, parameters PortalSigninSettings, options *SignInSettingsClientUpdateOptions) (SignInSettingsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, ifMatch, parameters, options) if err != nil { return SignInSettingsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SignInSettingsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return SignInSettingsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return SignInSettingsClientUpdateResponse{}, err } return SignInSettingsClientUpdateResponse{}, nil } @@ -270,9 +282,12 @@ func (client *SignInSettingsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/signinsettings_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/signinsettings_client_example_test.go index 04cd12af7ffa..8d0062bab6f7 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/signinsettings_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/signinsettings_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadSignInSettings.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadSignInSettings.json func ExampleSignInSettingsClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -35,7 +35,7 @@ func ExampleSignInSettingsClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsGetSignIn.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementPortalSettingsGetSignIn.json func ExampleSignInSettingsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -63,7 +63,7 @@ func ExampleSignInSettingsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsUpdateSignIn.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementPortalSettingsUpdateSignIn.json func ExampleSignInSettingsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -84,7 +84,7 @@ func ExampleSignInSettingsClient_Update() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsPutSignIn.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementPortalSettingsPutSignIn.json func ExampleSignInSettingsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/signupsettings_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/signupsettings_client.go index 7829fdecefe9..63e38fc366dc 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/signupsettings_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/signupsettings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type SignUpSettingsClient struct { } // NewSignUpSettingsClient creates a new instance of SignUpSettingsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewSignUpSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SignUpSettingsClient, error) { @@ -48,25 +46,28 @@ func NewSignUpSettingsClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Create or Update Sign-Up settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - parameters - Create or update parameters. // - options - SignUpSettingsClientCreateOrUpdateOptions contains the optional parameters for the SignUpSettingsClient.CreateOrUpdate // method. func (client *SignUpSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSignupSettings, options *SignUpSettingsClientCreateOrUpdateOptions) (SignUpSettingsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, parameters, options) if err != nil { return SignUpSettingsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SignUpSettingsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SignUpSettingsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SignUpSettingsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -89,13 +90,16 @@ func (client *SignUpSettingsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -110,23 +114,26 @@ func (client *SignUpSettingsClient) createOrUpdateHandleResponse(resp *http.Resp // Get - Get Sign Up Settings for the Portal // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - SignUpSettingsClientGetOptions contains the optional parameters for the SignUpSettingsClient.Get method. func (client *SignUpSettingsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *SignUpSettingsClientGetOptions) (SignUpSettingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return SignUpSettingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SignUpSettingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SignUpSettingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SignUpSettingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -149,7 +156,7 @@ func (client *SignUpSettingsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -169,24 +176,27 @@ func (client *SignUpSettingsClient) getHandleResponse(resp *http.Response) (Sign // GetEntityTag - Gets the entity state (Etag) version of the SignUpSettings. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - SignUpSettingsClientGetEntityTagOptions contains the optional parameters for the SignUpSettingsClient.GetEntityTag // method. func (client *SignUpSettingsClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, options *SignUpSettingsClientGetEntityTagOptions) (SignUpSettingsClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return SignUpSettingsClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SignUpSettingsClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SignUpSettingsClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SignUpSettingsClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -209,7 +219,7 @@ func (client *SignUpSettingsClient) getEntityTagCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -228,24 +238,26 @@ func (client *SignUpSettingsClient) getEntityTagHandleResponse(resp *http.Respon // Update - Update Sign-Up settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - parameters - Update Sign-Up settings. // - options - SignUpSettingsClientUpdateOptions contains the optional parameters for the SignUpSettingsClient.Update method. func (client *SignUpSettingsClient) Update(ctx context.Context, resourceGroupName string, serviceName string, ifMatch string, parameters PortalSignupSettings, options *SignUpSettingsClientUpdateOptions) (SignUpSettingsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, ifMatch, parameters, options) if err != nil { return SignUpSettingsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SignUpSettingsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return SignUpSettingsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return SignUpSettingsClientUpdateResponse{}, err } return SignUpSettingsClientUpdateResponse{}, nil } @@ -270,9 +282,12 @@ func (client *SignUpSettingsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/signupsettings_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/signupsettings_client_example_test.go index c11b98ad9bf6..a3897bf8f0cb 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/signupsettings_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/signupsettings_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadSignUpSettings.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadSignUpSettings.json func ExampleSignUpSettingsClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -35,7 +35,7 @@ func ExampleSignUpSettingsClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsGetSignUp.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementPortalSettingsGetSignUp.json func ExampleSignUpSettingsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -68,7 +68,7 @@ func ExampleSignUpSettingsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsUpdateSignUp.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementPortalSettingsUpdateSignUp.json func ExampleSignUpSettingsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -94,7 +94,7 @@ func ExampleSignUpSettingsClient_Update() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsPutSignUp.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementPortalSettingsPutSignUp.json func ExampleSignUpSettingsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/skus_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/skus_client.go index ff7ca81e9312..5abd75c35e90 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/skus_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/skus_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type SKUsClient struct { } // NewSKUsClient creates a new instance of SKUsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SKUsClient, error) { @@ -47,7 +45,7 @@ func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, opt // NewListPager - Gets the list of Microsoft.ApiManagement SKUs available for your Subscription. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 // - options - SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method. func (client *SKUsClient) NewListPager(options *SKUsClientListOptions) *runtime.Pager[SKUsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SKUsClientListResponse]{ @@ -89,7 +87,7 @@ func (client *SKUsClient) listCreateRequest(ctx context.Context, options *SKUsCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/skus_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/skus_client_example_test.go index ee2475cd838c..3e3de48abc9f 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/skus_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/skus_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSku.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListSku.json func ExampleSKUsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/subscription_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/subscription_client.go index 5c1dc5ba06bb..94b1e84bec3b 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/subscription_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/subscription_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type SubscriptionClient struct { } // NewSubscriptionClient creates a new instance of SubscriptionClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewSubscriptionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubscriptionClient, error) { @@ -49,26 +47,29 @@ func NewSubscriptionClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Creates or updates the subscription of specified user to the specified product. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. // - parameters - Create parameters. // - options - SubscriptionClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionClient.CreateOrUpdate // method. func (client *SubscriptionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, sid string, parameters SubscriptionCreateParameters, options *SubscriptionClientCreateOrUpdateOptions) (SubscriptionClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, sid, parameters, options) if err != nil { return SubscriptionClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SubscriptionClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return SubscriptionClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return SubscriptionClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -98,7 +99,7 @@ func (client *SubscriptionClient) createOrUpdateCreateRequest(ctx context.Contex if options != nil && options.Notify != nil { reqQP.Set("notify", strconv.FormatBool(*options.Notify)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") if options != nil && options.AppType != nil { reqQP.Set("appType", string(*options.AppType)) } @@ -107,7 +108,10 @@ func (client *SubscriptionClient) createOrUpdateCreateRequest(ctx context.Contex req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -125,24 +129,26 @@ func (client *SubscriptionClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Deletes the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - options - SubscriptionClientDeleteOptions contains the optional parameters for the SubscriptionClient.Delete method. func (client *SubscriptionClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, sid string, ifMatch string, options *SubscriptionClientDeleteOptions) (SubscriptionClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, sid, ifMatch, options) if err != nil { return SubscriptionClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SubscriptionClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return SubscriptionClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return SubscriptionClientDeleteResponse{}, err } return SubscriptionClientDeleteResponse{}, nil } @@ -171,7 +177,7 @@ func (client *SubscriptionClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -181,24 +187,27 @@ func (client *SubscriptionClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets the specified Subscription entity. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. // - options - SubscriptionClientGetOptions contains the optional parameters for the SubscriptionClient.Get method. func (client *SubscriptionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, sid string, options *SubscriptionClientGetOptions) (SubscriptionClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, sid, options) if err != nil { return SubscriptionClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SubscriptionClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SubscriptionClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SubscriptionClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -225,7 +234,7 @@ func (client *SubscriptionClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -245,25 +254,28 @@ func (client *SubscriptionClient) getHandleResponse(resp *http.Response) (Subscr // GetEntityTag - Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. // - options - SubscriptionClientGetEntityTagOptions contains the optional parameters for the SubscriptionClient.GetEntityTag // method. func (client *SubscriptionClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, sid string, options *SubscriptionClientGetEntityTagOptions) (SubscriptionClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, sid, options) if err != nil { return SubscriptionClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SubscriptionClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SubscriptionClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SubscriptionClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -290,7 +302,7 @@ func (client *SubscriptionClient) getEntityTagCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -308,8 +320,8 @@ func (client *SubscriptionClient) getEntityTagHandleResponse(resp *http.Response // NewListPager - Lists all subscriptions of the API Management service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - SubscriptionClientListOptions contains the optional parameters for the SubscriptionClient.NewListPager method. func (client *SubscriptionClient) NewListPager(resourceGroupName string, serviceName string, options *SubscriptionClientListOptions) *runtime.Pager[SubscriptionClientListResponse] { @@ -369,7 +381,7 @@ func (client *SubscriptionClient) listCreateRequest(ctx context.Context, resourc if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -387,25 +399,28 @@ func (client *SubscriptionClient) listHandleResponse(resp *http.Response) (Subsc // ListSecrets - Gets the specified Subscription keys. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. // - options - SubscriptionClientListSecretsOptions contains the optional parameters for the SubscriptionClient.ListSecrets // method. func (client *SubscriptionClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, sid string, options *SubscriptionClientListSecretsOptions) (SubscriptionClientListSecretsResponse, error) { + var err error req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, serviceName, sid, options) if err != nil { return SubscriptionClientListSecretsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SubscriptionClientListSecretsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SubscriptionClientListSecretsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SubscriptionClientListSecretsResponse{}, err } - return client.listSecretsHandleResponse(resp) + resp, err := client.listSecretsHandleResponse(httpResp) + return resp, err } // listSecretsCreateRequest creates the ListSecrets request. @@ -432,7 +447,7 @@ func (client *SubscriptionClient) listSecretsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -453,23 +468,25 @@ func (client *SubscriptionClient) listSecretsHandleResponse(resp *http.Response) // RegeneratePrimaryKey - Regenerates primary key of existing subscription of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. // - options - SubscriptionClientRegeneratePrimaryKeyOptions contains the optional parameters for the SubscriptionClient.RegeneratePrimaryKey // method. func (client *SubscriptionClient) RegeneratePrimaryKey(ctx context.Context, resourceGroupName string, serviceName string, sid string, options *SubscriptionClientRegeneratePrimaryKeyOptions) (SubscriptionClientRegeneratePrimaryKeyResponse, error) { + var err error req, err := client.regeneratePrimaryKeyCreateRequest(ctx, resourceGroupName, serviceName, sid, options) if err != nil { return SubscriptionClientRegeneratePrimaryKeyResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SubscriptionClientRegeneratePrimaryKeyResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return SubscriptionClientRegeneratePrimaryKeyResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return SubscriptionClientRegeneratePrimaryKeyResponse{}, err } return SubscriptionClientRegeneratePrimaryKeyResponse{}, nil } @@ -498,7 +515,7 @@ func (client *SubscriptionClient) regeneratePrimaryKeyCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -507,23 +524,25 @@ func (client *SubscriptionClient) regeneratePrimaryKeyCreateRequest(ctx context. // RegenerateSecondaryKey - Regenerates secondary key of existing subscription of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. // - options - SubscriptionClientRegenerateSecondaryKeyOptions contains the optional parameters for the SubscriptionClient.RegenerateSecondaryKey // method. func (client *SubscriptionClient) RegenerateSecondaryKey(ctx context.Context, resourceGroupName string, serviceName string, sid string, options *SubscriptionClientRegenerateSecondaryKeyOptions) (SubscriptionClientRegenerateSecondaryKeyResponse, error) { + var err error req, err := client.regenerateSecondaryKeyCreateRequest(ctx, resourceGroupName, serviceName, sid, options) if err != nil { return SubscriptionClientRegenerateSecondaryKeyResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SubscriptionClientRegenerateSecondaryKeyResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return SubscriptionClientRegenerateSecondaryKeyResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return SubscriptionClientRegenerateSecondaryKeyResponse{}, err } return SubscriptionClientRegenerateSecondaryKeyResponse{}, nil } @@ -552,7 +571,7 @@ func (client *SubscriptionClient) regenerateSecondaryKeyCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -561,8 +580,8 @@ func (client *SubscriptionClient) regenerateSecondaryKeyCreateRequest(ctx contex // Update - Updates the details of a subscription specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -570,18 +589,21 @@ func (client *SubscriptionClient) regenerateSecondaryKeyCreateRequest(ctx contex // - parameters - Update parameters. // - options - SubscriptionClientUpdateOptions contains the optional parameters for the SubscriptionClient.Update method. func (client *SubscriptionClient) Update(ctx context.Context, resourceGroupName string, serviceName string, sid string, ifMatch string, parameters SubscriptionUpdateParameters, options *SubscriptionClientUpdateOptions) (SubscriptionClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, sid, ifMatch, parameters, options) if err != nil { return SubscriptionClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SubscriptionClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SubscriptionClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SubscriptionClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -611,14 +633,17 @@ func (client *SubscriptionClient) updateCreateRequest(ctx context.Context, resou if options != nil && options.Notify != nil { reqQP.Set("notify", strconv.FormatBool(*options.Notify)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") if options != nil && options.AppType != nil { reqQP.Set("appType", string(*options.AppType)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/subscription_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/subscription_client_example_test.go index 22d8e3c71712..5b955100efad 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/subscription_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/subscription_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSubscriptions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListSubscriptions.json func ExampleSubscriptionClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -88,7 +88,7 @@ func ExampleSubscriptionClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadSubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadSubscription.json func ExampleSubscriptionClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -105,7 +105,7 @@ func ExampleSubscriptionClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetSubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetSubscription.json func ExampleSubscriptionClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -137,7 +137,7 @@ func ExampleSubscriptionClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateSubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateSubscription.json func ExampleSubscriptionClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -178,7 +178,7 @@ func ExampleSubscriptionClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateSubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateSubscription.json func ExampleSubscriptionClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -216,7 +216,7 @@ func ExampleSubscriptionClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteSubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteSubscription.json func ExampleSubscriptionClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -233,7 +233,7 @@ func ExampleSubscriptionClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementSubscriptionRegeneratePrimaryKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementSubscriptionRegeneratePrimaryKey.json func ExampleSubscriptionClient_RegeneratePrimaryKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -250,7 +250,7 @@ func ExampleSubscriptionClient_RegeneratePrimaryKey() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementSubscriptionRegenerateSecondaryKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementSubscriptionRegenerateSecondaryKey.json func ExampleSubscriptionClient_RegenerateSecondaryKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -267,7 +267,7 @@ func ExampleSubscriptionClient_RegenerateSecondaryKey() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementSubscriptionListSecrets.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementSubscriptionListSecrets.json func ExampleSubscriptionClient_ListSecrets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/tag_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/tag_client.go index eafe5f3b2bdd..210fa7f82913 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/tag_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/tag_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type TagClient struct { } // NewTagClient creates a new instance of TagClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewTagClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TagClient, error) { @@ -49,26 +47,29 @@ func NewTagClient(subscriptionID string, credential azcore.TokenCredential, opti // AssignToAPI - Assign tag to the Api. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. // - tagID - Tag identifier. Must be unique in the current API Management service instance. // - options - TagClientAssignToAPIOptions contains the optional parameters for the TagClient.AssignToAPI method. func (client *TagClient) AssignToAPI(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagID string, options *TagClientAssignToAPIOptions) (TagClientAssignToAPIResponse, error) { + var err error req, err := client.assignToAPICreateRequest(ctx, resourceGroupName, serviceName, apiID, tagID, options) if err != nil { return TagClientAssignToAPIResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagClientAssignToAPIResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return TagClientAssignToAPIResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return TagClientAssignToAPIResponse{}, err } - return client.assignToAPIHandleResponse(resp) + resp, err := client.assignToAPIHandleResponse(httpResp) + return resp, err } // assignToAPICreateRequest creates the AssignToAPI request. @@ -99,7 +100,7 @@ func (client *TagClient) assignToAPICreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -120,8 +121,8 @@ func (client *TagClient) assignToAPIHandleResponse(resp *http.Response) (TagClie // AssignToOperation - Assign tag to the Operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -129,18 +130,21 @@ func (client *TagClient) assignToAPIHandleResponse(resp *http.Response) (TagClie // - tagID - Tag identifier. Must be unique in the current API Management service instance. // - options - TagClientAssignToOperationOptions contains the optional parameters for the TagClient.AssignToOperation method. func (client *TagClient) AssignToOperation(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, tagID string, options *TagClientAssignToOperationOptions) (TagClientAssignToOperationResponse, error) { + var err error req, err := client.assignToOperationCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, tagID, options) if err != nil { return TagClientAssignToOperationResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagClientAssignToOperationResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return TagClientAssignToOperationResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return TagClientAssignToOperationResponse{}, err } - return client.assignToOperationHandleResponse(resp) + resp, err := client.assignToOperationHandleResponse(httpResp) + return resp, err } // assignToOperationCreateRequest creates the AssignToOperation request. @@ -175,7 +179,7 @@ func (client *TagClient) assignToOperationCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,25 +197,28 @@ func (client *TagClient) assignToOperationHandleResponse(resp *http.Response) (T // AssignToProduct - Assign tag to the Product. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - tagID - Tag identifier. Must be unique in the current API Management service instance. // - options - TagClientAssignToProductOptions contains the optional parameters for the TagClient.AssignToProduct method. func (client *TagClient) AssignToProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, options *TagClientAssignToProductOptions) (TagClientAssignToProductResponse, error) { + var err error req, err := client.assignToProductCreateRequest(ctx, resourceGroupName, serviceName, productID, tagID, options) if err != nil { return TagClientAssignToProductResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagClientAssignToProductResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return TagClientAssignToProductResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return TagClientAssignToProductResponse{}, err } - return client.assignToProductHandleResponse(resp) + resp, err := client.assignToProductHandleResponse(httpResp) + return resp, err } // assignToProductCreateRequest creates the AssignToProduct request. @@ -242,7 +249,7 @@ func (client *TagClient) assignToProductCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,25 +267,28 @@ func (client *TagClient) assignToProductHandleResponse(resp *http.Response) (Tag // CreateOrUpdate - Creates a tag. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - tagID - Tag identifier. Must be unique in the current API Management service instance. // - parameters - Create parameters. // - options - TagClientCreateOrUpdateOptions contains the optional parameters for the TagClient.CreateOrUpdate method. func (client *TagClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, tagID string, parameters TagCreateUpdateParameters, options *TagClientCreateOrUpdateOptions) (TagClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, tagID, parameters, options) if err != nil { return TagClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return TagClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return TagClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -305,13 +315,16 @@ func (client *TagClient) createOrUpdateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -329,24 +342,26 @@ func (client *TagClient) createOrUpdateHandleResponse(resp *http.Response) (TagC // Delete - Deletes specific tag of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - tagID - Tag identifier. Must be unique in the current API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - options - TagClientDeleteOptions contains the optional parameters for the TagClient.Delete method. func (client *TagClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, tagID string, ifMatch string, options *TagClientDeleteOptions) (TagClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, tagID, ifMatch, options) if err != nil { return TagClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return TagClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return TagClientDeleteResponse{}, err } return TagClientDeleteResponse{}, nil } @@ -375,7 +390,7 @@ func (client *TagClient) deleteCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -385,24 +400,26 @@ func (client *TagClient) deleteCreateRequest(ctx context.Context, resourceGroupN // DetachFromAPI - Detach the tag from the Api. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. // - tagID - Tag identifier. Must be unique in the current API Management service instance. // - options - TagClientDetachFromAPIOptions contains the optional parameters for the TagClient.DetachFromAPI method. func (client *TagClient) DetachFromAPI(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagID string, options *TagClientDetachFromAPIOptions) (TagClientDetachFromAPIResponse, error) { + var err error req, err := client.detachFromAPICreateRequest(ctx, resourceGroupName, serviceName, apiID, tagID, options) if err != nil { return TagClientDetachFromAPIResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagClientDetachFromAPIResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return TagClientDetachFromAPIResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return TagClientDetachFromAPIResponse{}, err } return TagClientDetachFromAPIResponse{}, nil } @@ -435,7 +452,7 @@ func (client *TagClient) detachFromAPICreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -444,8 +461,8 @@ func (client *TagClient) detachFromAPICreateRequest(ctx context.Context, resourc // DetachFromOperation - Detach the tag from the Operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -453,16 +470,18 @@ func (client *TagClient) detachFromAPICreateRequest(ctx context.Context, resourc // - tagID - Tag identifier. Must be unique in the current API Management service instance. // - options - TagClientDetachFromOperationOptions contains the optional parameters for the TagClient.DetachFromOperation method. func (client *TagClient) DetachFromOperation(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, tagID string, options *TagClientDetachFromOperationOptions) (TagClientDetachFromOperationResponse, error) { + var err error req, err := client.detachFromOperationCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, tagID, options) if err != nil { return TagClientDetachFromOperationResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagClientDetachFromOperationResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return TagClientDetachFromOperationResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return TagClientDetachFromOperationResponse{}, err } return TagClientDetachFromOperationResponse{}, nil } @@ -499,7 +518,7 @@ func (client *TagClient) detachFromOperationCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -508,23 +527,25 @@ func (client *TagClient) detachFromOperationCreateRequest(ctx context.Context, r // DetachFromProduct - Detach the tag from the Product. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - tagID - Tag identifier. Must be unique in the current API Management service instance. // - options - TagClientDetachFromProductOptions contains the optional parameters for the TagClient.DetachFromProduct method. func (client *TagClient) DetachFromProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, options *TagClientDetachFromProductOptions) (TagClientDetachFromProductResponse, error) { + var err error req, err := client.detachFromProductCreateRequest(ctx, resourceGroupName, serviceName, productID, tagID, options) if err != nil { return TagClientDetachFromProductResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagClientDetachFromProductResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return TagClientDetachFromProductResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return TagClientDetachFromProductResponse{}, err } return TagClientDetachFromProductResponse{}, nil } @@ -557,7 +578,7 @@ func (client *TagClient) detachFromProductCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -566,24 +587,27 @@ func (client *TagClient) detachFromProductCreateRequest(ctx context.Context, res // Get - Gets the details of the tag specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - tagID - Tag identifier. Must be unique in the current API Management service instance. // - options - TagClientGetOptions contains the optional parameters for the TagClient.Get method. func (client *TagClient) Get(ctx context.Context, resourceGroupName string, serviceName string, tagID string, options *TagClientGetOptions) (TagClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, tagID, options) if err != nil { return TagClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TagClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TagClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -610,7 +634,7 @@ func (client *TagClient) getCreateRequest(ctx context.Context, resourceGroupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -631,26 +655,29 @@ func (client *TagClient) getHandleResponse(resp *http.Response) (TagClientGetRes // GetByAPI - Get tag associated with the API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. // - tagID - Tag identifier. Must be unique in the current API Management service instance. // - options - TagClientGetByAPIOptions contains the optional parameters for the TagClient.GetByAPI method. func (client *TagClient) GetByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagID string, options *TagClientGetByAPIOptions) (TagClientGetByAPIResponse, error) { + var err error req, err := client.getByAPICreateRequest(ctx, resourceGroupName, serviceName, apiID, tagID, options) if err != nil { return TagClientGetByAPIResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagClientGetByAPIResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TagClientGetByAPIResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TagClientGetByAPIResponse{}, err } - return client.getByAPIHandleResponse(resp) + resp, err := client.getByAPIHandleResponse(httpResp) + return resp, err } // getByAPICreateRequest creates the GetByAPI request. @@ -681,7 +708,7 @@ func (client *TagClient) getByAPICreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -702,8 +729,8 @@ func (client *TagClient) getByAPIHandleResponse(resp *http.Response) (TagClientG // GetByOperation - Get tag associated with the Operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -711,18 +738,21 @@ func (client *TagClient) getByAPIHandleResponse(resp *http.Response) (TagClientG // - tagID - Tag identifier. Must be unique in the current API Management service instance. // - options - TagClientGetByOperationOptions contains the optional parameters for the TagClient.GetByOperation method. func (client *TagClient) GetByOperation(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, tagID string, options *TagClientGetByOperationOptions) (TagClientGetByOperationResponse, error) { + var err error req, err := client.getByOperationCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, tagID, options) if err != nil { return TagClientGetByOperationResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagClientGetByOperationResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TagClientGetByOperationResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TagClientGetByOperationResponse{}, err } - return client.getByOperationHandleResponse(resp) + resp, err := client.getByOperationHandleResponse(httpResp) + return resp, err } // getByOperationCreateRequest creates the GetByOperation request. @@ -757,7 +787,7 @@ func (client *TagClient) getByOperationCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -778,25 +808,28 @@ func (client *TagClient) getByOperationHandleResponse(resp *http.Response) (TagC // GetByProduct - Get tag associated with the Product. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - tagID - Tag identifier. Must be unique in the current API Management service instance. // - options - TagClientGetByProductOptions contains the optional parameters for the TagClient.GetByProduct method. func (client *TagClient) GetByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, options *TagClientGetByProductOptions) (TagClientGetByProductResponse, error) { + var err error req, err := client.getByProductCreateRequest(ctx, resourceGroupName, serviceName, productID, tagID, options) if err != nil { return TagClientGetByProductResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagClientGetByProductResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TagClientGetByProductResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TagClientGetByProductResponse{}, err } - return client.getByProductHandleResponse(resp) + resp, err := client.getByProductHandleResponse(httpResp) + return resp, err } // getByProductCreateRequest creates the GetByProduct request. @@ -827,7 +860,7 @@ func (client *TagClient) getByProductCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -847,24 +880,27 @@ func (client *TagClient) getByProductHandleResponse(resp *http.Response) (TagCli // GetEntityState - Gets the entity state version of the tag specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - tagID - Tag identifier. Must be unique in the current API Management service instance. // - options - TagClientGetEntityStateOptions contains the optional parameters for the TagClient.GetEntityState method. func (client *TagClient) GetEntityState(ctx context.Context, resourceGroupName string, serviceName string, tagID string, options *TagClientGetEntityStateOptions) (TagClientGetEntityStateResponse, error) { + var err error req, err := client.getEntityStateCreateRequest(ctx, resourceGroupName, serviceName, tagID, options) if err != nil { return TagClientGetEntityStateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagClientGetEntityStateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TagClientGetEntityStateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TagClientGetEntityStateResponse{}, err } - return client.getEntityStateHandleResponse(resp) + resp, err := client.getEntityStateHandleResponse(httpResp) + return resp, err } // getEntityStateCreateRequest creates the GetEntityState request. @@ -891,7 +927,7 @@ func (client *TagClient) getEntityStateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -909,26 +945,29 @@ func (client *TagClient) getEntityStateHandleResponse(resp *http.Response) (TagC // GetEntityStateByAPI - Gets the entity state version of the tag specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. // - tagID - Tag identifier. Must be unique in the current API Management service instance. // - options - TagClientGetEntityStateByAPIOptions contains the optional parameters for the TagClient.GetEntityStateByAPI method. func (client *TagClient) GetEntityStateByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagID string, options *TagClientGetEntityStateByAPIOptions) (TagClientGetEntityStateByAPIResponse, error) { + var err error req, err := client.getEntityStateByAPICreateRequest(ctx, resourceGroupName, serviceName, apiID, tagID, options) if err != nil { return TagClientGetEntityStateByAPIResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagClientGetEntityStateByAPIResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TagClientGetEntityStateByAPIResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TagClientGetEntityStateByAPIResponse{}, err } - return client.getEntityStateByAPIHandleResponse(resp) + resp, err := client.getEntityStateByAPIHandleResponse(httpResp) + return resp, err } // getEntityStateByAPICreateRequest creates the GetEntityStateByAPI request. @@ -959,7 +998,7 @@ func (client *TagClient) getEntityStateByAPICreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -977,8 +1016,8 @@ func (client *TagClient) getEntityStateByAPIHandleResponse(resp *http.Response) // GetEntityStateByOperation - Gets the entity state version of the tag specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -987,18 +1026,21 @@ func (client *TagClient) getEntityStateByAPIHandleResponse(resp *http.Response) // - options - TagClientGetEntityStateByOperationOptions contains the optional parameters for the TagClient.GetEntityStateByOperation // method. func (client *TagClient) GetEntityStateByOperation(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, tagID string, options *TagClientGetEntityStateByOperationOptions) (TagClientGetEntityStateByOperationResponse, error) { + var err error req, err := client.getEntityStateByOperationCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, tagID, options) if err != nil { return TagClientGetEntityStateByOperationResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagClientGetEntityStateByOperationResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TagClientGetEntityStateByOperationResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TagClientGetEntityStateByOperationResponse{}, err } - return client.getEntityStateByOperationHandleResponse(resp) + resp, err := client.getEntityStateByOperationHandleResponse(httpResp) + return resp, err } // getEntityStateByOperationCreateRequest creates the GetEntityStateByOperation request. @@ -1033,7 +1075,7 @@ func (client *TagClient) getEntityStateByOperationCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1051,26 +1093,29 @@ func (client *TagClient) getEntityStateByOperationHandleResponse(resp *http.Resp // GetEntityStateByProduct - Gets the entity state version of the tag specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - tagID - Tag identifier. Must be unique in the current API Management service instance. // - options - TagClientGetEntityStateByProductOptions contains the optional parameters for the TagClient.GetEntityStateByProduct // method. func (client *TagClient) GetEntityStateByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, options *TagClientGetEntityStateByProductOptions) (TagClientGetEntityStateByProductResponse, error) { + var err error req, err := client.getEntityStateByProductCreateRequest(ctx, resourceGroupName, serviceName, productID, tagID, options) if err != nil { return TagClientGetEntityStateByProductResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagClientGetEntityStateByProductResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TagClientGetEntityStateByProductResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TagClientGetEntityStateByProductResponse{}, err } - return client.getEntityStateByProductHandleResponse(resp) + resp, err := client.getEntityStateByProductHandleResponse(httpResp) + return resp, err } // getEntityStateByProductCreateRequest creates the GetEntityStateByProduct request. @@ -1101,7 +1146,7 @@ func (client *TagClient) getEntityStateByProductCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1119,8 +1164,8 @@ func (client *TagClient) getEntityStateByProductHandleResponse(resp *http.Respon // NewListByAPIPager - Lists all Tags associated with the API. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -1186,7 +1231,7 @@ func (client *TagClient) listByAPICreateRequest(ctx context.Context, resourceGro if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1203,8 +1248,8 @@ func (client *TagClient) listByAPIHandleResponse(resp *http.Response) (TagClient // NewListByOperationPager - Lists all Tags associated with the Operation. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has // ;rev=n as a suffix where n is the revision number. @@ -1275,7 +1320,7 @@ func (client *TagClient) listByOperationCreateRequest(ctx context.Context, resou if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1292,8 +1337,8 @@ func (client *TagClient) listByOperationHandleResponse(resp *http.Response) (Tag // NewListByProductPager - Lists all Tags associated with the Product. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - productID - Product identifier. Must be unique in the current API Management service instance. // - options - TagClientListByProductOptions contains the optional parameters for the TagClient.NewListByProductPager method. @@ -1358,7 +1403,7 @@ func (client *TagClient) listByProductCreateRequest(ctx context.Context, resourc if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1375,8 +1420,8 @@ func (client *TagClient) listByProductHandleResponse(resp *http.Response) (TagCl // NewListByServicePager - Lists a collection of tags defined within a service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - TagClientListByServiceOptions contains the optional parameters for the TagClient.NewListByServicePager method. func (client *TagClient) NewListByServicePager(resourceGroupName string, serviceName string, options *TagClientListByServiceOptions) *runtime.Pager[TagClientListByServiceResponse] { @@ -1439,7 +1484,7 @@ func (client *TagClient) listByServiceCreateRequest(ctx context.Context, resourc if options != nil && options.Scope != nil { reqQP.Set("scope", *options.Scope) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1457,8 +1502,8 @@ func (client *TagClient) listByServiceHandleResponse(resp *http.Response) (TagCl // Update - Updates the details of the tag specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - tagID - Tag identifier. Must be unique in the current API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -1466,18 +1511,21 @@ func (client *TagClient) listByServiceHandleResponse(resp *http.Response) (TagCl // - parameters - Update parameters. // - options - TagClientUpdateOptions contains the optional parameters for the TagClient.Update method. func (client *TagClient) Update(ctx context.Context, resourceGroupName string, serviceName string, tagID string, ifMatch string, parameters TagCreateUpdateParameters, options *TagClientUpdateOptions) (TagClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, tagID, ifMatch, parameters, options) if err != nil { return TagClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TagClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TagClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TagClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -1504,11 +1552,14 @@ func (client *TagClient) updateCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/tag_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/tag_client_example_test.go index 77a4ff3c87a8..5fc2354e6a57 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/tag_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/tag_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiOperationTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApiOperationTags.json func ExampleTagClient_NewListByOperationPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -58,7 +58,7 @@ func ExampleTagClient_NewListByOperationPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiOperationTag.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadApiOperationTag.json func ExampleTagClient_GetEntityStateByOperation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -75,7 +75,7 @@ func ExampleTagClient_GetEntityStateByOperation() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiOperationTag.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiOperationTag.json func ExampleTagClient_GetByOperation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -103,7 +103,7 @@ func ExampleTagClient_GetByOperation() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiOperationTag.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiOperationTag.json func ExampleTagClient_AssignToOperation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -131,7 +131,7 @@ func ExampleTagClient_AssignToOperation() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiOperationTag.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteApiOperationTag.json func ExampleTagClient_DetachFromOperation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -148,7 +148,7 @@ func ExampleTagClient_DetachFromOperation() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListApiTags.json func ExampleTagClient_NewListByAPIPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -188,7 +188,7 @@ func ExampleTagClient_NewListByAPIPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiTag.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadApiTag.json func ExampleTagClient_GetEntityStateByAPI() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -205,7 +205,7 @@ func ExampleTagClient_GetEntityStateByAPI() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiTag.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetApiTag.json func ExampleTagClient_GetByAPI() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -233,7 +233,7 @@ func ExampleTagClient_GetByAPI() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiTag.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateApiTag.json func ExampleTagClient_AssignToAPI() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -261,7 +261,7 @@ func ExampleTagClient_AssignToAPI() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiTag.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteApiTag.json func ExampleTagClient_DetachFromAPI() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -278,7 +278,7 @@ func ExampleTagClient_DetachFromAPI() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListProductTags.json func ExampleTagClient_NewListByProductPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -318,7 +318,7 @@ func ExampleTagClient_NewListByProductPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductTag.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadProductTag.json func ExampleTagClient_GetEntityStateByProduct() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -335,7 +335,7 @@ func ExampleTagClient_GetEntityStateByProduct() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetProductTag.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetProductTag.json func ExampleTagClient_GetByProduct() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -363,7 +363,7 @@ func ExampleTagClient_GetByProduct() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductTag.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateProductTag.json func ExampleTagClient_AssignToProduct() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -391,7 +391,7 @@ func ExampleTagClient_AssignToProduct() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductTag.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteProductTag.json func ExampleTagClient_DetachFromProduct() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -408,7 +408,7 @@ func ExampleTagClient_DetachFromProduct() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListTags.json func ExampleTagClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -457,7 +457,7 @@ func ExampleTagClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadTag.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadTag.json func ExampleTagClient_GetEntityState() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -474,7 +474,7 @@ func ExampleTagClient_GetEntityState() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTag.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetTag.json func ExampleTagClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -502,7 +502,7 @@ func ExampleTagClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateTag.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateTag.json func ExampleTagClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -534,7 +534,7 @@ func ExampleTagClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateTag.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateTag.json func ExampleTagClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -566,7 +566,7 @@ func ExampleTagClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteTag.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteTag.json func ExampleTagClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/tagresource_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/tagresource_client.go index aebcbfe36506..e77337c08e24 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/tagresource_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/tagresource_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type TagResourceClient struct { } // NewTagResourceClient creates a new instance of TagResourceClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewTagResourceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TagResourceClient, error) { @@ -48,8 +46,8 @@ func NewTagResourceClient(subscriptionID string, credential azcore.TokenCredenti // NewListByServicePager - Lists a collection of resources associated with tags. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - TagResourceClientListByServiceOptions contains the optional parameters for the TagResourceClient.NewListByServicePager // method. @@ -110,7 +108,7 @@ func (client *TagResourceClient) listByServiceCreateRequest(ctx context.Context, if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/tagresource_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/tagresource_client_example_test.go index 75af910d3b5b..55f1760528ce 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/tagresource_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/tagresource_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTagResources.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListTagResources.json func ExampleTagResourceClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccess_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccess_client.go index 48e4423619f3..920bf76ef669 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccess_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccess_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type TenantAccessClient struct { } // NewTenantAccessClient creates a new instance of TenantAccessClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewTenantAccessClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TenantAccessClient, error) { @@ -48,8 +46,8 @@ func NewTenantAccessClient(subscriptionID string, credential azcore.TokenCredent // Create - Update tenant access information details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - accessName - The identifier of the Access configuration. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -57,18 +55,21 @@ func NewTenantAccessClient(subscriptionID string, credential azcore.TokenCredent // - parameters - Parameters supplied to retrieve the Tenant Access Information. // - options - TenantAccessClientCreateOptions contains the optional parameters for the TenantAccessClient.Create method. func (client *TenantAccessClient) Create(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, ifMatch string, parameters AccessInformationCreateParameters, options *TenantAccessClientCreateOptions) (TenantAccessClientCreateResponse, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, serviceName, accessName, ifMatch, parameters, options) if err != nil { return TenantAccessClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TenantAccessClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TenantAccessClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TenantAccessClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. @@ -95,11 +96,14 @@ func (client *TenantAccessClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createHandleResponse handles the Create response. @@ -117,24 +121,27 @@ func (client *TenantAccessClient) createHandleResponse(resp *http.Response) (Ten // Get - Get tenant access information details without secrets. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - accessName - The identifier of the Access configuration. // - options - TenantAccessClientGetOptions contains the optional parameters for the TenantAccessClient.Get method. func (client *TenantAccessClient) Get(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessClientGetOptions) (TenantAccessClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, accessName, options) if err != nil { return TenantAccessClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TenantAccessClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TenantAccessClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TenantAccessClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -161,7 +168,7 @@ func (client *TenantAccessClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,25 +188,28 @@ func (client *TenantAccessClient) getHandleResponse(resp *http.Response) (Tenant // GetEntityTag - Tenant access metadata // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - accessName - The identifier of the Access configuration. // - options - TenantAccessClientGetEntityTagOptions contains the optional parameters for the TenantAccessClient.GetEntityTag // method. func (client *TenantAccessClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessClientGetEntityTagOptions) (TenantAccessClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, accessName, options) if err != nil { return TenantAccessClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TenantAccessClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TenantAccessClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TenantAccessClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -226,7 +236,7 @@ func (client *TenantAccessClient) getEntityTagCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -244,8 +254,8 @@ func (client *TenantAccessClient) getEntityTagHandleResponse(resp *http.Response // NewListByServicePager - Returns list of access infos - for Git and Management endpoints. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - TenantAccessClientListByServiceOptions contains the optional parameters for the TenantAccessClient.NewListByServicePager // method. @@ -300,7 +310,7 @@ func (client *TenantAccessClient) listByServiceCreateRequest(ctx context.Context if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -318,25 +328,28 @@ func (client *TenantAccessClient) listByServiceHandleResponse(resp *http.Respons // ListSecrets - Get tenant access information details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - accessName - The identifier of the Access configuration. // - options - TenantAccessClientListSecretsOptions contains the optional parameters for the TenantAccessClient.ListSecrets // method. func (client *TenantAccessClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessClientListSecretsOptions) (TenantAccessClientListSecretsResponse, error) { + var err error req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, serviceName, accessName, options) if err != nil { return TenantAccessClientListSecretsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TenantAccessClientListSecretsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TenantAccessClientListSecretsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TenantAccessClientListSecretsResponse{}, err } - return client.listSecretsHandleResponse(resp) + resp, err := client.listSecretsHandleResponse(httpResp) + return resp, err } // listSecretsCreateRequest creates the ListSecrets request. @@ -363,7 +376,7 @@ func (client *TenantAccessClient) listSecretsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,23 +397,25 @@ func (client *TenantAccessClient) listSecretsHandleResponse(resp *http.Response) // RegeneratePrimaryKey - Regenerate primary access key // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - accessName - The identifier of the Access configuration. // - options - TenantAccessClientRegeneratePrimaryKeyOptions contains the optional parameters for the TenantAccessClient.RegeneratePrimaryKey // method. func (client *TenantAccessClient) RegeneratePrimaryKey(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessClientRegeneratePrimaryKeyOptions) (TenantAccessClientRegeneratePrimaryKeyResponse, error) { + var err error req, err := client.regeneratePrimaryKeyCreateRequest(ctx, resourceGroupName, serviceName, accessName, options) if err != nil { return TenantAccessClientRegeneratePrimaryKeyResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TenantAccessClientRegeneratePrimaryKeyResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return TenantAccessClientRegeneratePrimaryKeyResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return TenantAccessClientRegeneratePrimaryKeyResponse{}, err } return TenantAccessClientRegeneratePrimaryKeyResponse{}, nil } @@ -429,7 +444,7 @@ func (client *TenantAccessClient) regeneratePrimaryKeyCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -438,23 +453,25 @@ func (client *TenantAccessClient) regeneratePrimaryKeyCreateRequest(ctx context. // RegenerateSecondaryKey - Regenerate secondary access key // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - accessName - The identifier of the Access configuration. // - options - TenantAccessClientRegenerateSecondaryKeyOptions contains the optional parameters for the TenantAccessClient.RegenerateSecondaryKey // method. func (client *TenantAccessClient) RegenerateSecondaryKey(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessClientRegenerateSecondaryKeyOptions) (TenantAccessClientRegenerateSecondaryKeyResponse, error) { + var err error req, err := client.regenerateSecondaryKeyCreateRequest(ctx, resourceGroupName, serviceName, accessName, options) if err != nil { return TenantAccessClientRegenerateSecondaryKeyResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TenantAccessClientRegenerateSecondaryKeyResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return TenantAccessClientRegenerateSecondaryKeyResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return TenantAccessClientRegenerateSecondaryKeyResponse{}, err } return TenantAccessClientRegenerateSecondaryKeyResponse{}, nil } @@ -483,7 +500,7 @@ func (client *TenantAccessClient) regenerateSecondaryKeyCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -492,8 +509,8 @@ func (client *TenantAccessClient) regenerateSecondaryKeyCreateRequest(ctx contex // Update - Update tenant access information details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - accessName - The identifier of the Access configuration. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -501,18 +518,21 @@ func (client *TenantAccessClient) regenerateSecondaryKeyCreateRequest(ctx contex // - parameters - Parameters supplied to retrieve the Tenant Access Information. // - options - TenantAccessClientUpdateOptions contains the optional parameters for the TenantAccessClient.Update method. func (client *TenantAccessClient) Update(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, ifMatch string, parameters AccessInformationUpdateParameters, options *TenantAccessClientUpdateOptions) (TenantAccessClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, accessName, ifMatch, parameters, options) if err != nil { return TenantAccessClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TenantAccessClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TenantAccessClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TenantAccessClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -539,11 +559,14 @@ func (client *TenantAccessClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccess_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccess_client_example_test.go index b9d850ff8763..77fd0901db31 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccess_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccess_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTenantAccess.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListTenantAccess.json func ExampleTenantAccessClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -55,7 +55,7 @@ func ExampleTenantAccessClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadTenantAccess.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadTenantAccess.json func ExampleTenantAccessClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -72,7 +72,7 @@ func ExampleTenantAccessClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTenantAccess.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetTenantAccess.json func ExampleTenantAccessClient_Get_apiManagementGetTenantAccess() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -100,7 +100,7 @@ func ExampleTenantAccessClient_Get_apiManagementGetTenantAccess() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTenantGitAccess.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetTenantGitAccess.json func ExampleTenantAccessClient_Get_apiManagementGetTenantGitAccess() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -129,7 +129,7 @@ func ExampleTenantAccessClient_Get_apiManagementGetTenantGitAccess() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateTenantAccess.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateTenantAccess.json func ExampleTenantAccessClient_Create() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -161,7 +161,7 @@ func ExampleTenantAccessClient_Create() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateTenantAccess.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateTenantAccess.json func ExampleTenantAccessClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -193,7 +193,7 @@ func ExampleTenantAccessClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessRegenerateKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementTenantAccessRegenerateKey.json func ExampleTenantAccessClient_RegeneratePrimaryKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -210,7 +210,7 @@ func ExampleTenantAccessClient_RegeneratePrimaryKey() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSecretsTenantAccess.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListSecretsTenantAccess.json func ExampleTenantAccessClient_ListSecrets() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccessgit_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccessgit_client.go index e593914005a1..fab8ea995ca4 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccessgit_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccessgit_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type TenantAccessGitClient struct { } // NewTenantAccessGitClient creates a new instance of TenantAccessGitClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewTenantAccessGitClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TenantAccessGitClient, error) { @@ -48,23 +46,25 @@ func NewTenantAccessGitClient(subscriptionID string, credential azcore.TokenCred // RegeneratePrimaryKey - Regenerate primary access key for GIT. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - accessName - The identifier of the Access configuration. // - options - TenantAccessGitClientRegeneratePrimaryKeyOptions contains the optional parameters for the TenantAccessGitClient.RegeneratePrimaryKey // method. func (client *TenantAccessGitClient) RegeneratePrimaryKey(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessGitClientRegeneratePrimaryKeyOptions) (TenantAccessGitClientRegeneratePrimaryKeyResponse, error) { + var err error req, err := client.regeneratePrimaryKeyCreateRequest(ctx, resourceGroupName, serviceName, accessName, options) if err != nil { return TenantAccessGitClientRegeneratePrimaryKeyResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TenantAccessGitClientRegeneratePrimaryKeyResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return TenantAccessGitClientRegeneratePrimaryKeyResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return TenantAccessGitClientRegeneratePrimaryKeyResponse{}, err } return TenantAccessGitClientRegeneratePrimaryKeyResponse{}, nil } @@ -93,7 +93,7 @@ func (client *TenantAccessGitClient) regeneratePrimaryKeyCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -102,23 +102,25 @@ func (client *TenantAccessGitClient) regeneratePrimaryKeyCreateRequest(ctx conte // RegenerateSecondaryKey - Regenerate secondary access key for GIT. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - accessName - The identifier of the Access configuration. // - options - TenantAccessGitClientRegenerateSecondaryKeyOptions contains the optional parameters for the TenantAccessGitClient.RegenerateSecondaryKey // method. func (client *TenantAccessGitClient) RegenerateSecondaryKey(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessGitClientRegenerateSecondaryKeyOptions) (TenantAccessGitClientRegenerateSecondaryKeyResponse, error) { + var err error req, err := client.regenerateSecondaryKeyCreateRequest(ctx, resourceGroupName, serviceName, accessName, options) if err != nil { return TenantAccessGitClientRegenerateSecondaryKeyResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TenantAccessGitClientRegenerateSecondaryKeyResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return TenantAccessGitClientRegenerateSecondaryKeyResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return TenantAccessGitClientRegenerateSecondaryKeyResponse{}, err } return TenantAccessGitClientRegenerateSecondaryKeyResponse{}, nil } @@ -147,7 +149,7 @@ func (client *TenantAccessGitClient) regenerateSecondaryKeyCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccessgit_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccessgit_client_example_test.go index 0ec55ce1c92b..81d267d5b112 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccessgit_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccessgit_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessRegenerateKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementTenantAccessRegenerateKey.json func ExampleTenantAccessGitClient_RegeneratePrimaryKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/tenantconfiguration_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/tenantconfiguration_client.go index 7ad87a966c1a..7ef3a29dae6b 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/tenantconfiguration_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/tenantconfiguration_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type TenantConfigurationClient struct { } // NewTenantConfigurationClient creates a new instance of TenantConfigurationClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewTenantConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TenantConfigurationClient, error) { @@ -49,8 +47,8 @@ func NewTenantConfigurationClient(subscriptionID string, credential azcore.Token // running operation and could take several minutes to complete. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - configurationName - The identifier of the Git Configuration Operation. // - parameters - Deploy Configuration parameters. @@ -62,9 +60,10 @@ func (client *TenantConfigurationClient) BeginDeploy(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TenantConfigurationClientDeployResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TenantConfigurationClientDeployResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[TenantConfigurationClientDeployResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -74,20 +73,22 @@ func (client *TenantConfigurationClient) BeginDeploy(ctx context.Context, resour // operation and could take several minutes to complete. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *TenantConfigurationClient) deploy(ctx context.Context, resourceGroupName string, serviceName string, configurationName ConfigurationIDName, parameters DeployConfigurationParameters, options *TenantConfigurationClientBeginDeployOptions) (*http.Response, error) { + var err error req, err := client.deployCreateRequest(ctx, resourceGroupName, serviceName, configurationName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deployCreateRequest creates the Deploy request. @@ -114,34 +115,40 @@ func (client *TenantConfigurationClient) deployCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // GetSyncState - Gets the status of the most recent synchronization between the configuration database and the Git repository. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - configurationName - The identifier of the Git Configuration Operation. // - options - TenantConfigurationClientGetSyncStateOptions contains the optional parameters for the TenantConfigurationClient.GetSyncState // method. func (client *TenantConfigurationClient) GetSyncState(ctx context.Context, resourceGroupName string, serviceName string, configurationName ConfigurationIDName, options *TenantConfigurationClientGetSyncStateOptions) (TenantConfigurationClientGetSyncStateResponse, error) { + var err error req, err := client.getSyncStateCreateRequest(ctx, resourceGroupName, serviceName, configurationName, options) if err != nil { return TenantConfigurationClientGetSyncStateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TenantConfigurationClientGetSyncStateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TenantConfigurationClientGetSyncStateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TenantConfigurationClientGetSyncStateResponse{}, err } - return client.getSyncStateHandleResponse(resp) + resp, err := client.getSyncStateHandleResponse(httpResp) + return resp, err } // getSyncStateCreateRequest creates the GetSyncState request. @@ -168,7 +175,7 @@ func (client *TenantConfigurationClient) getSyncStateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -187,8 +194,8 @@ func (client *TenantConfigurationClient) getSyncStateHandleResponse(resp *http.R // This is a long running operation and could take several minutes to complete. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - configurationName - The identifier of the Git Configuration Operation. // - parameters - Save Configuration parameters. @@ -200,9 +207,10 @@ func (client *TenantConfigurationClient) BeginSave(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TenantConfigurationClientSaveResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TenantConfigurationClientSaveResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[TenantConfigurationClientSaveResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -212,20 +220,22 @@ func (client *TenantConfigurationClient) BeginSave(ctx context.Context, resource // This is a long running operation and could take several minutes to complete. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *TenantConfigurationClient) save(ctx context.Context, resourceGroupName string, serviceName string, configurationName ConfigurationIDName, parameters SaveConfigurationParameter, options *TenantConfigurationClientBeginSaveOptions) (*http.Response, error) { + var err error req, err := client.saveCreateRequest(ctx, resourceGroupName, serviceName, configurationName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // saveCreateRequest creates the Save request. @@ -252,18 +262,21 @@ func (client *TenantConfigurationClient) saveCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginValidate - This operation validates the changes in the specified Git branch. This is a long running operation and // could take several minutes to complete. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - configurationName - The identifier of the Git Configuration Operation. // - parameters - Validate Configuration parameters. @@ -275,9 +288,10 @@ func (client *TenantConfigurationClient) BeginValidate(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TenantConfigurationClientValidateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[TenantConfigurationClientValidateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[TenantConfigurationClientValidateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -287,20 +301,22 @@ func (client *TenantConfigurationClient) BeginValidate(ctx context.Context, reso // take several minutes to complete. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 +// Generated from API version 2022-08-01 func (client *TenantConfigurationClient) validate(ctx context.Context, resourceGroupName string, serviceName string, configurationName ConfigurationIDName, parameters DeployConfigurationParameters, options *TenantConfigurationClientBeginValidateOptions) (*http.Response, error) { + var err error req, err := client.validateCreateRequest(ctx, resourceGroupName, serviceName, configurationName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // validateCreateRequest creates the Validate request. @@ -327,8 +343,11 @@ func (client *TenantConfigurationClient) validateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/tenantconfiguration_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/tenantconfiguration_client_example_test.go index 1c91da09553b..67f7356727a0 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/tenantconfiguration_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/tenantconfiguration_client_example_test.go @@ -15,10 +15,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantConfigurationDeploy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementTenantConfigurationDeploy.json func ExampleTenantConfigurationClient_BeginDeploy() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -60,7 +60,7 @@ func ExampleTenantConfigurationClient_BeginDeploy() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantConfigurationSave.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementTenantConfigurationSave.json func ExampleTenantConfigurationClient_BeginSave() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -101,7 +101,7 @@ func ExampleTenantConfigurationClient_BeginSave() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantConfigurationValidate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementTenantConfigurationValidate.json func ExampleTenantConfigurationClient_BeginValidate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -142,7 +142,7 @@ func ExampleTenantConfigurationClient_BeginValidate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessSyncState.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementTenantAccessSyncState.json func ExampleTenantConfigurationClient_GetSyncState() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/tenantsettings_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/tenantsettings_client.go index ea135acdb38c..af520adcd936 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/tenantsettings_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/tenantsettings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type TenantSettingsClient struct { } // NewTenantSettingsClient creates a new instance of TenantSettingsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewTenantSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TenantSettingsClient, error) { @@ -48,24 +46,27 @@ func NewTenantSettingsClient(subscriptionID string, credential azcore.TokenCrede // Get - Get tenant settings. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - settingsType - The identifier of the settings. // - options - TenantSettingsClientGetOptions contains the optional parameters for the TenantSettingsClient.Get method. func (client *TenantSettingsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, settingsType SettingsTypeName, options *TenantSettingsClientGetOptions) (TenantSettingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, settingsType, options) if err != nil { return TenantSettingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TenantSettingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TenantSettingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TenantSettingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -92,7 +93,7 @@ func (client *TenantSettingsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,8 +113,8 @@ func (client *TenantSettingsClient) getHandleResponse(resp *http.Response) (Tena // NewListByServicePager - Public settings. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - TenantSettingsClientListByServiceOptions contains the optional parameters for the TenantSettingsClient.NewListByServicePager // method. @@ -168,7 +169,7 @@ func (client *TenantSettingsClient) listByServiceCreateRequest(ctx context.Conte if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/tenantsettings_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/tenantsettings_client_example_test.go index 4d66420d5270..3235565201ea 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/tenantsettings_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/tenantsettings_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTenantSettings.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListTenantSettings.json func ExampleTenantSettingsClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -60,7 +60,7 @@ func ExampleTenantSettingsClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTenantSettings.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetTenantSettings.json func ExampleTenantSettingsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/time_rfc3339.go b/sdk/resourcemanager/apimanagement/armapimanagement/time_rfc3339.go index 92ccea1c52c9..588ef464079d 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/time_rfc3339.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/time_rfc3339.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/user_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/user_client.go index 50ed86deb290..d4b236918085 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/user_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/user_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type UserClient struct { } // NewUserClient creates a new instance of UserClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewUserClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserClient, error) { @@ -49,25 +47,28 @@ func NewUserClient(subscriptionID string, credential azcore.TokenCredential, opt // CreateOrUpdate - Creates or Updates a user. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - userID - User identifier. Must be unique in the current API Management service instance. // - parameters - Create or update parameters. // - options - UserClientCreateOrUpdateOptions contains the optional parameters for the UserClient.CreateOrUpdate method. func (client *UserClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, userID string, parameters UserCreateParameters, options *UserClientCreateOrUpdateOptions) (UserClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, userID, parameters, options) if err != nil { return UserClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return UserClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return UserClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return UserClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -97,13 +98,16 @@ func (client *UserClient) createOrUpdateCreateRequest(ctx context.Context, resou if options != nil && options.Notify != nil { reqQP.Set("notify", strconv.FormatBool(*options.Notify)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -121,24 +125,26 @@ func (client *UserClient) createOrUpdateHandleResponse(resp *http.Response) (Use // Delete - Deletes specific user. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - userID - User identifier. Must be unique in the current API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or // it should be * for unconditional update. // - options - UserClientDeleteOptions contains the optional parameters for the UserClient.Delete method. func (client *UserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, userID string, ifMatch string, options *UserClientDeleteOptions) (UserClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, userID, ifMatch, options) if err != nil { return UserClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return UserClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return UserClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return UserClientDeleteResponse{}, err } return UserClientDeleteResponse{}, nil } @@ -173,7 +179,7 @@ func (client *UserClient) deleteCreateRequest(ctx context.Context, resourceGroup if options != nil && options.Notify != nil { reqQP.Set("notify", strconv.FormatBool(*options.Notify)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") if options != nil && options.AppType != nil { reqQP.Set("appType", string(*options.AppType)) } @@ -187,24 +193,27 @@ func (client *UserClient) deleteCreateRequest(ctx context.Context, resourceGroup // portal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - userID - User identifier. Must be unique in the current API Management service instance. // - options - UserClientGenerateSsoURLOptions contains the optional parameters for the UserClient.GenerateSsoURL method. func (client *UserClient) GenerateSsoURL(ctx context.Context, resourceGroupName string, serviceName string, userID string, options *UserClientGenerateSsoURLOptions) (UserClientGenerateSsoURLResponse, error) { + var err error req, err := client.generateSsoURLCreateRequest(ctx, resourceGroupName, serviceName, userID, options) if err != nil { return UserClientGenerateSsoURLResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return UserClientGenerateSsoURLResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return UserClientGenerateSsoURLResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return UserClientGenerateSsoURLResponse{}, err } - return client.generateSsoURLHandleResponse(resp) + resp, err := client.generateSsoURLHandleResponse(httpResp) + return resp, err } // generateSsoURLCreateRequest creates the GenerateSsoURL request. @@ -231,7 +240,7 @@ func (client *UserClient) generateSsoURLCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,24 +258,27 @@ func (client *UserClient) generateSsoURLHandleResponse(resp *http.Response) (Use // Get - Gets the details of the user specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - userID - User identifier. Must be unique in the current API Management service instance. // - options - UserClientGetOptions contains the optional parameters for the UserClient.Get method. func (client *UserClient) Get(ctx context.Context, resourceGroupName string, serviceName string, userID string, options *UserClientGetOptions) (UserClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, userID, options) if err != nil { return UserClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return UserClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return UserClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return UserClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -293,7 +305,7 @@ func (client *UserClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -313,24 +325,27 @@ func (client *UserClient) getHandleResponse(resp *http.Response) (UserClientGetR // GetEntityTag - Gets the entity state (Etag) version of the user specified by its identifier. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - userID - User identifier. Must be unique in the current API Management service instance. // - options - UserClientGetEntityTagOptions contains the optional parameters for the UserClient.GetEntityTag method. func (client *UserClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, userID string, options *UserClientGetEntityTagOptions) (UserClientGetEntityTagResponse, error) { + var err error req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, userID, options) if err != nil { return UserClientGetEntityTagResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return UserClientGetEntityTagResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return UserClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return UserClientGetEntityTagResponse{}, err } - return client.getEntityTagHandleResponse(resp) + resp, err := client.getEntityTagHandleResponse(httpResp) + return resp, err } // getEntityTagCreateRequest creates the GetEntityTag request. @@ -357,7 +372,7 @@ func (client *UserClient) getEntityTagCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -376,26 +391,29 @@ func (client *UserClient) getEntityTagHandleResponse(resp *http.Response) (UserC // GetSharedAccessToken - Gets the Shared Access Authorization Token for the User. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - userID - User identifier. Must be unique in the current API Management service instance. // - parameters - Create Authorization Token parameters. // - options - UserClientGetSharedAccessTokenOptions contains the optional parameters for the UserClient.GetSharedAccessToken // method. func (client *UserClient) GetSharedAccessToken(ctx context.Context, resourceGroupName string, serviceName string, userID string, parameters UserTokenParameters, options *UserClientGetSharedAccessTokenOptions) (UserClientGetSharedAccessTokenResponse, error) { + var err error req, err := client.getSharedAccessTokenCreateRequest(ctx, resourceGroupName, serviceName, userID, parameters, options) if err != nil { return UserClientGetSharedAccessTokenResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return UserClientGetSharedAccessTokenResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return UserClientGetSharedAccessTokenResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return UserClientGetSharedAccessTokenResponse{}, err } - return client.getSharedAccessTokenHandleResponse(resp) + resp, err := client.getSharedAccessTokenHandleResponse(httpResp) + return resp, err } // getSharedAccessTokenCreateRequest creates the GetSharedAccessToken request. @@ -422,10 +440,13 @@ func (client *UserClient) getSharedAccessTokenCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // getSharedAccessTokenHandleResponse handles the GetSharedAccessToken response. @@ -439,8 +460,8 @@ func (client *UserClient) getSharedAccessTokenHandleResponse(resp *http.Response // NewListByServicePager - Lists a collection of registered users in the specified service instance. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - options - UserClientListByServiceOptions contains the optional parameters for the UserClient.NewListByServicePager method. func (client *UserClient) NewListByServicePager(resourceGroupName string, serviceName string, options *UserClientListByServiceOptions) *runtime.Pager[UserClientListByServiceResponse] { @@ -503,7 +524,7 @@ func (client *UserClient) listByServiceCreateRequest(ctx context.Context, resour if options != nil && options.ExpandGroups != nil { reqQP.Set("expandGroups", strconv.FormatBool(*options.ExpandGroups)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -521,8 +542,8 @@ func (client *UserClient) listByServiceHandleResponse(resp *http.Response) (User // Update - Updates the details of the user specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - userID - User identifier. Must be unique in the current API Management service instance. // - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or @@ -530,18 +551,21 @@ func (client *UserClient) listByServiceHandleResponse(resp *http.Response) (User // - parameters - Update parameters. // - options - UserClientUpdateOptions contains the optional parameters for the UserClient.Update method. func (client *UserClient) Update(ctx context.Context, resourceGroupName string, serviceName string, userID string, ifMatch string, parameters UserUpdateParameters, options *UserClientUpdateOptions) (UserClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, userID, ifMatch, parameters, options) if err != nil { return UserClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return UserClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return UserClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return UserClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -568,11 +592,14 @@ func (client *UserClient) updateCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/user_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/user_client_example_test.go index 986456eb7551..0a53f2b08151 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/user_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/user_client_example_test.go @@ -17,10 +17,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUsers.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListUsers.json func ExampleUserClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -104,7 +104,7 @@ func ExampleUserClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadUser.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementHeadUser.json func ExampleUserClient_GetEntityTag() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -121,7 +121,7 @@ func ExampleUserClient_GetEntityTag() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetUser.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetUser.json func ExampleUserClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -158,7 +158,7 @@ func ExampleUserClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateUser.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementCreateUser.json func ExampleUserClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -206,7 +206,7 @@ func ExampleUserClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateUser.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUpdateUser.json func ExampleUserClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -249,7 +249,7 @@ func ExampleUserClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteUser.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementDeleteUser.json func ExampleUserClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -269,7 +269,7 @@ func ExampleUserClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUserGenerateSsoUrl.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUserGenerateSsoUrl.json func ExampleUserClient_GenerateSsoURL() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -292,7 +292,7 @@ func ExampleUserClient_GenerateSsoURL() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUserToken.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUserToken.json func ExampleUserClient_GetSharedAccessToken() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/userconfirmationpassword_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/userconfirmationpassword_client.go index 670665918030..574324c04e0c 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/userconfirmationpassword_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/userconfirmationpassword_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type UserConfirmationPasswordClient struct { } // NewUserConfirmationPasswordClient creates a new instance of UserConfirmationPasswordClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewUserConfirmationPasswordClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserConfirmationPasswordClient, error) { @@ -48,23 +46,25 @@ func NewUserConfirmationPasswordClient(subscriptionID string, credential azcore. // Send - Sends confirmation // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - userID - User identifier. Must be unique in the current API Management service instance. // - options - UserConfirmationPasswordClientSendOptions contains the optional parameters for the UserConfirmationPasswordClient.Send // method. func (client *UserConfirmationPasswordClient) Send(ctx context.Context, resourceGroupName string, serviceName string, userID string, options *UserConfirmationPasswordClientSendOptions) (UserConfirmationPasswordClientSendResponse, error) { + var err error req, err := client.sendCreateRequest(ctx, resourceGroupName, serviceName, userID, options) if err != nil { return UserConfirmationPasswordClientSendResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return UserConfirmationPasswordClientSendResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return UserConfirmationPasswordClientSendResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return UserConfirmationPasswordClientSendResponse{}, err } return UserConfirmationPasswordClientSendResponse{}, nil } @@ -93,7 +93,7 @@ func (client *UserConfirmationPasswordClient) sendCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") if options != nil && options.AppType != nil { reqQP.Set("appType", string(*options.AppType)) } diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/userconfirmationpassword_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/userconfirmationpassword_client_example_test.go index 728b7726471b..62f66cf6e6e2 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/userconfirmationpassword_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/userconfirmationpassword_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUserConfirmationPasswordSend.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementUserConfirmationPasswordSend.json func ExampleUserConfirmationPasswordClient_Send() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/usergroup_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/usergroup_client.go index 7c9710b74859..a056bce5b0df 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/usergroup_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/usergroup_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type UserGroupClient struct { } // NewUserGroupClient creates a new instance of UserGroupClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewUserGroupClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserGroupClient, error) { @@ -48,8 +46,8 @@ func NewUserGroupClient(subscriptionID string, credential azcore.TokenCredential // NewListPager - Lists all user groups. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - userID - User identifier. Must be unique in the current API Management service instance. // - options - UserGroupClientListOptions contains the optional parameters for the UserGroupClient.NewListPager method. @@ -114,7 +112,7 @@ func (client *UserGroupClient) listCreateRequest(ctx context.Context, resourceGr if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/usergroup_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/usergroup_client_example_test.go index 064c3ff66fcf..0bf66c09cb3c 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/usergroup_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/usergroup_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUserGroups.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListUserGroups.json func ExampleUserGroupClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/useridentities_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/useridentities_client.go index 7645b813b424..9185fb6fd175 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/useridentities_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/useridentities_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -29,8 +28,7 @@ type UserIdentitiesClient struct { } // NewUserIdentitiesClient creates a new instance of UserIdentitiesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewUserIdentitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserIdentitiesClient, error) { @@ -47,8 +45,8 @@ func NewUserIdentitiesClient(subscriptionID string, credential azcore.TokenCrede // NewListPager - List of all user identities. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - userID - User identifier. Must be unique in the current API Management service instance. // - options - UserIdentitiesClientListOptions contains the optional parameters for the UserIdentitiesClient.NewListPager method. @@ -104,7 +102,7 @@ func (client *UserIdentitiesClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/useridentities_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/useridentities_client_example_test.go index cf8914e5cd72..8b55af502ca4 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/useridentities_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/useridentities_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUserIdentities.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListUserIdentities.json func ExampleUserIdentitiesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/usersubscription_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/usersubscription_client.go index c32d258d2e27..73faf367f327 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/usersubscription_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/usersubscription_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armapimanagement @@ -30,8 +29,7 @@ type UserSubscriptionClient struct { } // NewUserSubscriptionClient creates a new instance of UserSubscriptionClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewUserSubscriptionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserSubscriptionClient, error) { @@ -49,25 +47,28 @@ func NewUserSubscriptionClient(subscriptionID string, credential azcore.TokenCre // Get - Gets the specified Subscription entity associated with a particular user. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - userID - User identifier. Must be unique in the current API Management service instance. // - sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. // - options - UserSubscriptionClientGetOptions contains the optional parameters for the UserSubscriptionClient.Get method. func (client *UserSubscriptionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, userID string, sid string, options *UserSubscriptionClientGetOptions) (UserSubscriptionClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, userID, sid, options) if err != nil { return UserSubscriptionClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return UserSubscriptionClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return UserSubscriptionClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return UserSubscriptionClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -98,7 +99,7 @@ func (client *UserSubscriptionClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -118,8 +119,8 @@ func (client *UserSubscriptionClient) getHandleResponse(resp *http.Response) (Us // NewListPager - Lists the collection of subscriptions of the specified user. // -// Generated from API version 2021-08-01 -// - resourceGroupName - The name of the resource group. +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of the API Management service. // - userID - User identifier. Must be unique in the current API Management service instance. // - options - UserSubscriptionClientListOptions contains the optional parameters for the UserSubscriptionClient.NewListPager @@ -185,7 +186,7 @@ func (client *UserSubscriptionClient) listCreateRequest(ctx context.Context, res if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/usersubscription_client_example_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/usersubscription_client_example_test.go index 0583f11c7aaf..35fa19cc062a 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/usersubscription_client_example_test.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/usersubscription_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUserSubscriptions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementListUserSubscriptions.json func ExampleUserSubscriptionClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -74,7 +74,7 @@ func ExampleUserSubscriptionClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetUserSubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4cd95123fb961c68740565a1efcaa5e43bd35802/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2022-08-01/examples/ApiManagementGetUserSubscription.json func ExampleUserSubscriptionClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil {