From 1338fe0b2b373d4c772818540dfd3b109c7d7a8e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 10 Aug 2023 18:27:47 +0000 Subject: [PATCH] CodeGen from PR 25270 in Azure/azure-rest-api-specs Merge 331c9f62549ad4596d0848b06ce0f645a8d949af into d3edca94ae4ddb854e88142cba6a7337ef1a5eed --- .../armmanagedapplications/CHANGELOG.md | 4 + .../application_client.go | 3 +- .../application_client_example_test.go | 62 --- .../applicationdefinitions_client.go | 87 ++-- ...licationdefinitions_client_example_test.go | 237 ----------- .../applications_client.go | 119 ++++-- .../applications_client_example_test.go | 381 ------------------ .../armmanagedapplications/autorest.md | 6 +- .../armmanagedapplications/client_factory.go | 11 +- .../armmanagedapplications/constants.go | 13 +- .../resources/armmanagedapplications/go.mod | 20 +- .../resources/armmanagedapplications/go.sum | 38 +- .../armmanagedapplications/models.go | 114 +----- .../armmanagedapplications/models_serde.go | 3 +- .../armmanagedapplications/options.go | 120 ++++++ .../armmanagedapplications/response_types.go | 18 +- 16 files changed, 306 insertions(+), 930 deletions(-) delete mode 100644 sdk/resourcemanager/resources/armmanagedapplications/application_client_example_test.go delete mode 100644 sdk/resourcemanager/resources/armmanagedapplications/applicationdefinitions_client_example_test.go delete mode 100644 sdk/resourcemanager/resources/armmanagedapplications/applications_client_example_test.go create mode 100644 sdk/resourcemanager/resources/armmanagedapplications/options.go diff --git a/sdk/resourcemanager/resources/armmanagedapplications/CHANGELOG.md b/sdk/resourcemanager/resources/armmanagedapplications/CHANGELOG.md index 18f569794de4..ea2b08751b08 100644 --- a/sdk/resourcemanager/resources/armmanagedapplications/CHANGELOG.md +++ b/sdk/resourcemanager/resources/armmanagedapplications/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.1.2 (2023-08-10) +### Other Changes + + ## 1.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/resources/armmanagedapplications/application_client.go b/sdk/resourcemanager/resources/armmanagedapplications/application_client.go index 7c745db1c0f9..0a6b34d01b10 100644 --- a/sdk/resourcemanager/resources/armmanagedapplications/application_client.go +++ b/sdk/resourcemanager/resources/armmanagedapplications/application_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 armmanagedapplications diff --git a/sdk/resourcemanager/resources/armmanagedapplications/application_client_example_test.go b/sdk/resourcemanager/resources/armmanagedapplications/application_client_example_test.go deleted file mode 100644 index a65aa4faf1de..000000000000 --- a/sdk/resourcemanager/resources/armmanagedapplications/application_client_example_test.go +++ /dev/null @@ -1,62 +0,0 @@ -//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 armmanagedapplications_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armmanagedapplications" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Solutions/stable/2018-06-01/examples/listSolutionsOperations.json -func ExampleApplicationClient_NewListOperationsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagedapplications.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationClient().NewListOperationsPager(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.OperationListResult = armmanagedapplications.OperationListResult{ - // Value: []*armmanagedapplications.Operation{ - // { - // Name: to.Ptr("SolutionsOpeartion1"), - // Display: &armmanagedapplications.OperationDisplay{ - // Operation: to.Ptr("Read"), - // Provider: to.Ptr("Microsoft.ResourceProvider"), - // Resource: to.Ptr("Resource1"), - // }, - // }, - // { - // Name: to.Ptr("SolutionssOpeartion2"), - // Display: &armmanagedapplications.OperationDisplay{ - // Operation: to.Ptr("Write"), - // Provider: to.Ptr("Microsoft.ResourceProvider"), - // Resource: to.Ptr("Resource2"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/resources/armmanagedapplications/applicationdefinitions_client.go b/sdk/resourcemanager/resources/armmanagedapplications/applicationdefinitions_client.go index 70eb2716ff7d..407b48134654 100644 --- a/sdk/resourcemanager/resources/armmanagedapplications/applicationdefinitions_client.go +++ b/sdk/resourcemanager/resources/armmanagedapplications/applicationdefinitions_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 armmanagedapplications @@ -59,7 +58,8 @@ func (client *ApplicationDefinitionsClient) BeginCreateOrUpdate(ctx context.Cont if err != nil { return nil, err } - return runtime.NewPoller[ApplicationDefinitionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ApplicationDefinitionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationDefinitionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,18 +70,20 @@ func (client *ApplicationDefinitionsClient) BeginCreateOrUpdate(ctx context.Cont // // Generated from API version 2018-06-01 func (client *ApplicationDefinitionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, applicationDefinitionName string, parameters ApplicationDefinition, options *ApplicationDefinitionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, applicationDefinitionName, 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) { - 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. @@ -107,7 +109,10 @@ func (client *ApplicationDefinitionsClient) createOrUpdateCreateRequest(ctx cont reqQP.Set("api-version", "2018-06-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 } // BeginCreateOrUpdateByID - Creates a new managed application definition. @@ -125,7 +130,8 @@ func (client *ApplicationDefinitionsClient) BeginCreateOrUpdateByID(ctx context. if err != nil { return nil, err } - return runtime.NewPoller[ApplicationDefinitionsClientCreateOrUpdateByIDResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ApplicationDefinitionsClientCreateOrUpdateByIDResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationDefinitionsClientCreateOrUpdateByIDResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -136,18 +142,20 @@ func (client *ApplicationDefinitionsClient) BeginCreateOrUpdateByID(ctx context. // // Generated from API version 2018-06-01 func (client *ApplicationDefinitionsClient) createOrUpdateByID(ctx context.Context, resourceGroupName string, applicationDefinitionName string, parameters ApplicationDefinition, options *ApplicationDefinitionsClientBeginCreateOrUpdateByIDOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateByIDCreateRequest(ctx, resourceGroupName, applicationDefinitionName, 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) { - 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 } // createOrUpdateByIDCreateRequest creates the CreateOrUpdateByID request. @@ -173,7 +181,10 @@ func (client *ApplicationDefinitionsClient) createOrUpdateByIDCreateRequest(ctx reqQP.Set("api-version", "2018-06-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 the managed application definition. @@ -190,7 +201,8 @@ func (client *ApplicationDefinitionsClient) BeginDelete(ctx context.Context, res if err != nil { return nil, err } - return runtime.NewPoller[ApplicationDefinitionsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ApplicationDefinitionsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationDefinitionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -201,18 +213,20 @@ func (client *ApplicationDefinitionsClient) BeginDelete(ctx context.Context, res // // Generated from API version 2018-06-01 func (client *ApplicationDefinitionsClient) deleteOperation(ctx context.Context, resourceGroupName string, applicationDefinitionName string, options *ApplicationDefinitionsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, applicationDefinitionName, 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. @@ -255,7 +269,8 @@ func (client *ApplicationDefinitionsClient) BeginDeleteByID(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[ApplicationDefinitionsClientDeleteByIDResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ApplicationDefinitionsClientDeleteByIDResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationDefinitionsClientDeleteByIDResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -266,18 +281,20 @@ func (client *ApplicationDefinitionsClient) BeginDeleteByID(ctx context.Context, // // Generated from API version 2018-06-01 func (client *ApplicationDefinitionsClient) deleteByID(ctx context.Context, resourceGroupName string, applicationDefinitionName string, options *ApplicationDefinitionsClientBeginDeleteByIDOptions) (*http.Response, error) { + var err error req, err := client.deleteByIDCreateRequest(ctx, resourceGroupName, applicationDefinitionName, 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 } // deleteByIDCreateRequest creates the DeleteByID request. @@ -315,18 +332,21 @@ func (client *ApplicationDefinitionsClient) deleteByIDCreateRequest(ctx context. // - options - ApplicationDefinitionsClientGetOptions contains the optional parameters for the ApplicationDefinitionsClient.Get // method. func (client *ApplicationDefinitionsClient) Get(ctx context.Context, resourceGroupName string, applicationDefinitionName string, options *ApplicationDefinitionsClientGetOptions) (ApplicationDefinitionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, applicationDefinitionName, options) if err != nil { return ApplicationDefinitionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ApplicationDefinitionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNotFound) { - return ApplicationDefinitionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNotFound) { + err = runtime.NewResponseError(httpResp) + return ApplicationDefinitionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -373,18 +393,21 @@ func (client *ApplicationDefinitionsClient) getHandleResponse(resp *http.Respons // - options - ApplicationDefinitionsClientGetByIDOptions contains the optional parameters for the ApplicationDefinitionsClient.GetByID // method. func (client *ApplicationDefinitionsClient) GetByID(ctx context.Context, resourceGroupName string, applicationDefinitionName string, options *ApplicationDefinitionsClientGetByIDOptions) (ApplicationDefinitionsClientGetByIDResponse, error) { + var err error req, err := client.getByIDCreateRequest(ctx, resourceGroupName, applicationDefinitionName, options) if err != nil { return ApplicationDefinitionsClientGetByIDResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ApplicationDefinitionsClientGetByIDResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNotFound) { - return ApplicationDefinitionsClientGetByIDResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNotFound) { + err = runtime.NewResponseError(httpResp) + return ApplicationDefinitionsClientGetByIDResponse{}, err } - return client.getByIDHandleResponse(resp) + resp, err := client.getByIDHandleResponse(httpResp) + return resp, err } // getByIDCreateRequest creates the GetByID request. diff --git a/sdk/resourcemanager/resources/armmanagedapplications/applicationdefinitions_client_example_test.go b/sdk/resourcemanager/resources/armmanagedapplications/applicationdefinitions_client_example_test.go deleted file mode 100644 index 2cc2e38b19b3..000000000000 --- a/sdk/resourcemanager/resources/armmanagedapplications/applicationdefinitions_client_example_test.go +++ /dev/null @@ -1,237 +0,0 @@ -//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 armmanagedapplications_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/resources/armmanagedapplications" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Solutions/stable/2018-06-01/examples/getApplicationDefinition.json -func ExampleApplicationDefinitionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagedapplications.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationDefinitionsClient().Get(ctx, "rg", "myManagedApplicationDef", 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.ApplicationDefinition = armmanagedapplications.ApplicationDefinition{ - // Name: to.Ptr("myManagedApplicationDef"), - // Type: to.Ptr("Microsoft.Solutions/applicationDefinitions"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myManagedApplicationDef"), - // Location: to.Ptr("East US 2"), - // Properties: &armmanagedapplications.ApplicationDefinitionProperties{ - // Description: to.Ptr("myManagedApplicationDef description"), - // Artifacts: []*armmanagedapplications.ApplicationArtifact{ - // { - // Name: to.Ptr("CreateUiDefinition"), - // Type: to.Ptr(armmanagedapplications.ApplicationArtifactTypeCustom), - // URI: to.Ptr("https://path/to/managedApplicationCreateUiDefinition.json"), - // }, - // { - // Name: to.Ptr("ManagedApplicationResourceTemplate"), - // Type: to.Ptr(armmanagedapplications.ApplicationArtifactTypeTemplate), - // URI: to.Ptr("https://path/to/mainTemplate.json"), - // }}, - // Authorizations: []*armmanagedapplications.ApplicationProviderAuthorization{ - // { - // PrincipalID: to.Ptr("validprincipalguid"), - // RoleDefinitionID: to.Ptr("validroleguid"), - // }}, - // DisplayName: to.Ptr("myManagedApplicationDef"), - // LockLevel: to.Ptr(armmanagedapplications.ApplicationLockLevelNone), - // PackageFileURI: to.Ptr("https://path/to/packagezipfile"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Solutions/stable/2018-06-01/examples/deleteApplicationDefinition.json -func ExampleApplicationDefinitionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagedapplications.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationDefinitionsClient().BeginDelete(ctx, "rg", "myManagedApplicationDef", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Solutions/stable/2018-06-01/examples/createOrUpdateApplicationDefinition.json -func ExampleApplicationDefinitionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagedapplications.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationDefinitionsClient().BeginCreateOrUpdate(ctx, "rg", "myManagedApplicationDef", armmanagedapplications.ApplicationDefinition{ - Location: to.Ptr("East US 2"), - Properties: &armmanagedapplications.ApplicationDefinitionProperties{ - Description: to.Ptr("myManagedApplicationDef description"), - Authorizations: []*armmanagedapplications.ApplicationProviderAuthorization{ - { - PrincipalID: to.Ptr("validprincipalguid"), - RoleDefinitionID: to.Ptr("validroleguid"), - }}, - DisplayName: to.Ptr("myManagedApplicationDef"), - LockLevel: to.Ptr(armmanagedapplications.ApplicationLockLevelNone), - PackageFileURI: to.Ptr("https://path/to/packagezipfile"), - }, - }, 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.ApplicationDefinition = armmanagedapplications.ApplicationDefinition{ - // Name: to.Ptr("myManagedApplicationDef"), - // Type: to.Ptr("Microsoft.Solutions/applicationDefinitions"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myManagedApplicationDef"), - // Location: to.Ptr("East US 2"), - // Properties: &armmanagedapplications.ApplicationDefinitionProperties{ - // Description: to.Ptr("myManagedApplicationDef description"), - // Artifacts: []*armmanagedapplications.ApplicationArtifact{ - // { - // Name: to.Ptr("CreateUiDefinition"), - // Type: to.Ptr(armmanagedapplications.ApplicationArtifactTypeCustom), - // URI: to.Ptr("https://path/to/managedApplicationCreateUiDefinition.json"), - // }, - // { - // Name: to.Ptr("ManagedApplicationResourceTemplate"), - // Type: to.Ptr(armmanagedapplications.ApplicationArtifactTypeTemplate), - // URI: to.Ptr("https://path/to/mainTemplate.json"), - // }}, - // Authorizations: []*armmanagedapplications.ApplicationProviderAuthorization{ - // { - // PrincipalID: to.Ptr("validprincipalguid"), - // RoleDefinitionID: to.Ptr("validroleguid"), - // }}, - // DisplayName: to.Ptr("myManagedApplicationDef"), - // LockLevel: to.Ptr(armmanagedapplications.ApplicationLockLevelNone), - // PackageFileURI: to.Ptr("https://path/to/packagezipfile"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Solutions/stable/2018-06-01/examples/listApplicationDefinitionsByResourceGroup.json -func ExampleApplicationDefinitionsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagedapplications.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationDefinitionsClient().NewListByResourceGroupPager("rg", 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.ApplicationDefinitionListResult = armmanagedapplications.ApplicationDefinitionListResult{ - // Value: []*armmanagedapplications.ApplicationDefinition{ - // { - // Name: to.Ptr("myManagedApplicationDef"), - // Type: to.Ptr("Microsoft.Solutions/applicationDefinitions"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myManagedApplicationDef"), - // Location: to.Ptr("East US 2"), - // Properties: &armmanagedapplications.ApplicationDefinitionProperties{ - // Description: to.Ptr("myManagedApplicationDef description"), - // Artifacts: []*armmanagedapplications.ApplicationArtifact{ - // { - // Name: to.Ptr("CreateUiDefinition"), - // Type: to.Ptr(armmanagedapplications.ApplicationArtifactTypeCustom), - // URI: to.Ptr("https://path/to/managedApplicationCreateUiDefinition.json"), - // }, - // { - // Name: to.Ptr("ManagedApplicationResourceTemplate"), - // Type: to.Ptr(armmanagedapplications.ApplicationArtifactTypeTemplate), - // URI: to.Ptr("https://path/to/mainTemplate.json"), - // }}, - // Authorizations: []*armmanagedapplications.ApplicationProviderAuthorization{ - // { - // PrincipalID: to.Ptr("validprincipalguid"), - // RoleDefinitionID: to.Ptr("validroleguid"), - // }}, - // DisplayName: to.Ptr("myManagedApplicationDef"), - // LockLevel: to.Ptr(armmanagedapplications.ApplicationLockLevelNone), - // PackageFileURI: to.Ptr("https://path/to/packagezipfile"), - // }, - // }, - // { - // Name: to.Ptr("myManagedApplicationDef2"), - // Type: to.Ptr("Microsoft.Solutions/applicationDefinitions"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myManagedApplicationDef2"), - // Location: to.Ptr("West US"), - // Properties: &armmanagedapplications.ApplicationDefinitionProperties{ - // Description: to.Ptr("myManagedApplicationDef2 description"), - // Artifacts: []*armmanagedapplications.ApplicationArtifact{ - // { - // Name: to.Ptr("CreateUiDefinition"), - // Type: to.Ptr(armmanagedapplications.ApplicationArtifactTypeCustom), - // URI: to.Ptr("https://path/to/managedApplicationCreateUiDefinition.json"), - // }, - // { - // Name: to.Ptr("ManagedApplicationResourceTemplate"), - // Type: to.Ptr(armmanagedapplications.ApplicationArtifactTypeTemplate), - // URI: to.Ptr("https://path/to/mainTemplate.json"), - // }}, - // Authorizations: []*armmanagedapplications.ApplicationProviderAuthorization{ - // { - // PrincipalID: to.Ptr("validprincipalguid"), - // RoleDefinitionID: to.Ptr("validroleguid"), - // }}, - // DisplayName: to.Ptr("myManagedApplicationDef2"), - // LockLevel: to.Ptr(armmanagedapplications.ApplicationLockLevelNone), - // PackageFileURI: to.Ptr("https://path/to/packagezipfile"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/resources/armmanagedapplications/applications_client.go b/sdk/resourcemanager/resources/armmanagedapplications/applications_client.go index eedbcb9f9930..c7a1e39c70b7 100644 --- a/sdk/resourcemanager/resources/armmanagedapplications/applications_client.go +++ b/sdk/resourcemanager/resources/armmanagedapplications/applications_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 armmanagedapplications @@ -59,7 +58,8 @@ func (client *ApplicationsClient) BeginCreateOrUpdate(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller[ApplicationsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ApplicationsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,18 +70,20 @@ func (client *ApplicationsClient) BeginCreateOrUpdate(ctx context.Context, resou // // Generated from API version 2018-06-01 func (client *ApplicationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, applicationName string, parameters Application, options *ApplicationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, applicationName, 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) { - 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. @@ -107,7 +109,10 @@ func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Contex reqQP.Set("api-version", "2018-06-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 } // BeginCreateOrUpdateByID - Creates a new managed application. @@ -126,7 +131,8 @@ func (client *ApplicationsClient) BeginCreateOrUpdateByID(ctx context.Context, a if err != nil { return nil, err } - return runtime.NewPoller[ApplicationsClientCreateOrUpdateByIDResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ApplicationsClientCreateOrUpdateByIDResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationsClientCreateOrUpdateByIDResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -137,18 +143,20 @@ func (client *ApplicationsClient) BeginCreateOrUpdateByID(ctx context.Context, a // // Generated from API version 2018-06-01 func (client *ApplicationsClient) createOrUpdateByID(ctx context.Context, applicationID string, parameters Application, options *ApplicationsClientBeginCreateOrUpdateByIDOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateByIDCreateRequest(ctx, applicationID, 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) { - 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 } // createOrUpdateByIDCreateRequest creates the CreateOrUpdateByID request. @@ -163,7 +171,10 @@ func (client *ApplicationsClient) createOrUpdateByIDCreateRequest(ctx context.Co reqQP.Set("api-version", "2018-06-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 the managed application. @@ -180,7 +191,8 @@ func (client *ApplicationsClient) BeginDelete(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller[ApplicationsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ApplicationsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -191,18 +203,20 @@ func (client *ApplicationsClient) BeginDelete(ctx context.Context, resourceGroup // // Generated from API version 2018-06-01 func (client *ApplicationsClient) deleteOperation(ctx context.Context, resourceGroupName string, applicationName string, options *ApplicationsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, applicationName, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -246,7 +260,8 @@ func (client *ApplicationsClient) BeginDeleteByID(ctx context.Context, applicati if err != nil { return nil, err } - return runtime.NewPoller[ApplicationsClientDeleteByIDResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ApplicationsClientDeleteByIDResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationsClientDeleteByIDResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -257,18 +272,20 @@ func (client *ApplicationsClient) BeginDeleteByID(ctx context.Context, applicati // // Generated from API version 2018-06-01 func (client *ApplicationsClient) deleteByID(ctx context.Context, applicationID string, options *ApplicationsClientBeginDeleteByIDOptions) (*http.Response, error) { + var err error req, err := client.deleteByIDCreateRequest(ctx, applicationID, 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.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteByIDCreateRequest creates the DeleteByID request. @@ -294,18 +311,21 @@ func (client *ApplicationsClient) deleteByIDCreateRequest(ctx context.Context, a // - applicationName - The name of the managed application. // - options - ApplicationsClientGetOptions contains the optional parameters for the ApplicationsClient.Get method. func (client *ApplicationsClient) Get(ctx context.Context, resourceGroupName string, applicationName string, options *ApplicationsClientGetOptions) (ApplicationsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, applicationName, options) if err != nil { return ApplicationsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ApplicationsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNotFound) { - return ApplicationsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNotFound) { + err = runtime.NewResponseError(httpResp) + return ApplicationsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -352,18 +372,21 @@ func (client *ApplicationsClient) getHandleResponse(resp *http.Response) (Applic // /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} // - options - ApplicationsClientGetByIDOptions contains the optional parameters for the ApplicationsClient.GetByID method. func (client *ApplicationsClient) GetByID(ctx context.Context, applicationID string, options *ApplicationsClientGetByIDOptions) (ApplicationsClientGetByIDResponse, error) { + var err error req, err := client.getByIDCreateRequest(ctx, applicationID, options) if err != nil { return ApplicationsClientGetByIDResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ApplicationsClientGetByIDResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNotFound) { - return ApplicationsClientGetByIDResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNotFound) { + err = runtime.NewResponseError(httpResp) + return ApplicationsClientGetByIDResponse{}, err } - return client.getByIDHandleResponse(resp) + resp, err := client.getByIDHandleResponse(httpResp) + return resp, err } // getByIDCreateRequest creates the GetByID request. @@ -523,18 +546,21 @@ func (client *ApplicationsClient) listBySubscriptionHandleResponse(resp *http.Re // - applicationName - The name of the managed application. // - options - ApplicationsClientUpdateOptions contains the optional parameters for the ApplicationsClient.Update method. func (client *ApplicationsClient) Update(ctx context.Context, resourceGroupName string, applicationName string, options *ApplicationsClientUpdateOptions) (ApplicationsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, applicationName, options) if err != nil { return ApplicationsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ApplicationsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ApplicationsClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -561,7 +587,10 @@ func (client *ApplicationsClient) updateCreateRequest(ctx context.Context, resou 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 } @@ -584,18 +613,21 @@ func (client *ApplicationsClient) updateHandleResponse(resp *http.Response) (App // /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applications/{application-name} // - options - ApplicationsClientUpdateByIDOptions contains the optional parameters for the ApplicationsClient.UpdateByID method. func (client *ApplicationsClient) UpdateByID(ctx context.Context, applicationID string, options *ApplicationsClientUpdateByIDOptions) (ApplicationsClientUpdateByIDResponse, error) { + var err error req, err := client.updateByIDCreateRequest(ctx, applicationID, options) if err != nil { return ApplicationsClientUpdateByIDResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ApplicationsClientUpdateByIDResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationsClientUpdateByIDResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ApplicationsClientUpdateByIDResponse{}, err } - return client.updateByIDHandleResponse(resp) + resp, err := client.updateByIDHandleResponse(httpResp) + return resp, err } // updateByIDCreateRequest creates the UpdateByID request. @@ -611,7 +643,10 @@ func (client *ApplicationsClient) updateByIDCreateRequest(ctx context.Context, a 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 } diff --git a/sdk/resourcemanager/resources/armmanagedapplications/applications_client_example_test.go b/sdk/resourcemanager/resources/armmanagedapplications/applications_client_example_test.go deleted file mode 100644 index 63b8f7224a2c..000000000000 --- a/sdk/resourcemanager/resources/armmanagedapplications/applications_client_example_test.go +++ /dev/null @@ -1,381 +0,0 @@ -//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 armmanagedapplications_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/resources/armmanagedapplications" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Solutions/stable/2018-06-01/examples/getApplication.json -func ExampleApplicationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagedapplications.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationsClient().Get(ctx, "rg", "myManagedApplication", 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.Application = armmanagedapplications.Application{ - // Name: to.Ptr("myManagedApplication"), - // Type: to.Ptr("Microsoft.Solutions/applications"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/myManagedApplication"), - // Location: to.Ptr("East US 2"), - // Kind: to.Ptr("ServiceCatalog"), - // Properties: &armmanagedapplications.ApplicationProperties{ - // ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"), - // ProvisioningState: to.Ptr(armmanagedapplications.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Solutions/stable/2018-06-01/examples/deleteApplication.json -func ExampleApplicationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagedapplications.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationsClient().BeginDelete(ctx, "rg", "myManagedApplication", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Solutions/stable/2018-06-01/examples/createOrUpdateApplication.json -func ExampleApplicationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagedapplications.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationsClient().BeginCreateOrUpdate(ctx, "rg", "myManagedApplication", armmanagedapplications.Application{ - Location: to.Ptr("East US 2"), - Kind: to.Ptr("ServiceCatalog"), - Properties: &armmanagedapplications.ApplicationProperties{ - ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"), - }, - }, 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.Application = armmanagedapplications.Application{ - // Name: to.Ptr("myManagedApplication"), - // Type: to.Ptr("Microsoft.Solutions/applications"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/myManagedApplication"), - // Location: to.Ptr("East US 2"), - // Kind: to.Ptr("ServiceCatalog"), - // Properties: &armmanagedapplications.ApplicationProperties{ - // ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"), - // ProvisioningState: to.Ptr(armmanagedapplications.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Solutions/stable/2018-06-01/examples/updateApplication.json -func ExampleApplicationsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagedapplications.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationsClient().Update(ctx, "rg", "myManagedApplication", &armmanagedapplications.ApplicationsClientUpdateOptions{Parameters: &armmanagedapplications.ApplicationPatchable{ - Kind: to.Ptr("ServiceCatalog"), - Properties: &armmanagedapplications.ApplicationPropertiesPatchable{ - ApplicationDefinitionID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myAppDef"), - ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"), - }, - }, - }) - 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.Application = armmanagedapplications.Application{ - // Name: to.Ptr("myManagedApplication"), - // Type: to.Ptr("Microsoft.Solutions/applications"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/myManagedApplication"), - // Kind: to.Ptr("ServiceCatalog"), - // Properties: &armmanagedapplications.ApplicationProperties{ - // ApplicationDefinitionID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myAppDef"), - // ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"), - // ProvisioningState: to.Ptr(armmanagedapplications.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Solutions/stable/2018-06-01/examples/listApplicationsByResourceGroup.json -func ExampleApplicationsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagedapplications.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationsClient().NewListByResourceGroupPager("rg", 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.ApplicationListResult = armmanagedapplications.ApplicationListResult{ - // Value: []*armmanagedapplications.Application{ - // { - // Name: to.Ptr("myManagedApplication"), - // Type: to.Ptr("Microsoft.Solutions/applications"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/myManagedApplication"), - // Location: to.Ptr("East US 2"), - // Kind: to.Ptr("ServiceCatalog"), - // Properties: &armmanagedapplications.ApplicationProperties{ - // ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"), - // ProvisioningState: to.Ptr(armmanagedapplications.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("myManagedApplication2"), - // Type: to.Ptr("Microsoft.Solutions/applications"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/myManagedApplication2"), - // Location: to.Ptr("West US"), - // Kind: to.Ptr("ServiceCatalog"), - // Properties: &armmanagedapplications.ApplicationProperties{ - // ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"), - // ProvisioningState: to.Ptr(armmanagedapplications.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Solutions/stable/2018-06-01/examples/listApplicationsBySubscription.json -func ExampleApplicationsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagedapplications.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationsClient().NewListBySubscriptionPager(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.ApplicationListResult = armmanagedapplications.ApplicationListResult{ - // Value: []*armmanagedapplications.Application{ - // { - // Name: to.Ptr("myManagedApplication"), - // Type: to.Ptr("Microsoft.Solutions/applications"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/myManagedApplication"), - // Location: to.Ptr("East US 2"), - // Kind: to.Ptr("ServiceCatalog"), - // Properties: &armmanagedapplications.ApplicationProperties{ - // ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"), - // ProvisioningState: to.Ptr(armmanagedapplications.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("myManagedApplication2"), - // Type: to.Ptr("Microsoft.Solutions/applications"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/myManagedApplication2"), - // Location: to.Ptr("West US"), - // Kind: to.Ptr("ServiceCatalog"), - // Properties: &armmanagedapplications.ApplicationProperties{ - // ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"), - // ProvisioningState: to.Ptr(armmanagedapplications.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Solutions/stable/2018-06-01/examples/getApplicationById.json -func ExampleApplicationsClient_GetByID() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagedapplications.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationsClient().GetByID(ctx, "myApplicationId", 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.Application = armmanagedapplications.Application{ - // Name: to.Ptr("myManagedApplication"), - // Type: to.Ptr("Microsoft.Solutions/applications"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/myManagedApplication"), - // Location: to.Ptr("East US 2"), - // Kind: to.Ptr("ServiceCatalog"), - // Properties: &armmanagedapplications.ApplicationProperties{ - // ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"), - // ProvisioningState: to.Ptr(armmanagedapplications.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Solutions/stable/2018-06-01/examples/deleteApplicationById.json -func ExampleApplicationsClient_BeginDeleteByID() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagedapplications.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationsClient().BeginDeleteByID(ctx, "myApplicationId", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Solutions/stable/2018-06-01/examples/createOrUpdateApplicationById.json -func ExampleApplicationsClient_BeginCreateOrUpdateByID() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagedapplications.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationsClient().BeginCreateOrUpdateByID(ctx, "myApplicationId", armmanagedapplications.Application{ - Location: to.Ptr("East US 2"), - Kind: to.Ptr("ServiceCatalog"), - Properties: &armmanagedapplications.ApplicationProperties{ - ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"), - }, - }, 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.Application = armmanagedapplications.Application{ - // Name: to.Ptr("myManagedApplication"), - // Type: to.Ptr("Microsoft.Solutions/applications"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/myManagedApplication"), - // Location: to.Ptr("East US 2"), - // Kind: to.Ptr("ServiceCatalog"), - // Properties: &armmanagedapplications.ApplicationProperties{ - // ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"), - // ProvisioningState: to.Ptr(armmanagedapplications.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/Microsoft.Solutions/stable/2018-06-01/examples/updateApplicationById.json -func ExampleApplicationsClient_UpdateByID() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armmanagedapplications.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationsClient().UpdateByID(ctx, "myApplicationId", &armmanagedapplications.ApplicationsClientUpdateByIDOptions{Parameters: &armmanagedapplications.Application{ - Kind: to.Ptr("ServiceCatalog"), - Properties: &armmanagedapplications.ApplicationProperties{ - ApplicationDefinitionID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myAppDef"), - ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"), - }, - }, - }) - 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.Application = armmanagedapplications.Application{ - // Name: to.Ptr("myManagedApplication"), - // Type: to.Ptr("Microsoft.Solutions/applications"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applications/myManagedApplication"), - // Kind: to.Ptr("ServiceCatalog"), - // Properties: &armmanagedapplications.ApplicationProperties{ - // ApplicationDefinitionID: to.Ptr("/subscriptions/subid/resourceGroups/rg/providers/Microsoft.Solutions/applicationDefinitions/myAppDef"), - // ManagedResourceGroupID: to.Ptr("/subscriptions/subid/resourceGroups/myManagedRG"), - // ProvisioningState: to.Ptr(armmanagedapplications.ProvisioningStateSucceeded), - // }, - // } -} diff --git a/sdk/resourcemanager/resources/armmanagedapplications/autorest.md b/sdk/resourcemanager/resources/armmanagedapplications/autorest.md index dc4d55881acf..4b2d9ace7346 100644 --- a/sdk/resourcemanager/resources/armmanagedapplications/autorest.md +++ b/sdk/resourcemanager/resources/armmanagedapplications/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/resources/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/resources/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/resources/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.1 +module-version: 1.1.2 package-managedapplications: true ``` \ No newline at end of file diff --git a/sdk/resourcemanager/resources/armmanagedapplications/client_factory.go b/sdk/resourcemanager/resources/armmanagedapplications/client_factory.go index e69a61f397c7..9df5e178a022 100644 --- a/sdk/resourcemanager/resources/armmanagedapplications/client_factory.go +++ b/sdk/resourcemanager/resources/armmanagedapplications/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 armmanagedapplications @@ -43,12 +42,12 @@ func (c *ClientFactory) NewApplicationClient() *ApplicationClient { return subClient } -func (c *ClientFactory) NewApplicationsClient() *ApplicationsClient { - subClient, _ := NewApplicationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewApplicationDefinitionsClient() *ApplicationDefinitionsClient { + subClient, _ := NewApplicationDefinitionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewApplicationDefinitionsClient() *ApplicationDefinitionsClient { - subClient, _ := NewApplicationDefinitionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewApplicationsClient() *ApplicationsClient { + subClient, _ := NewApplicationsClient(c.subscriptionID, c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/resources/armmanagedapplications/constants.go b/sdk/resourcemanager/resources/armmanagedapplications/constants.go index f1134cea935b..6768d1e52102 100644 --- a/sdk/resourcemanager/resources/armmanagedapplications/constants.go +++ b/sdk/resourcemanager/resources/armmanagedapplications/constants.go @@ -3,30 +3,29 @@ // 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 armmanagedapplications const ( moduleName = "armmanagedapplications" - moduleVersion = "v1.1.1" + moduleVersion = "v1.1.2" ) // ApplicationArtifactType - The managed application artifact type. type ApplicationArtifactType string const ( - ApplicationArtifactTypeTemplate ApplicationArtifactType = "Template" ApplicationArtifactTypeCustom ApplicationArtifactType = "Custom" + ApplicationArtifactTypeTemplate ApplicationArtifactType = "Template" ) // PossibleApplicationArtifactTypeValues returns the possible values for the ApplicationArtifactType const type. func PossibleApplicationArtifactTypeValues() []ApplicationArtifactType { return []ApplicationArtifactType{ - ApplicationArtifactTypeTemplate, ApplicationArtifactTypeCustom, + ApplicationArtifactTypeTemplate, } } @@ -35,16 +34,16 @@ type ApplicationLockLevel string const ( ApplicationLockLevelCanNotDelete ApplicationLockLevel = "CanNotDelete" - ApplicationLockLevelReadOnly ApplicationLockLevel = "ReadOnly" ApplicationLockLevelNone ApplicationLockLevel = "None" + ApplicationLockLevelReadOnly ApplicationLockLevel = "ReadOnly" ) // PossibleApplicationLockLevelValues returns the possible values for the ApplicationLockLevel const type. func PossibleApplicationLockLevelValues() []ApplicationLockLevel { return []ApplicationLockLevel{ ApplicationLockLevelCanNotDelete, - ApplicationLockLevelReadOnly, ApplicationLockLevelNone, + ApplicationLockLevelReadOnly, } } diff --git a/sdk/resourcemanager/resources/armmanagedapplications/go.mod b/sdk/resourcemanager/resources/armmanagedapplications/go.mod index eb8afbb60516..1c0182a6d1b7 100644 --- a/sdk/resourcemanager/resources/armmanagedapplications/go.mod +++ b/sdk/resourcemanager/resources/armmanagedapplications/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armmanage go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // 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 + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/text v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/resources/armmanagedapplications/go.sum b/sdk/resourcemanager/resources/armmanagedapplications/go.sum index 8ba445a8c4da..5c6bee428364 100644 --- a/sdk/resourcemanager/resources/armmanagedapplications/go.sum +++ b/sdk/resourcemanager/resources/armmanagedapplications/go.sum @@ -1,31 +1,15 @@ -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/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/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +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/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/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -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/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= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +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/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/resources/armmanagedapplications/models.go b/sdk/resourcemanager/resources/armmanagedapplications/models.go index 39345d87aaad..cd94c10bef67 100644 --- a/sdk/resourcemanager/resources/armmanagedapplications/models.go +++ b/sdk/resourcemanager/resources/armmanagedapplications/models.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 armmanagedapplications @@ -57,12 +56,6 @@ type ApplicationArtifact struct { URI *string } -// ApplicationClientListOperationsOptions contains the optional parameters for the ApplicationClient.NewListOperationsPager -// method. -type ApplicationClientListOperationsOptions struct { - // placeholder for future optional parameters -} - // ApplicationDefinition - Information about managed application definition. type ApplicationDefinition struct { // REQUIRED; The managed application definition properties. @@ -135,51 +128,6 @@ type ApplicationDefinitionProperties struct { PackageFileURI *string } -// ApplicationDefinitionsClientBeginCreateOrUpdateByIDOptions contains the optional parameters for the ApplicationDefinitionsClient.BeginCreateOrUpdateByID -// method. -type ApplicationDefinitionsClientBeginCreateOrUpdateByIDOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationDefinitionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationDefinitionsClient.BeginCreateOrUpdate -// method. -type ApplicationDefinitionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationDefinitionsClientBeginDeleteByIDOptions contains the optional parameters for the ApplicationDefinitionsClient.BeginDeleteByID -// method. -type ApplicationDefinitionsClientBeginDeleteByIDOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationDefinitionsClientBeginDeleteOptions contains the optional parameters for the ApplicationDefinitionsClient.BeginDelete -// method. -type ApplicationDefinitionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationDefinitionsClientGetByIDOptions contains the optional parameters for the ApplicationDefinitionsClient.GetByID -// method. -type ApplicationDefinitionsClientGetByIDOptions struct { - // placeholder for future optional parameters -} - -// ApplicationDefinitionsClientGetOptions contains the optional parameters for the ApplicationDefinitionsClient.Get method. -type ApplicationDefinitionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ApplicationDefinitionsClientListByResourceGroupOptions contains the optional parameters for the ApplicationDefinitionsClient.NewListByResourceGroupPager -// method. -type ApplicationDefinitionsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - // ApplicationListResult - List of managed applications. type ApplicationListResult struct { // The URL to use for getting the next set of results. @@ -273,66 +221,6 @@ type ApplicationProviderAuthorization struct { RoleDefinitionID *string } -// ApplicationsClientBeginCreateOrUpdateByIDOptions contains the optional parameters for the ApplicationsClient.BeginCreateOrUpdateByID -// method. -type ApplicationsClientBeginCreateOrUpdateByIDOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationsClient.BeginCreateOrUpdate -// method. -type ApplicationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationsClientBeginDeleteByIDOptions contains the optional parameters for the ApplicationsClient.BeginDeleteByID method. -type ApplicationsClientBeginDeleteByIDOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationsClientBeginDeleteOptions contains the optional parameters for the ApplicationsClient.BeginDelete method. -type ApplicationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationsClientGetByIDOptions contains the optional parameters for the ApplicationsClient.GetByID method. -type ApplicationsClientGetByIDOptions struct { - // placeholder for future optional parameters -} - -// ApplicationsClientGetOptions contains the optional parameters for the ApplicationsClient.Get method. -type ApplicationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ApplicationsClientListByResourceGroupOptions contains the optional parameters for the ApplicationsClient.NewListByResourceGroupPager -// method. -type ApplicationsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ApplicationsClientListBySubscriptionOptions contains the optional parameters for the ApplicationsClient.NewListBySubscriptionPager -// method. -type ApplicationsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// ApplicationsClientUpdateByIDOptions contains the optional parameters for the ApplicationsClient.UpdateByID method. -type ApplicationsClientUpdateByIDOptions struct { - // Parameters supplied to update an existing managed application. - Parameters *Application -} - -// ApplicationsClientUpdateOptions contains the optional parameters for the ApplicationsClient.Update method. -type ApplicationsClientUpdateOptions struct { - // Parameters supplied to update an existing managed application. - Parameters *ApplicationPatchable -} - // ErrorResponse - Error response indicates managed application is not able to process the incoming request. The reason is // provided in the error message. type ErrorResponse struct { diff --git a/sdk/resourcemanager/resources/armmanagedapplications/models_serde.go b/sdk/resourcemanager/resources/armmanagedapplications/models_serde.go index 53d8f8694fdc..bf63041d30f9 100644 --- a/sdk/resourcemanager/resources/armmanagedapplications/models_serde.go +++ b/sdk/resourcemanager/resources/armmanagedapplications/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 armmanagedapplications diff --git a/sdk/resourcemanager/resources/armmanagedapplications/options.go b/sdk/resourcemanager/resources/armmanagedapplications/options.go new file mode 100644 index 000000000000..5c7cfd62992f --- /dev/null +++ b/sdk/resourcemanager/resources/armmanagedapplications/options.go @@ -0,0 +1,120 @@ +//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 armmanagedapplications + +// ApplicationClientListOperationsOptions contains the optional parameters for the ApplicationClient.NewListOperationsPager +// method. +type ApplicationClientListOperationsOptions struct { + // placeholder for future optional parameters +} + +// ApplicationDefinitionsClientBeginCreateOrUpdateByIDOptions contains the optional parameters for the ApplicationDefinitionsClient.BeginCreateOrUpdateByID +// method. +type ApplicationDefinitionsClientBeginCreateOrUpdateByIDOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationDefinitionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationDefinitionsClient.BeginCreateOrUpdate +// method. +type ApplicationDefinitionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationDefinitionsClientBeginDeleteByIDOptions contains the optional parameters for the ApplicationDefinitionsClient.BeginDeleteByID +// method. +type ApplicationDefinitionsClientBeginDeleteByIDOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationDefinitionsClientBeginDeleteOptions contains the optional parameters for the ApplicationDefinitionsClient.BeginDelete +// method. +type ApplicationDefinitionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationDefinitionsClientGetByIDOptions contains the optional parameters for the ApplicationDefinitionsClient.GetByID +// method. +type ApplicationDefinitionsClientGetByIDOptions struct { + // placeholder for future optional parameters +} + +// ApplicationDefinitionsClientGetOptions contains the optional parameters for the ApplicationDefinitionsClient.Get method. +type ApplicationDefinitionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ApplicationDefinitionsClientListByResourceGroupOptions contains the optional parameters for the ApplicationDefinitionsClient.NewListByResourceGroupPager +// method. +type ApplicationDefinitionsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ApplicationsClientBeginCreateOrUpdateByIDOptions contains the optional parameters for the ApplicationsClient.BeginCreateOrUpdateByID +// method. +type ApplicationsClientBeginCreateOrUpdateByIDOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationsClient.BeginCreateOrUpdate +// method. +type ApplicationsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationsClientBeginDeleteByIDOptions contains the optional parameters for the ApplicationsClient.BeginDeleteByID method. +type ApplicationsClientBeginDeleteByIDOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationsClientBeginDeleteOptions contains the optional parameters for the ApplicationsClient.BeginDelete method. +type ApplicationsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationsClientGetByIDOptions contains the optional parameters for the ApplicationsClient.GetByID method. +type ApplicationsClientGetByIDOptions struct { + // placeholder for future optional parameters +} + +// ApplicationsClientGetOptions contains the optional parameters for the ApplicationsClient.Get method. +type ApplicationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ApplicationsClientListByResourceGroupOptions contains the optional parameters for the ApplicationsClient.NewListByResourceGroupPager +// method. +type ApplicationsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ApplicationsClientListBySubscriptionOptions contains the optional parameters for the ApplicationsClient.NewListBySubscriptionPager +// method. +type ApplicationsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// ApplicationsClientUpdateByIDOptions contains the optional parameters for the ApplicationsClient.UpdateByID method. +type ApplicationsClientUpdateByIDOptions struct { + // Parameters supplied to update an existing managed application. + Parameters *Application +} + +// ApplicationsClientUpdateOptions contains the optional parameters for the ApplicationsClient.Update method. +type ApplicationsClientUpdateOptions struct { + // Parameters supplied to update an existing managed application. + Parameters *ApplicationPatchable +} diff --git a/sdk/resourcemanager/resources/armmanagedapplications/response_types.go b/sdk/resourcemanager/resources/armmanagedapplications/response_types.go index 6bdea07f4a33..d23fd86392f3 100644 --- a/sdk/resourcemanager/resources/armmanagedapplications/response_types.go +++ b/sdk/resourcemanager/resources/armmanagedapplications/response_types.go @@ -3,24 +3,27 @@ // 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 armmanagedapplications // ApplicationClientListOperationsResponse contains the response from method ApplicationClient.NewListOperationsPager. type ApplicationClientListOperationsResponse struct { + // Result of the request to list Microsoft.Solutions operations. It contains a list of operations and a URL link to get the + // next set of results. OperationListResult } // ApplicationDefinitionsClientCreateOrUpdateByIDResponse contains the response from method ApplicationDefinitionsClient.BeginCreateOrUpdateByID. type ApplicationDefinitionsClientCreateOrUpdateByIDResponse struct { + // Information about managed application definition. ApplicationDefinition } // ApplicationDefinitionsClientCreateOrUpdateResponse contains the response from method ApplicationDefinitionsClient.BeginCreateOrUpdate. type ApplicationDefinitionsClientCreateOrUpdateResponse struct { + // Information about managed application definition. ApplicationDefinition } @@ -36,26 +39,31 @@ type ApplicationDefinitionsClientDeleteResponse struct { // ApplicationDefinitionsClientGetByIDResponse contains the response from method ApplicationDefinitionsClient.GetByID. type ApplicationDefinitionsClientGetByIDResponse struct { + // Information about managed application definition. ApplicationDefinition } // ApplicationDefinitionsClientGetResponse contains the response from method ApplicationDefinitionsClient.Get. type ApplicationDefinitionsClientGetResponse struct { + // Information about managed application definition. ApplicationDefinition } // ApplicationDefinitionsClientListByResourceGroupResponse contains the response from method ApplicationDefinitionsClient.NewListByResourceGroupPager. type ApplicationDefinitionsClientListByResourceGroupResponse struct { + // List of managed application definitions. ApplicationDefinitionListResult } // ApplicationsClientCreateOrUpdateByIDResponse contains the response from method ApplicationsClient.BeginCreateOrUpdateByID. type ApplicationsClientCreateOrUpdateByIDResponse struct { + // Information about managed application. Application } // ApplicationsClientCreateOrUpdateResponse contains the response from method ApplicationsClient.BeginCreateOrUpdate. type ApplicationsClientCreateOrUpdateResponse struct { + // Information about managed application. Application } @@ -71,30 +79,36 @@ type ApplicationsClientDeleteResponse struct { // ApplicationsClientGetByIDResponse contains the response from method ApplicationsClient.GetByID. type ApplicationsClientGetByIDResponse struct { + // Information about managed application. Application } // ApplicationsClientGetResponse contains the response from method ApplicationsClient.Get. type ApplicationsClientGetResponse struct { + // Information about managed application. Application } // ApplicationsClientListByResourceGroupResponse contains the response from method ApplicationsClient.NewListByResourceGroupPager. type ApplicationsClientListByResourceGroupResponse struct { + // List of managed applications. ApplicationListResult } // ApplicationsClientListBySubscriptionResponse contains the response from method ApplicationsClient.NewListBySubscriptionPager. type ApplicationsClientListBySubscriptionResponse struct { + // List of managed applications. ApplicationListResult } // ApplicationsClientUpdateByIDResponse contains the response from method ApplicationsClient.UpdateByID. type ApplicationsClientUpdateByIDResponse struct { + // Information about managed application. Application } // ApplicationsClientUpdateResponse contains the response from method ApplicationsClient.Update. type ApplicationsClientUpdateResponse struct { + // Information about managed application. Application }