From 4c73c1c9b1e2f3299a22a299875865bc4494d1d0 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 29 Aug 2023 21:55:46 +0000 Subject: [PATCH] CodeGen from PR 25583 in Azure/azure-rest-api-specs Merge c3d50e902abe789604a79cd5fd38c058c62b086e into 766e0f90f4ac7ec129daef80afccea87ca55aac1 --- .../armhealthcareapis/CHANGELOG.md | 19 + .../armhealthcareapis/autorest.md | 7 +- .../armhealthcareapis/client_factory.go | 55 +- .../armhealthcareapis/constants.go | 13 +- .../armhealthcareapis/dicomservices_client.go | 91 +-- .../dicomservices_client_example_test.go | 221 ------- .../fhirdestinations_client.go | 9 +- .../fhirdestinations_client_example_test.go | 136 ----- .../armhealthcareapis/fhirservices_client.go | 91 +-- .../fhirservices_client_example_test.go | 269 --------- .../healthcareapis/armhealthcareapis/go.mod | 22 +- .../healthcareapis/armhealthcareapis/go.sum | 38 +- .../iotconnectorfhirdestination_client.go | 63 +- ...ctorfhirdestination_client_example_test.go | 207 ------- .../armhealthcareapis/iotconnectors_client.go | 91 +-- .../iotconnectors_client_example_test.go | 445 -------------- .../armhealthcareapis/models.go | 369 +++--------- .../armhealthcareapis/models_serde.go | 218 +++++-- .../operationresults_client.go | 20 +- .../operationresults_client_example_test.go | 47 -- .../armhealthcareapis/operations_client.go | 7 +- .../operations_client_example_test.go | 162 ----- .../armhealthcareapis/options.go | 286 +++++++++ .../privateendpointconnections_client.go | 67 ++- ...endpointconnections_client_example_test.go | 165 ------ .../privatelinkresources_client.go | 35 +- ...rivatelinkresources_client_example_test.go | 85 --- .../armhealthcareapis/response_types.go | 41 +- .../armhealthcareapis/services_client.go | 115 ++-- .../services_client_example_test.go | 558 ------------------ .../armhealthcareapis/time_rfc3339.go | 3 +- ...kspaceprivateendpointconnections_client.go | 67 ++- ...endpointconnections_client_example_test.go | 165 ------ .../workspaceprivatelinkresources_client.go | 24 +- ...rivatelinkresources_client_example_test.go | 94 --- .../armhealthcareapis/workspaces_client.go | 95 +-- .../workspaces_client_example_test.go | 219 ------- 37 files changed, 1119 insertions(+), 3500 deletions(-) delete mode 100644 sdk/resourcemanager/healthcareapis/armhealthcareapis/dicomservices_client_example_test.go delete mode 100644 sdk/resourcemanager/healthcareapis/armhealthcareapis/fhirdestinations_client_example_test.go delete mode 100644 sdk/resourcemanager/healthcareapis/armhealthcareapis/fhirservices_client_example_test.go delete mode 100644 sdk/resourcemanager/healthcareapis/armhealthcareapis/iotconnectorfhirdestination_client_example_test.go delete mode 100644 sdk/resourcemanager/healthcareapis/armhealthcareapis/iotconnectors_client_example_test.go delete mode 100644 sdk/resourcemanager/healthcareapis/armhealthcareapis/operationresults_client_example_test.go delete mode 100644 sdk/resourcemanager/healthcareapis/armhealthcareapis/operations_client_example_test.go create mode 100644 sdk/resourcemanager/healthcareapis/armhealthcareapis/options.go delete mode 100644 sdk/resourcemanager/healthcareapis/armhealthcareapis/privateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/healthcareapis/armhealthcareapis/privatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/healthcareapis/armhealthcareapis/services_client_example_test.go delete mode 100644 sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaceprivateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaceprivatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaces_client_example_test.go diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/CHANGELOG.md b/sdk/resourcemanager/healthcareapis/armhealthcareapis/CHANGELOG.md index 1af8881a5cb1..f9869eb3e3dc 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/CHANGELOG.md +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/CHANGELOG.md @@ -1,5 +1,24 @@ # Release History +## 2.0.0 (2023-08-29) +### Breaking Changes + +- Struct `FhirServiceAccessPolicyEntry` has been removed +- Field `AccessPolicies` of struct `FhirServiceProperties` has been removed + +### Features Added + +- New struct `CorsConfiguration` +- New struct `FhirServiceImportConfiguration` +- New struct `ImplementationGuidesConfiguration` +- New struct `ServiceImportConfigurationInfo` +- New field `CorsConfiguration`, `EventState` in struct `DicomServiceProperties` +- New field `ImplementationGuidesConfiguration`, `ImportConfiguration` in struct `FhirServiceProperties` +- New field `EnableRegionalMdmAccount`, `IsInternal`, `MetricFilterPattern`, `ResourceIDDimensionNameOverride`, `SourceMdmAccount` in struct `MetricSpecification` +- New field `CrossTenantCmkApplicationID` in struct `ServiceCosmosDbConfigurationInfo` +- New field `ImportConfiguration` in struct `ServicesProperties` + + ## 1.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/autorest.md b/sdk/resourcemanager/healthcareapis/armhealthcareapis/autorest.md index 64d96f027d77..7dc540e7525b 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/autorest.md +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/healthcareapis/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/healthcareapis/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.1 -tag: package-2021-11 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/client_factory.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/client_factory.go index 9c36a2569f75..56ee28dac143 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/client_factory.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/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 armhealthcareapis @@ -24,7 +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 - The subscription identifier. +// - 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) { @@ -38,48 +37,53 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewServicesClient() *ServicesClient { - subClient, _ := NewServicesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDicomServicesClient() *DicomServicesClient { + subClient, _ := NewDicomServicesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { - subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewFhirDestinationsClient() *FhirDestinationsClient { + subClient, _ := NewFhirDestinationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { - subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewFhirServicesClient() *FhirServicesClient { + subClient, _ := NewFhirServicesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewWorkspacesClient() *WorkspacesClient { - subClient, _ := NewWorkspacesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewIotConnectorFhirDestinationClient() *IotConnectorFhirDestinationClient { + subClient, _ := NewIotConnectorFhirDestinationClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDicomServicesClient() *DicomServicesClient { - subClient, _ := NewDicomServicesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewIotConnectorsClient() *IotConnectorsClient { + subClient, _ := NewIotConnectorsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewIotConnectorsClient() *IotConnectorsClient { - subClient, _ := NewIotConnectorsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOperationResultsClient() *OperationResultsClient { + subClient, _ := NewOperationResultsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewFhirDestinationsClient() *FhirDestinationsClient { - subClient, _ := NewFhirDestinationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewIotConnectorFhirDestinationClient() *IotConnectorFhirDestinationClient { - subClient, _ := NewIotConnectorFhirDestinationClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { + subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewFhirServicesClient() *FhirServicesClient { - subClient, _ := NewFhirServicesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { + subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewServicesClient() *ServicesClient { + subClient, _ := NewServicesClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -93,12 +97,7 @@ func (c *ClientFactory) NewWorkspacePrivateLinkResourcesClient() *WorkspacePriva return subClient } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewOperationResultsClient() *OperationResultsClient { - subClient, _ := NewOperationResultsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewWorkspacesClient() *WorkspacesClient { + subClient, _ := NewWorkspacesClient(c.subscriptionID, c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/constants.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/constants.go index cd869ae52bb9..acfff598ce2c 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/constants.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/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 armhealthcareapis const ( moduleName = "armhealthcareapis" - moduleVersion = "v1.1.1" + moduleVersion = "v2.0.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -103,16 +102,16 @@ type Kind string const ( KindFhir Kind = "fhir" - KindFhirStu3 Kind = "fhir-Stu3" KindFhirR4 Kind = "fhir-R4" + KindFhirStu3 Kind = "fhir-Stu3" ) // PossibleKindValues returns the possible values for the Kind const type. func PossibleKindValues() []Kind { return []Kind{ KindFhir, - KindFhirStu3, KindFhirR4, + KindFhirStu3, } } @@ -288,14 +287,14 @@ func PossibleServiceManagedIdentityTypeValues() []ServiceManagedIdentityType { type ServiceNameUnavailabilityReason string const ( - ServiceNameUnavailabilityReasonInvalid ServiceNameUnavailabilityReason = "Invalid" ServiceNameUnavailabilityReasonAlreadyExists ServiceNameUnavailabilityReason = "AlreadyExists" + ServiceNameUnavailabilityReasonInvalid ServiceNameUnavailabilityReason = "Invalid" ) // PossibleServiceNameUnavailabilityReasonValues returns the possible values for the ServiceNameUnavailabilityReason const type. func PossibleServiceNameUnavailabilityReasonValues() []ServiceNameUnavailabilityReason { return []ServiceNameUnavailabilityReason{ - ServiceNameUnavailabilityReasonInvalid, ServiceNameUnavailabilityReasonAlreadyExists, + ServiceNameUnavailabilityReasonInvalid, } } diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/dicomservices_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/dicomservices_client.go index 144bd8161d8d..4d7ebb302d1e 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/dicomservices_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/dicomservices_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 armhealthcareapis @@ -29,7 +28,7 @@ type DicomServicesClient struct { } // NewDicomServicesClient creates a new instance of DicomServicesClient with the specified values. -// - subscriptionID - The subscription identifier. +// - 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 NewDicomServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DicomServicesClient, error) { @@ -47,7 +46,7 @@ func NewDicomServicesClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Creates or updates a DICOM Service resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - dicomServiceName - The name of DICOM Service resource. @@ -60,7 +59,8 @@ func (client *DicomServicesClient) BeginCreateOrUpdate(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller[DicomServicesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DicomServicesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DicomServicesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -69,20 +69,22 @@ func (client *DicomServicesClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates or updates a DICOM Service resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *DicomServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, dicomServiceName string, dicomservice DicomService, options *DicomServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, dicomServiceName, dicomservice, 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. @@ -109,16 +111,19 @@ func (client *DicomServicesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, dicomservice) + if err := runtime.MarshalAsJSON(req, dicomservice); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a DICOM Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - dicomServiceName - The name of DICOM Service resource. // - workspaceName - The name of workspace resource. @@ -130,7 +135,8 @@ func (client *DicomServicesClient) BeginDelete(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller[DicomServicesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DicomServicesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DicomServicesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -139,20 +145,22 @@ func (client *DicomServicesClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes a DICOM Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *DicomServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, dicomServiceName string, workspaceName string, options *DicomServicesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, dicomServiceName, workspaceName, 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 +187,7 @@ func (client *DicomServicesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,24 +196,27 @@ func (client *DicomServicesClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets the properties of the specified DICOM Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - dicomServiceName - The name of DICOM Service resource. // - options - DicomServicesClientGetOptions contains the optional parameters for the DicomServicesClient.Get method. func (client *DicomServicesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, dicomServiceName string, options *DicomServicesClientGetOptions) (DicomServicesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, dicomServiceName, options) if err != nil { return DicomServicesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DicomServicesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DicomServicesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DicomServicesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -232,7 +243,7 @@ func (client *DicomServicesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +260,7 @@ func (client *DicomServicesClient) getHandleResponse(resp *http.Response) (Dicom // NewListByWorkspacePager - Lists all DICOM Services for the given workspace // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - options - DicomServicesClientListByWorkspaceOptions contains the optional parameters for the DicomServicesClient.NewListByWorkspacePager @@ -302,7 +313,7 @@ func (client *DicomServicesClient) listByWorkspaceCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -320,7 +331,7 @@ func (client *DicomServicesClient) listByWorkspaceHandleResponse(resp *http.Resp // BeginUpdate - Patch DICOM Service details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - dicomServiceName - The name of DICOM Service resource. // - workspaceName - The name of workspace resource. @@ -333,7 +344,8 @@ func (client *DicomServicesClient) BeginUpdate(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller[DicomServicesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DicomServicesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DicomServicesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -342,20 +354,22 @@ func (client *DicomServicesClient) BeginUpdate(ctx context.Context, resourceGrou // Update - Patch DICOM Service details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *DicomServicesClient) update(ctx context.Context, resourceGroupName string, dicomServiceName string, workspaceName string, dicomservicePatchResource DicomServicePatchResource, options *DicomServicesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, dicomServiceName, workspaceName, dicomservicePatchResource, 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. @@ -382,8 +396,11 @@ func (client *DicomServicesClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, dicomservicePatchResource) + if err := runtime.MarshalAsJSON(req, dicomservicePatchResource); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/dicomservices_client_example_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/dicomservices_client_example_test.go deleted file mode 100644 index cfabddb91c9a..000000000000 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/dicomservices_client_example_test.go +++ /dev/null @@ -1,221 +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 armhealthcareapis_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/healthcareapis/armhealthcareapis" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_List.json -func ExampleDicomServicesClient_NewListByWorkspacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDicomServicesClient().NewListByWorkspacePager("testRG", "workspace1", 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.DicomServiceCollection = armhealthcareapis.DicomServiceCollection{ - // Value: []*armhealthcareapis.DicomService{ - // { - // Name: to.Ptr("blue"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/dicomservices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/dicomservices/blue"), - // Properties: &armhealthcareapis.DicomServiceProperties{ - // AuthenticationConfiguration: &armhealthcareapis.DicomServiceAuthenticationConfiguration{ - // Audiences: []*string{ - // to.Ptr("https://azurehealthcareapis.com/"), - // to.Ptr("https://azurehealthcareapis.com")}, - // Authority: to.Ptr("https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc"), - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // ServiceURL: to.Ptr("https://workspace1-blue.dicom.azurehealthcareapis.com"), - // }, - // }, - // { - // Name: to.Ptr("red"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/dicomservices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/dicomservices/red"), - // Properties: &armhealthcareapis.DicomServiceProperties{ - // AuthenticationConfiguration: &armhealthcareapis.DicomServiceAuthenticationConfiguration{ - // Audiences: []*string{ - // to.Ptr("https://azurehealthcareapis.com/"), - // to.Ptr("https://azurehealthcareapis.com")}, - // Authority: to.Ptr("https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc"), - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // ServiceURL: to.Ptr("https://workspace1-red.dicom.azurehealthcareapis.com"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_Get.json -func ExampleDicomServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDicomServicesClient().Get(ctx, "testRG", "workspace1", "blue", 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.DicomService = armhealthcareapis.DicomService{ - // Name: to.Ptr("blue"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/dicomservices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/dicomservices/blue"), - // Properties: &armhealthcareapis.DicomServiceProperties{ - // AuthenticationConfiguration: &armhealthcareapis.DicomServiceAuthenticationConfiguration{ - // Audiences: []*string{ - // to.Ptr("https://azurehealthcareapis.com/"), - // to.Ptr("https://azurehealthcareapis.com")}, - // Authority: to.Ptr("https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc"), - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // ServiceURL: to.Ptr("https://workspace1-blue.dicom.azurehealthcareapis.com"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_Create.json -func ExampleDicomServicesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDicomServicesClient().BeginCreateOrUpdate(ctx, "testRG", "workspace1", "blue", armhealthcareapis.DicomService{ - Location: to.Ptr("westus"), - Properties: &armhealthcareapis.DicomServiceProperties{}, - }, 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.DicomService = armhealthcareapis.DicomService{ - // Name: to.Ptr("blue"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/dicomservices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/dicomservices/blue"), - // Location: to.Ptr("westus"), - // Properties: &armhealthcareapis.DicomServiceProperties{ - // AuthenticationConfiguration: &armhealthcareapis.DicomServiceAuthenticationConfiguration{ - // Audiences: []*string{ - // to.Ptr("https://azurehealthcareapis.com/"), - // to.Ptr("https://azurehealthcareapis.com")}, - // Authority: to.Ptr("https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc"), - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_Patch.json -func ExampleDicomServicesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDicomServicesClient().BeginUpdate(ctx, "testRG", "blue", "workspace1", armhealthcareapis.DicomServicePatchResource{ - Tags: map[string]*string{ - "tagKey": to.Ptr("tagValue"), - }, - }, 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.DicomService = armhealthcareapis.DicomService{ - // Name: to.Ptr("blue"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/dicomservices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/dicomservices/blue"), - // Tags: map[string]*string{ - // "tagKey": to.Ptr("tagValue"), - // }, - // Properties: &armhealthcareapis.DicomServiceProperties{ - // AuthenticationConfiguration: &armhealthcareapis.DicomServiceAuthenticationConfiguration{ - // Audiences: []*string{ - // to.Ptr("https://azurehealthcareapis.com/"), - // to.Ptr("https://azurehealthcareapis.com")}, - // Authority: to.Ptr("https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc"), - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // ServiceURL: to.Ptr("https://workspace1-blue.dicom.azurehealthcareapis.com"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_Delete.json -func ExampleDicomServicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDicomServicesClient().BeginDelete(ctx, "testRG", "blue", "workspace1", 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) - } -} diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/fhirdestinations_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/fhirdestinations_client.go index 5238b092170b..38d14f9ef358 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/fhirdestinations_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/fhirdestinations_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 armhealthcareapis @@ -29,7 +28,7 @@ type FhirDestinationsClient struct { } // NewFhirDestinationsClient creates a new instance of FhirDestinationsClient with the specified values. -// - subscriptionID - The subscription identifier. +// - 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 NewFhirDestinationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FhirDestinationsClient, error) { @@ -46,7 +45,7 @@ func NewFhirDestinationsClient(subscriptionID string, credential azcore.TokenCre // NewListByIotConnectorPager - Lists all FHIR destinations for the given IoT Connector // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - iotConnectorName - The name of IoT Connector resource. @@ -104,7 +103,7 @@ func (client *FhirDestinationsClient) listByIotConnectorCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/fhirdestinations_client_example_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/fhirdestinations_client_example_test.go deleted file mode 100644 index b0df83822327..000000000000 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/fhirdestinations_client_example_test.go +++ /dev/null @@ -1,136 +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 armhealthcareapis_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_fhirdestination_List.json -func ExampleFhirDestinationsClient_NewListByIotConnectorPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFhirDestinationsClient().NewListByIotConnectorPager("testRG", "workspace1", "blue", 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.IotFhirDestinationCollection = armhealthcareapis.IotFhirDestinationCollection{ - // Value: []*armhealthcareapis.IotFhirDestination{ - // { - // Name: to.Ptr("dest1"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/iotconnectors/fhirdestinations"), - // Etag: to.Ptr("00000000-0000-0000-f5ac-912ca49e01d6"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/iotconnectors/blue/fhirdestinations/dest1"), - // Location: to.Ptr("westus"), - // Properties: &armhealthcareapis.IotFhirDestinationProperties{ - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // FhirMapping: &armhealthcareapis.IotMappingProperties{ - // Content: map[string]any{ - // "template":[]any{ - // map[string]any{ - // "template":map[string]any{ - // "codes":[]any{ - // map[string]any{ - // "code": "8867-4", - // "display": "Heart rate", - // "system": "http://loinc.org", - // }, - // }, - // "periodInterval": float64(60), - // "typeName": "heartrate", - // "value":map[string]any{ - // "defaultPeriod": float64(5000), - // "unit": "count/min", - // "valueName": "hr", - // "valueType": "SampledData", - // }, - // }, - // "templateType": "CodeValueFhir", - // }, - // }, - // "templateType": "CollectionFhirTemplate", - // }, - // }, - // FhirServiceResourceID: to.Ptr("subscriptions/11111111-2222-3333-4444-555566667777/resourceGroups/myrg/providers/Microsoft.HealthcareApis/workspaces/myworkspace/fhirservices/myfhirservice"), - // ResourceIdentityResolutionType: to.Ptr(armhealthcareapis.IotIdentityResolutionTypeCreate), - // }, - // SystemData: &armhealthcareapis.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-28T19:26:24.072Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-28T19:26:24.072Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // }, - // }, - // { - // Name: to.Ptr("dest2"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/iotconnectors/fhirdestinations"), - // Etag: to.Ptr("00000000-0000-0000-f6ac-912ca49e01d6"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/iotconnectors/blue/fhirdestinations/dest2"), - // Location: to.Ptr("westus"), - // Properties: &armhealthcareapis.IotFhirDestinationProperties{ - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // FhirMapping: &armhealthcareapis.IotMappingProperties{ - // Content: map[string]any{ - // "template":[]any{ - // map[string]any{ - // "template":map[string]any{ - // "codes":[]any{ - // map[string]any{ - // "code": "8867-4", - // "display": "Heart rate", - // "system": "http://loinc.org", - // }, - // }, - // "periodInterval": float64(60), - // "typeName": "heartrate", - // "value":map[string]any{ - // "defaultPeriod": float64(5000), - // "unit": "count/min", - // "valueName": "hr", - // "valueType": "SampledData", - // }, - // }, - // "templateType": "CodeValueFhir", - // }, - // }, - // "templateType": "CollectionFhirTemplate", - // }, - // }, - // FhirServiceResourceID: to.Ptr("subscriptions/11111111-2222-3333-4444-555566667777/resourceGroups/myrg/providers/Microsoft.HealthcareApis/workspaces/myworkspace/fhirservices/myfhirservice"), - // ResourceIdentityResolutionType: to.Ptr(armhealthcareapis.IotIdentityResolutionTypeLookup), - // }, - // SystemData: &armhealthcareapis.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-27T19:26:24.072Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-27T19:26:24.072Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/fhirservices_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/fhirservices_client.go index d4677030cc3a..44a06c30d8d3 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/fhirservices_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/fhirservices_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 armhealthcareapis @@ -29,7 +28,7 @@ type FhirServicesClient struct { } // NewFhirServicesClient creates a new instance of FhirServicesClient with the specified values. -// - subscriptionID - The subscription identifier. +// - 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 NewFhirServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FhirServicesClient, error) { @@ -47,7 +46,7 @@ func NewFhirServicesClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Creates or updates a FHIR Service resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - fhirServiceName - The name of FHIR Service resource. @@ -60,7 +59,8 @@ func (client *FhirServicesClient) BeginCreateOrUpdate(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller[FhirServicesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[FhirServicesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[FhirServicesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -69,20 +69,22 @@ func (client *FhirServicesClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Creates or updates a FHIR Service resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *FhirServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, fhirServiceName string, fhirservice FhirService, options *FhirServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, fhirServiceName, fhirservice, 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. @@ -109,16 +111,19 @@ func (client *FhirServicesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, fhirservice) + if err := runtime.MarshalAsJSON(req, fhirservice); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a FHIR Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - fhirServiceName - The name of FHIR Service resource. // - workspaceName - The name of workspace resource. @@ -130,7 +135,8 @@ func (client *FhirServicesClient) BeginDelete(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller[FhirServicesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[FhirServicesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[FhirServicesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -139,20 +145,22 @@ func (client *FhirServicesClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes a FHIR Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *FhirServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, fhirServiceName string, workspaceName string, options *FhirServicesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, fhirServiceName, workspaceName, 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 +187,7 @@ func (client *FhirServicesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,24 +196,27 @@ func (client *FhirServicesClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets the properties of the specified FHIR Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - fhirServiceName - The name of FHIR Service resource. // - options - FhirServicesClientGetOptions contains the optional parameters for the FhirServicesClient.Get method. func (client *FhirServicesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, fhirServiceName string, options *FhirServicesClientGetOptions) (FhirServicesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, fhirServiceName, options) if err != nil { return FhirServicesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return FhirServicesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FhirServicesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FhirServicesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -232,7 +243,7 @@ func (client *FhirServicesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +260,7 @@ func (client *FhirServicesClient) getHandleResponse(resp *http.Response) (FhirSe // NewListByWorkspacePager - Lists all FHIR Services for the given workspace // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - options - FhirServicesClientListByWorkspaceOptions contains the optional parameters for the FhirServicesClient.NewListByWorkspacePager @@ -302,7 +313,7 @@ func (client *FhirServicesClient) listByWorkspaceCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -320,7 +331,7 @@ func (client *FhirServicesClient) listByWorkspaceHandleResponse(resp *http.Respo // BeginUpdate - Patch FHIR Service details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - fhirServiceName - The name of FHIR Service resource. // - workspaceName - The name of workspace resource. @@ -333,7 +344,8 @@ func (client *FhirServicesClient) BeginUpdate(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller[FhirServicesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[FhirServicesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[FhirServicesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -342,20 +354,22 @@ func (client *FhirServicesClient) BeginUpdate(ctx context.Context, resourceGroup // Update - Patch FHIR Service details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *FhirServicesClient) update(ctx context.Context, resourceGroupName string, fhirServiceName string, workspaceName string, fhirservicePatchResource FhirServicePatchResource, options *FhirServicesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, fhirServiceName, workspaceName, fhirservicePatchResource, 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. @@ -382,8 +396,11 @@ func (client *FhirServicesClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, fhirservicePatchResource) + if err := runtime.MarshalAsJSON(req, fhirservicePatchResource); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/fhirservices_client_example_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/fhirservices_client_example_test.go deleted file mode 100644 index c3fdbdc9115c..000000000000 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/fhirservices_client_example_test.go +++ /dev/null @@ -1,269 +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 armhealthcareapis_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/healthcareapis/armhealthcareapis" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_List.json -func ExampleFhirServicesClient_NewListByWorkspacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFhirServicesClient().NewListByWorkspacePager("testRG", "workspace1", 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.FhirServiceCollection = armhealthcareapis.FhirServiceCollection{ - // Value: []*armhealthcareapis.FhirService{ - // { - // Name: to.Ptr("fhirservice1"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/fhirservices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/fhirservices/fhirservice1"), - // Properties: &armhealthcareapis.FhirServiceProperties{ - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("fhirservice2"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/fhirservices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/fhirservices/fhirservice2"), - // Properties: &armhealthcareapis.FhirServiceProperties{ - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_Get.json -func ExampleFhirServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFhirServicesClient().Get(ctx, "testRG", "workspace1", "fhirservices1", 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.FhirService = armhealthcareapis.FhirService{ - // Name: to.Ptr("fhirservices1"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/fhirservices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/fhirservices/fhirservices1"), - // Properties: &armhealthcareapis.FhirServiceProperties{ - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_Create.json -func ExampleFhirServicesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFhirServicesClient().BeginCreateOrUpdate(ctx, "testRG", "workspace1", "fhirservice1", armhealthcareapis.FhirService{ - Identity: &armhealthcareapis.ServiceManagedIdentityIdentity{ - Type: to.Ptr(armhealthcareapis.ServiceManagedIdentityTypeSystemAssigned), - }, - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "additionalProp1": to.Ptr("string"), - "additionalProp2": to.Ptr("string"), - "additionalProp3": to.Ptr("string"), - }, - Kind: to.Ptr(armhealthcareapis.FhirServiceKindFhirR4), - Properties: &armhealthcareapis.FhirServiceProperties{ - AccessPolicies: []*armhealthcareapis.FhirServiceAccessPolicyEntry{ - { - ObjectID: to.Ptr("c487e7d1-3210-41a3-8ccc-e9372b78da47"), - }, - { - ObjectID: to.Ptr("5b307da8-43d4-492b-8b66-b0294ade872f"), - }}, - AcrConfiguration: &armhealthcareapis.FhirServiceAcrConfiguration{ - LoginServers: []*string{ - to.Ptr("test1.azurecr.io")}, - }, - AuthenticationConfiguration: &armhealthcareapis.FhirServiceAuthenticationConfiguration{ - Audience: to.Ptr("https://azurehealthcareapis.com"), - Authority: to.Ptr("https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc"), - SmartProxyEnabled: to.Ptr(true), - }, - CorsConfiguration: &armhealthcareapis.FhirServiceCorsConfiguration{ - AllowCredentials: to.Ptr(false), - Headers: []*string{ - to.Ptr("*")}, - MaxAge: to.Ptr[int32](1440), - Methods: []*string{ - to.Ptr("DELETE"), - to.Ptr("GET"), - to.Ptr("OPTIONS"), - to.Ptr("PATCH"), - to.Ptr("POST"), - to.Ptr("PUT")}, - Origins: []*string{ - to.Ptr("*")}, - }, - ExportConfiguration: &armhealthcareapis.FhirServiceExportConfiguration{ - StorageAccountName: to.Ptr("existingStorageAccount"), - }, - }, - }, 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.FhirService = armhealthcareapis.FhirService{ - // Name: to.Ptr("fhirservice1"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/fhirservices"), - // Etag: to.Ptr("etagvalue"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/fhirservices/fhirservice1"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // Kind: to.Ptr(armhealthcareapis.FhirServiceKindFhirR4), - // Properties: &armhealthcareapis.FhirServiceProperties{ - // AccessPolicies: []*armhealthcareapis.FhirServiceAccessPolicyEntry{ - // { - // ObjectID: to.Ptr("c487e7d1-3210-41a3-8ccc-e9372b78da47"), - // }, - // { - // ObjectID: to.Ptr("5b307da8-43d4-492b-8b66-b0294ade872f"), - // }}, - // AuthenticationConfiguration: &armhealthcareapis.FhirServiceAuthenticationConfiguration{ - // Audience: to.Ptr("https://azurehealthcareapis.com"), - // Authority: to.Ptr("https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc"), - // SmartProxyEnabled: to.Ptr(true), - // }, - // CorsConfiguration: &armhealthcareapis.FhirServiceCorsConfiguration{ - // AllowCredentials: to.Ptr(false), - // Headers: []*string{ - // to.Ptr("*")}, - // MaxAge: to.Ptr[int32](1440), - // Methods: []*string{ - // to.Ptr("DELETE"), - // to.Ptr("GET"), - // to.Ptr("OPTIONS"), - // to.Ptr("PATCH"), - // to.Ptr("POST"), - // to.Ptr("PUT")}, - // Origins: []*string{ - // to.Ptr("*")}, - // }, - // EventState: to.Ptr(armhealthcareapis.ServiceEventStateDisabled), - // ExportConfiguration: &armhealthcareapis.FhirServiceExportConfiguration{ - // StorageAccountName: to.Ptr("existingStorageAccount"), - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_Patch.json -func ExampleFhirServicesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFhirServicesClient().BeginUpdate(ctx, "testRG", "fhirservice1", "workspace1", armhealthcareapis.FhirServicePatchResource{ - Tags: map[string]*string{ - "tagKey": to.Ptr("tagValue"), - }, - }, 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.FhirService = armhealthcareapis.FhirService{ - // Name: to.Ptr("fhirservice1"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/fhirservices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/fhirservices/fhirservice1"), - // Tags: map[string]*string{ - // "tagKey": to.Ptr("tagValue"), - // }, - // Properties: &armhealthcareapis.FhirServiceProperties{ - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_Delete.json -func ExampleFhirServicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFhirServicesClient().BeginDelete(ctx, "testRG", "fhirservice1", "workspace1", 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) - } -} diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/go.mod b/sdk/resourcemanager/healthcareapis/armhealthcareapis/go.mod index 854001ef8175..03261ef2c405 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/go.mod +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis/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/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/healthcareapis/armhealthcareapis/go.sum b/sdk/resourcemanager/healthcareapis/armhealthcareapis/go.sum index 8ba445a8c4da..5c6bee428364 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/go.sum +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/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/healthcareapis/armhealthcareapis/iotconnectorfhirdestination_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/iotconnectorfhirdestination_client.go index f094b9a1573f..cde9461a8786 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/iotconnectorfhirdestination_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/iotconnectorfhirdestination_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 armhealthcareapis @@ -29,7 +28,7 @@ type IotConnectorFhirDestinationClient struct { } // NewIotConnectorFhirDestinationClient creates a new instance of IotConnectorFhirDestinationClient with the specified values. -// - subscriptionID - The subscription identifier. +// - 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 NewIotConnectorFhirDestinationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IotConnectorFhirDestinationClient, error) { @@ -47,7 +46,7 @@ func NewIotConnectorFhirDestinationClient(subscriptionID string, credential azco // BeginCreateOrUpdate - Creates or updates an IoT Connector FHIR destination resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - iotConnectorName - The name of IoT Connector resource. @@ -61,7 +60,8 @@ func (client *IotConnectorFhirDestinationClient) BeginCreateOrUpdate(ctx context if err != nil { return nil, err } - return runtime.NewPoller[IotConnectorFhirDestinationClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[IotConnectorFhirDestinationClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[IotConnectorFhirDestinationClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +70,22 @@ func (client *IotConnectorFhirDestinationClient) BeginCreateOrUpdate(ctx context // CreateOrUpdate - Creates or updates an IoT Connector FHIR destination resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *IotConnectorFhirDestinationClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string, fhirDestinationName string, iotFhirDestination IotFhirDestination, options *IotConnectorFhirDestinationClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, iotFhirDestination, 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. @@ -114,16 +116,19 @@ func (client *IotConnectorFhirDestinationClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, iotFhirDestination) + if err := runtime.MarshalAsJSON(req, iotFhirDestination); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes an IoT Connector FHIR destination. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - iotConnectorName - The name of IoT Connector resource. @@ -136,7 +141,8 @@ func (client *IotConnectorFhirDestinationClient) BeginDelete(ctx context.Context if err != nil { return nil, err } - return runtime.NewPoller[IotConnectorFhirDestinationClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[IotConnectorFhirDestinationClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[IotConnectorFhirDestinationClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -145,20 +151,22 @@ func (client *IotConnectorFhirDestinationClient) BeginDelete(ctx context.Context // Delete - Deletes an IoT Connector FHIR destination. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *IotConnectorFhirDestinationClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string, fhirDestinationName string, options *IotConnectorFhirDestinationClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, 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. @@ -189,7 +197,7 @@ func (client *IotConnectorFhirDestinationClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,7 +206,7 @@ func (client *IotConnectorFhirDestinationClient) deleteCreateRequest(ctx context // Get - Gets the properties of the specified Iot Connector FHIR destination. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - iotConnectorName - The name of IoT Connector resource. @@ -206,18 +214,21 @@ func (client *IotConnectorFhirDestinationClient) deleteCreateRequest(ctx context // - options - IotConnectorFhirDestinationClientGetOptions contains the optional parameters for the IotConnectorFhirDestinationClient.Get // method. func (client *IotConnectorFhirDestinationClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string, fhirDestinationName string, options *IotConnectorFhirDestinationClientGetOptions) (IotConnectorFhirDestinationClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, options) if err != nil { return IotConnectorFhirDestinationClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IotConnectorFhirDestinationClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IotConnectorFhirDestinationClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IotConnectorFhirDestinationClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -248,7 +259,7 @@ func (client *IotConnectorFhirDestinationClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/iotconnectorfhirdestination_client_example_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/iotconnectorfhirdestination_client_example_test.go deleted file mode 100644 index 4fc794313dee..000000000000 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/iotconnectorfhirdestination_client_example_test.go +++ /dev/null @@ -1,207 +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 armhealthcareapis_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/healthcareapis/armhealthcareapis" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_fhirdestination_Get.json -func ExampleIotConnectorFhirDestinationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotConnectorFhirDestinationClient().Get(ctx, "testRG", "workspace1", "blue", "dest1", 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.IotFhirDestination = armhealthcareapis.IotFhirDestination{ - // Name: to.Ptr("dest1"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/iotconnectors/fhirdestinations"), - // Etag: to.Ptr("00000000-0000-0000-f5ac-912ca49e01d6"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/iotconnectors/blue/fhirdestinations/dest1"), - // Location: to.Ptr("westus"), - // Properties: &armhealthcareapis.IotFhirDestinationProperties{ - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // FhirMapping: &armhealthcareapis.IotMappingProperties{ - // Content: map[string]any{ - // "template":[]any{ - // map[string]any{ - // "template":map[string]any{ - // "codes":[]any{ - // map[string]any{ - // "code": "8867-4", - // "display": "Heart rate", - // "system": "http://loinc.org", - // }, - // }, - // "periodInterval": float64(60), - // "typeName": "heartrate", - // "value":map[string]any{ - // "defaultPeriod": float64(5000), - // "unit": "count/min", - // "valueName": "hr", - // "valueType": "SampledData", - // }, - // }, - // "templateType": "CodeValueFhir", - // }, - // }, - // "templateType": "CollectionFhirTemplate", - // }, - // }, - // FhirServiceResourceID: to.Ptr("subscriptions/11111111-2222-3333-4444-555566667777/resourceGroups/myrg/providers/Microsoft.HealthcareApis/workspaces/myworkspace/fhirservices/myfhirservice"), - // ResourceIdentityResolutionType: to.Ptr(armhealthcareapis.IotIdentityResolutionTypeCreate), - // }, - // SystemData: &armhealthcareapis.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-28T19:26:24.072Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-28T19:26:24.072Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_fhirdestination_Create.json -func ExampleIotConnectorFhirDestinationClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIotConnectorFhirDestinationClient().BeginCreateOrUpdate(ctx, "testRG", "workspace1", "blue", "dest1", armhealthcareapis.IotFhirDestination{ - Location: to.Ptr("westus"), - Properties: &armhealthcareapis.IotFhirDestinationProperties{ - FhirMapping: &armhealthcareapis.IotMappingProperties{ - Content: map[string]any{ - "template": []any{ - map[string]any{ - "template": map[string]any{ - "codes": []any{ - map[string]any{ - "code": "8867-4", - "display": "Heart rate", - "system": "http://loinc.org", - }, - }, - "periodInterval": float64(60), - "typeName": "heartrate", - "value": map[string]any{ - "defaultPeriod": float64(5000), - "unit": "count/min", - "valueName": "hr", - "valueType": "SampledData", - }, - }, - "templateType": "CodeValueFhir", - }, - }, - "templateType": "CollectionFhirTemplate", - }, - }, - FhirServiceResourceID: to.Ptr("subscriptions/11111111-2222-3333-4444-555566667777/resourceGroups/myrg/providers/Microsoft.HealthcareApis/workspaces/myworkspace/fhirservices/myfhirservice"), - ResourceIdentityResolutionType: to.Ptr(armhealthcareapis.IotIdentityResolutionTypeCreate), - }, - }, 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.IotFhirDestination = armhealthcareapis.IotFhirDestination{ - // Name: to.Ptr("dest1"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/iotconnectors/fhirdestinations"), - // Etag: to.Ptr("00000000-0000-0000-f5ac-912ca49e01d6"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/iotconnectors/blue/fhirdestinations/dest1"), - // Location: to.Ptr("West US 2"), - // Properties: &armhealthcareapis.IotFhirDestinationProperties{ - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // FhirMapping: &armhealthcareapis.IotMappingProperties{ - // Content: map[string]any{ - // "template":[]any{ - // map[string]any{ - // "template":map[string]any{ - // "codes":[]any{ - // map[string]any{ - // "code": "8867-4", - // "display": "Heart rate", - // "system": "http://loinc.org", - // }, - // }, - // "periodInterval": float64(60), - // "typeName": "heartrate", - // "value":map[string]any{ - // "defaultPeriod": float64(5000), - // "unit": "count/min", - // "valueName": "hr", - // "valueType": "SampledData", - // }, - // }, - // "templateType": "CodeValueFhir", - // }, - // }, - // "templateType": "CollectionFhirTemplate", - // }, - // }, - // FhirServiceResourceID: to.Ptr("subscriptions/11111111-2222-3333-4444-555566667777/resourceGroups/myrg/providers/Microsoft.HealthcareApis/workspaces/myworkspace/fhirservices/myfhirservice"), - // ResourceIdentityResolutionType: to.Ptr(armhealthcareapis.IotIdentityResolutionTypeCreate), - // }, - // SystemData: &armhealthcareapis.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-28T19:26:24.072Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-28T19:26:24.072Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_fhirdestination_Delete.json -func ExampleIotConnectorFhirDestinationClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIotConnectorFhirDestinationClient().BeginDelete(ctx, "testRG", "workspace1", "blue", "dest1", 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) - } -} diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/iotconnectors_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/iotconnectors_client.go index 91c24ca97928..683555531758 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/iotconnectors_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/iotconnectors_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 armhealthcareapis @@ -29,7 +28,7 @@ type IotConnectorsClient struct { } // NewIotConnectorsClient creates a new instance of IotConnectorsClient with the specified values. -// - subscriptionID - The subscription identifier. +// - 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 NewIotConnectorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IotConnectorsClient, error) { @@ -47,7 +46,7 @@ func NewIotConnectorsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Creates or updates an IoT Connector resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - iotConnectorName - The name of IoT Connector resource. @@ -60,7 +59,8 @@ func (client *IotConnectorsClient) BeginCreateOrUpdate(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller[IotConnectorsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[IotConnectorsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[IotConnectorsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -69,20 +69,22 @@ func (client *IotConnectorsClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates or updates an IoT Connector resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *IotConnectorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string, iotConnector IotConnector, options *IotConnectorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, iotConnectorName, iotConnector, 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. @@ -109,16 +111,19 @@ func (client *IotConnectorsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, iotConnector) + if err := runtime.MarshalAsJSON(req, iotConnector); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes an IoT Connector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - iotConnectorName - The name of IoT Connector resource. // - workspaceName - The name of workspace resource. @@ -130,7 +135,8 @@ func (client *IotConnectorsClient) BeginDelete(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller[IotConnectorsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[IotConnectorsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[IotConnectorsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -139,20 +145,22 @@ func (client *IotConnectorsClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes an IoT Connector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *IotConnectorsClient) deleteOperation(ctx context.Context, resourceGroupName string, iotConnectorName string, workspaceName string, options *IotConnectorsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, iotConnectorName, workspaceName, 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 +187,7 @@ func (client *IotConnectorsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,24 +196,27 @@ func (client *IotConnectorsClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets the properties of the specified IoT Connector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - iotConnectorName - The name of IoT Connector resource. // - options - IotConnectorsClientGetOptions contains the optional parameters for the IotConnectorsClient.Get method. func (client *IotConnectorsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string, options *IotConnectorsClientGetOptions) (IotConnectorsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, iotConnectorName, options) if err != nil { return IotConnectorsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IotConnectorsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IotConnectorsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IotConnectorsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -232,7 +243,7 @@ func (client *IotConnectorsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +260,7 @@ func (client *IotConnectorsClient) getHandleResponse(resp *http.Response) (IotCo // NewListByWorkspacePager - Lists all IoT Connectors for the given workspace // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - options - IotConnectorsClientListByWorkspaceOptions contains the optional parameters for the IotConnectorsClient.NewListByWorkspacePager @@ -302,7 +313,7 @@ func (client *IotConnectorsClient) listByWorkspaceCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -320,7 +331,7 @@ func (client *IotConnectorsClient) listByWorkspaceHandleResponse(resp *http.Resp // BeginUpdate - Patch an IoT Connector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - iotConnectorName - The name of IoT Connector resource. // - workspaceName - The name of workspace resource. @@ -333,7 +344,8 @@ func (client *IotConnectorsClient) BeginUpdate(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller[IotConnectorsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[IotConnectorsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[IotConnectorsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -342,20 +354,22 @@ func (client *IotConnectorsClient) BeginUpdate(ctx context.Context, resourceGrou // Update - Patch an IoT Connector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *IotConnectorsClient) update(ctx context.Context, resourceGroupName string, iotConnectorName string, workspaceName string, iotConnectorPatchResource IotConnectorPatchResource, options *IotConnectorsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, iotConnectorName, workspaceName, iotConnectorPatchResource, 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. @@ -382,8 +396,11 @@ func (client *IotConnectorsClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, iotConnectorPatchResource) + if err := runtime.MarshalAsJSON(req, iotConnectorPatchResource); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/iotconnectors_client_example_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/iotconnectors_client_example_test.go deleted file mode 100644 index 9acdcecf1365..000000000000 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/iotconnectors_client_example_test.go +++ /dev/null @@ -1,445 +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 armhealthcareapis_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/healthcareapis/armhealthcareapis" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_List.json -func ExampleIotConnectorsClient_NewListByWorkspacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIotConnectorsClient().NewListByWorkspacePager("testRG", "workspace1", 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.IotConnectorCollection = armhealthcareapis.IotConnectorCollection{ - // Value: []*armhealthcareapis.IotConnector{ - // { - // Identity: &armhealthcareapis.ServiceManagedIdentityIdentity{ - // Type: to.Ptr(armhealthcareapis.ServiceManagedIdentityTypeSystemAssigned), - // }, - // Name: to.Ptr("blue"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/iotconnectors"), - // Etag: to.Ptr("00000000-0000-0000-f5ac-912ca49e01d6"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/iotconnectors/blue"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // Properties: &armhealthcareapis.IotConnectorProperties{ - // DeviceMapping: &armhealthcareapis.IotMappingProperties{ - // Content: map[string]any{ - // "template":[]any{ - // map[string]any{ - // "template":map[string]any{ - // "deviceIdExpression": "$.deviceid", - // "timestampExpression": "$.measurementdatetime", - // "typeMatchExpression": "$..[?(@heartrate)]", - // "typeName": "heartrate", - // "values":[]any{ - // map[string]any{ - // "required": "true", - // "valueExpression": "$.heartrate", - // "valueName": "hr", - // }, - // }, - // }, - // "templateType": "JsonPathContent", - // }, - // }, - // "templateType": "CollectionContent", - // }, - // }, - // IngestionEndpointConfiguration: &armhealthcareapis.IotEventHubIngestionEndpointConfiguration{ - // ConsumerGroup: to.Ptr("ConsumerGroupA"), - // EventHubName: to.Ptr("MyEventHubName"), - // FullyQualifiedEventHubNamespace: to.Ptr("myeventhub.servicesbus.windows.net"), - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // }, - // SystemData: &armhealthcareapis.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-28T19:26:24.072Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-28T19:26:24.072Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // }, - // }, - // { - // Identity: &armhealthcareapis.ServiceManagedIdentityIdentity{ - // Type: to.Ptr(armhealthcareapis.ServiceManagedIdentityTypeSystemAssigned), - // }, - // Name: to.Ptr("red"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/iotconnectors"), - // Etag: to.Ptr("00000000-0000-0000-f6ac-912ca49e01d6"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/iotconnectors/red"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // Properties: &armhealthcareapis.IotConnectorProperties{ - // DeviceMapping: &armhealthcareapis.IotMappingProperties{ - // Content: map[string]any{ - // "template":[]any{ - // map[string]any{ - // "template":map[string]any{ - // "deviceIdExpression": "$.deviceid", - // "timestampExpression": "$.measurementdatetime", - // "typeMatchExpression": "$..[?(@steps)]", - // "typeName": "steps", - // "values":[]any{ - // map[string]any{ - // "required": "true", - // "valueExpression": "$.steps", - // "valueName": "steps", - // }, - // }, - // }, - // "templateType": "JsonPathContent", - // }, - // }, - // "templateType": "CollectionContent", - // }, - // }, - // IngestionEndpointConfiguration: &armhealthcareapis.IotEventHubIngestionEndpointConfiguration{ - // ConsumerGroup: to.Ptr("ConsumerGroupA"), - // EventHubName: to.Ptr("MyEventHubName"), - // FullyQualifiedEventHubNamespace: to.Ptr("myeventhub.servicesbus.windows.net"), - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // }, - // SystemData: &armhealthcareapis.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-27T19:26:24.072Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-27T19:26:24.072Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_Get.json -func ExampleIotConnectorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotConnectorsClient().Get(ctx, "testRG", "workspace1", "blue", 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.IotConnector = armhealthcareapis.IotConnector{ - // Identity: &armhealthcareapis.ServiceManagedIdentityIdentity{ - // Type: to.Ptr(armhealthcareapis.ServiceManagedIdentityTypeSystemAssigned), - // }, - // Name: to.Ptr("blue"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/iotconnectors"), - // Etag: to.Ptr("00000000-0000-0000-f5ac-912ca49e01d6"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/iotconnectors/blue"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // Properties: &armhealthcareapis.IotConnectorProperties{ - // DeviceMapping: &armhealthcareapis.IotMappingProperties{ - // Content: map[string]any{ - // "template":[]any{ - // map[string]any{ - // "template":map[string]any{ - // "deviceIdExpression": "$.deviceid", - // "timestampExpression": "$.measurementdatetime", - // "typeMatchExpression": "$..[?(@heartrate)]", - // "typeName": "heartrate", - // "values":[]any{ - // map[string]any{ - // "required": "true", - // "valueExpression": "$.heartrate", - // "valueName": "hr", - // }, - // }, - // }, - // "templateType": "JsonPathContent", - // }, - // }, - // "templateType": "CollectionContent", - // }, - // }, - // IngestionEndpointConfiguration: &armhealthcareapis.IotEventHubIngestionEndpointConfiguration{ - // ConsumerGroup: to.Ptr("ConsumerGroupA"), - // EventHubName: to.Ptr("MyEventHubName"), - // FullyQualifiedEventHubNamespace: to.Ptr("myeventhub.servicesbus.windows.net"), - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // }, - // SystemData: &armhealthcareapis.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-28T19:26:24.072Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-28T19:26:24.072Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_Create.json -func ExampleIotConnectorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIotConnectorsClient().BeginCreateOrUpdate(ctx, "testRG", "workspace1", "blue", armhealthcareapis.IotConnector{ - Identity: &armhealthcareapis.ServiceManagedIdentityIdentity{ - Type: to.Ptr(armhealthcareapis.ServiceManagedIdentityTypeSystemAssigned), - }, - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "additionalProp1": to.Ptr("string"), - "additionalProp2": to.Ptr("string"), - "additionalProp3": to.Ptr("string"), - }, - Properties: &armhealthcareapis.IotConnectorProperties{ - DeviceMapping: &armhealthcareapis.IotMappingProperties{ - Content: map[string]any{ - "template": []any{ - map[string]any{ - "template": map[string]any{ - "deviceIdExpression": "$.deviceid", - "timestampExpression": "$.measurementdatetime", - "typeMatchExpression": "$..[?(@heartrate)]", - "typeName": "heartrate", - "values": []any{ - map[string]any{ - "required": "true", - "valueExpression": "$.heartrate", - "valueName": "hr", - }, - }, - }, - "templateType": "JsonPathContent", - }, - }, - "templateType": "CollectionContent", - }, - }, - IngestionEndpointConfiguration: &armhealthcareapis.IotEventHubIngestionEndpointConfiguration{ - ConsumerGroup: to.Ptr("ConsumerGroupA"), - EventHubName: to.Ptr("MyEventHubName"), - FullyQualifiedEventHubNamespace: to.Ptr("myeventhub.servicesbus.windows.net"), - }, - }, - }, 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.IotConnector = armhealthcareapis.IotConnector{ - // Identity: &armhealthcareapis.ServiceManagedIdentityIdentity{ - // Type: to.Ptr(armhealthcareapis.ServiceManagedIdentityTypeSystemAssigned), - // }, - // Name: to.Ptr("blue"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/iotconnectors"), - // Etag: to.Ptr("00000000-0000-0000-f5ac-912ca49e01d6"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/iotconnectors/blue"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // Properties: &armhealthcareapis.IotConnectorProperties{ - // DeviceMapping: &armhealthcareapis.IotMappingProperties{ - // Content: map[string]any{ - // "template":[]any{ - // map[string]any{ - // "template":map[string]any{ - // "deviceIdExpression": "$.deviceid", - // "timestampExpression": "$.measurementdatetime", - // "typeMatchExpression": "$..[?(@heartrate)]", - // "typeName": "heartrate", - // "values":[]any{ - // map[string]any{ - // "required": "true", - // "valueExpression": "$.heartrate", - // "valueName": "hr", - // }, - // }, - // }, - // "templateType": "JsonPathContent", - // }, - // }, - // "templateType": "CollectionContent", - // }, - // }, - // IngestionEndpointConfiguration: &armhealthcareapis.IotEventHubIngestionEndpointConfiguration{ - // ConsumerGroup: to.Ptr("ConsumerGroupA"), - // EventHubName: to.Ptr("MyEventHubName"), - // FullyQualifiedEventHubNamespace: to.Ptr("myeventhub.servicesbus.windows.net"), - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // }, - // SystemData: &armhealthcareapis.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-28T19:26:24.072Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-28T19:26:24.072Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_Patch.json -func ExampleIotConnectorsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIotConnectorsClient().BeginUpdate(ctx, "testRG", "blue", "workspace1", armhealthcareapis.IotConnectorPatchResource{ - Tags: map[string]*string{ - "additionalProp1": to.Ptr("string"), - "additionalProp2": to.Ptr("string"), - "additionalProp3": to.Ptr("string"), - }, - Identity: &armhealthcareapis.ServiceManagedIdentityIdentity{ - Type: to.Ptr(armhealthcareapis.ServiceManagedIdentityTypeSystemAssigned), - }, - }, 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.IotConnector = armhealthcareapis.IotConnector{ - // Identity: &armhealthcareapis.ServiceManagedIdentityIdentity{ - // Type: to.Ptr(armhealthcareapis.ServiceManagedIdentityTypeSystemAssigned), - // }, - // Name: to.Ptr("blue"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/iotconnectors"), - // Etag: to.Ptr("00000000-0000-0000-f5ac-912ca49e01d6"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/iotconnectors/blue"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "additionalProp1": to.Ptr("string"), - // "additionalProp2": to.Ptr("string"), - // "additionalProp3": to.Ptr("string"), - // }, - // Properties: &armhealthcareapis.IotConnectorProperties{ - // DeviceMapping: &armhealthcareapis.IotMappingProperties{ - // Content: map[string]any{ - // "template":[]any{ - // map[string]any{ - // "template":map[string]any{ - // "deviceIdExpression": "$.deviceid", - // "timestampExpression": "$.measurementdatetime", - // "typeMatchExpression": "$..[?(@heartrate)]", - // "typeName": "heartrate", - // "values":[]any{ - // map[string]any{ - // "required": "true", - // "valueExpression": "$.heartrate", - // "valueName": "hr", - // }, - // }, - // }, - // "templateType": "JsonPathContent", - // }, - // }, - // "templateType": "CollectionContent", - // }, - // }, - // IngestionEndpointConfiguration: &armhealthcareapis.IotEventHubIngestionEndpointConfiguration{ - // ConsumerGroup: to.Ptr("ConsumerGroupA"), - // EventHubName: to.Ptr("MyEventHubName"), - // FullyQualifiedEventHubNamespace: to.Ptr("myeventhub.servicesbus.windows.net"), - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // }, - // SystemData: &armhealthcareapis.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-28T19:26:24.072Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-28T19:26:24.072Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_Delete.json -func ExampleIotConnectorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewIotConnectorsClient().BeginDelete(ctx, "testRG", "blue", "workspace1", 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) - } -} diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/models.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/models.go index e09dab28808b..3181f60c7ab4 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/models.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/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 armhealthcareapis @@ -20,6 +19,24 @@ type CheckNameAvailabilityParameters struct { Type *string } +// CorsConfiguration - The settings for the CORS configuration of the service instance. +type CorsConfiguration struct { + // If credentials are allowed via CORS. + AllowCredentials *bool + + // The headers to be allowed via CORS. + Headers []*string + + // The max age to be allowed via CORS. + MaxAge *int32 + + // The methods to be allowed via CORS. + Methods []*string + + // The origins to be allowed via CORS. + Origins []*string +} + // DicomService - The description of Dicom Service type DicomService struct { // An etag associated with the resource, used for optimistic concurrency when editing it. @@ -82,9 +99,15 @@ type DicomServiceProperties struct { // Dicom Service authentication configuration. AuthenticationConfiguration *DicomServiceAuthenticationConfiguration + // Dicom Service Cors configuration. + CorsConfiguration *CorsConfiguration + // Control permission for data plane traffic coming from public networks while private endpoint is enabled. PublicNetworkAccess *PublicNetworkAccess + // READ-ONLY; DICOM Service event support status. + EventState *ServiceEventState + // READ-ONLY; The list of private endpoint connections that are set up for this resource. PrivateEndpointConnections []*PrivateEndpointConnection @@ -95,36 +118,6 @@ type DicomServiceProperties struct { ServiceURL *string } -// DicomServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the DicomServicesClient.BeginCreateOrUpdate -// method. -type DicomServicesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DicomServicesClientBeginDeleteOptions contains the optional parameters for the DicomServicesClient.BeginDelete method. -type DicomServicesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DicomServicesClientBeginUpdateOptions contains the optional parameters for the DicomServicesClient.BeginUpdate method. -type DicomServicesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DicomServicesClientGetOptions contains the optional parameters for the DicomServicesClient.Get method. -type DicomServicesClientGetOptions struct { - // placeholder for future optional parameters -} - -// DicomServicesClientListByWorkspaceOptions contains the optional parameters for the DicomServicesClient.NewListByWorkspacePager -// method. -type DicomServicesClientListByWorkspaceOptions struct { - // placeholder for future optional parameters -} - // Error details. type Error struct { // Error details @@ -149,12 +142,6 @@ type ErrorDetailsInternal struct { Target *string } -// FhirDestinationsClientListByIotConnectorOptions contains the optional parameters for the FhirDestinationsClient.NewListByIotConnectorPager -// method. -type FhirDestinationsClientListByIotConnectorOptions struct { - // placeholder for future optional parameters -} - // FhirService - The description of Fhir Service type FhirService struct { // An etag associated with the resource, used for optimistic concurrency when editing it. @@ -188,12 +175,6 @@ type FhirService struct { Type *string } -// FhirServiceAccessPolicyEntry - An access policy entry. -type FhirServiceAccessPolicyEntry struct { - // REQUIRED; An Azure AD object ID (User or Apps) that is allowed access to the FHIR service. - ObjectID *string -} - // FhirServiceAcrConfiguration - Azure container registry configuration information type FhirServiceAcrConfiguration struct { // The list of the Azure container registry login servers. @@ -248,6 +229,18 @@ type FhirServiceExportConfiguration struct { StorageAccountName *string } +// FhirServiceImportConfiguration - Import operation configuration information +type FhirServiceImportConfiguration struct { + // If the import operation is enabled. + Enabled *bool + + // If the FHIR service is in InitialImportMode. + InitialImportMode *bool + + // The name of the default integration storage account. + IntegrationDataStore *string +} + // FhirServicePatchResource - FhirService patch properties type FhirServicePatchResource struct { // Setting indicating whether the service has a managed identity associated with it. @@ -259,9 +252,6 @@ type FhirServicePatchResource struct { // FhirServiceProperties - Fhir Service properties. type FhirServiceProperties struct { - // Fhir Service access policies. - AccessPolicies []*FhirServiceAccessPolicyEntry - // Fhir Service Azure container registry configuration. AcrConfiguration *FhirServiceAcrConfiguration @@ -274,6 +264,12 @@ type FhirServiceProperties struct { // Fhir Service export configuration. ExportConfiguration *FhirServiceExportConfiguration + // Implementation Guides configuration. + ImplementationGuidesConfiguration *ImplementationGuidesConfiguration + + // Fhir Service import configuration. + ImportConfiguration *FhirServiceImportConfiguration + // Control permission for data plane traffic coming from public networks while private endpoint is enabled. PublicNetworkAccess *PublicNetworkAccess @@ -290,34 +286,11 @@ type FhirServiceProperties struct { ProvisioningState *ProvisioningState } -// FhirServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the FhirServicesClient.BeginCreateOrUpdate -// method. -type FhirServicesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FhirServicesClientBeginDeleteOptions contains the optional parameters for the FhirServicesClient.BeginDelete method. -type FhirServicesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FhirServicesClientBeginUpdateOptions contains the optional parameters for the FhirServicesClient.BeginUpdate method. -type FhirServicesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// FhirServicesClientGetOptions contains the optional parameters for the FhirServicesClient.Get method. -type FhirServicesClientGetOptions struct { - // placeholder for future optional parameters -} - -// FhirServicesClientListByWorkspaceOptions contains the optional parameters for the FhirServicesClient.NewListByWorkspacePager -// method. -type FhirServicesClientListByWorkspaceOptions struct { - // placeholder for future optional parameters +// ImplementationGuidesConfiguration - The settings for Implementation Guides - defining capabilities for national standards, +// vendor consortiums, clinical societies, etc. +type ImplementationGuidesConfiguration struct { + // If US Core Missing Data requirement is enabled. + UsCoreMissingData *bool } // IotConnector - IoT Connector definition. @@ -359,26 +332,6 @@ type IotConnectorCollection struct { Value []*IotConnector } -// IotConnectorFhirDestinationClientBeginCreateOrUpdateOptions contains the optional parameters for the IotConnectorFhirDestinationClient.BeginCreateOrUpdate -// method. -type IotConnectorFhirDestinationClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// IotConnectorFhirDestinationClientBeginDeleteOptions contains the optional parameters for the IotConnectorFhirDestinationClient.BeginDelete -// method. -type IotConnectorFhirDestinationClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// IotConnectorFhirDestinationClientGetOptions contains the optional parameters for the IotConnectorFhirDestinationClient.Get -// method. -type IotConnectorFhirDestinationClientGetOptions struct { - // placeholder for future optional parameters -} - // IotConnectorPatchResource - Iot Connector patch properties type IotConnectorPatchResource struct { // Setting indicating whether the service has a managed identity associated with it. @@ -400,36 +353,6 @@ type IotConnectorProperties struct { ProvisioningState *ProvisioningState } -// IotConnectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the IotConnectorsClient.BeginCreateOrUpdate -// method. -type IotConnectorsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// IotConnectorsClientBeginDeleteOptions contains the optional parameters for the IotConnectorsClient.BeginDelete method. -type IotConnectorsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// IotConnectorsClientBeginUpdateOptions contains the optional parameters for the IotConnectorsClient.BeginUpdate method. -type IotConnectorsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// IotConnectorsClientGetOptions contains the optional parameters for the IotConnectorsClient.Get method. -type IotConnectorsClientGetOptions struct { - // placeholder for future optional parameters -} - -// IotConnectorsClientListByWorkspaceOptions contains the optional parameters for the IotConnectorsClient.NewListByWorkspacePager -// method. -type IotConnectorsClientListByWorkspaceOptions struct { - // placeholder for future optional parameters -} - // IotDestinationProperties - Common IoT Connector destination properties. type IotDestinationProperties struct { // READ-ONLY; The provisioning state. @@ -570,13 +493,28 @@ type MetricSpecification struct { // Localized friendly display name of the metric DisplayName *string + // Whether regional MDM account enabled. + EnableRegionalMdmAccount *bool + // Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. FillGapWithZero *bool + // Whether the metric is internal. + IsInternal *bool + + // Pattern for the filter of the metric. + MetricFilterPattern *string + // Name of the metric Name *string - // Name of the MDM namespace. Optional. + // The resource Id dimension name override. + ResourceIDDimensionNameOverride *string + + // The source MDM account. + SourceMdmAccount *string + + // The source MDM namespace. SourceMdmNamespace *string // Supported aggregation types @@ -632,11 +570,6 @@ type OperationProperties struct { ServiceSpecification *ServiceSpecification } -// OperationResultsClientGetOptions contains the optional parameters for the OperationResultsClient.Get method. -type OperationResultsClientGetOptions struct { - // placeholder for future optional parameters -} - // OperationResultsDescription - The properties indicating the operation result of an operation on a service. type OperationResultsDescription struct { // Additional properties of the operation result. @@ -658,11 +591,6 @@ type OperationResultsDescription struct { Status *OperationResultStatus } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // PrivateEndpoint - The Private Endpoint resource. type PrivateEndpoint struct { // READ-ONLY; The ARM identifier for Private Endpoint @@ -727,32 +655,6 @@ type PrivateEndpointConnectionProperties struct { ProvisioningState *PrivateEndpointConnectionProvisioningState } -// PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate -// method. -type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete -// method. -type PrivateEndpointConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get -// method. -type PrivateEndpointConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// PrivateEndpointConnectionsClientListByServiceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByServicePager -// method. -type PrivateEndpointConnectionsClientListByServiceOptions struct { - // placeholder for future optional parameters -} - // PrivateLinkResource - A private link resource type PrivateLinkResource struct { // Resource properties. @@ -804,17 +706,6 @@ type PrivateLinkResourceProperties struct { RequiredMembers []*string } -// PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method. -type PrivateLinkResourcesClientGetOptions struct { - // placeholder for future optional parameters -} - -// PrivateLinkResourcesClientListByServiceOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByService -// method. -type PrivateLinkResourcesClientListByServiceOptions struct { - // placeholder for future optional parameters -} - // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer // and provider. type PrivateLinkServiceConnectionState struct { @@ -917,6 +808,9 @@ type ServiceCorsConfigurationInfo struct { // ServiceCosmosDbConfigurationInfo - The settings for the Cosmos DB database backing the service. type ServiceCosmosDbConfigurationInfo struct { + // The multi-tenant application id used to enable CMK access for services in a data sovereign region. + CrossTenantCmkApplicationID *string + // The URI of the customer-managed key for the backing database. KeyVaultKeyURI *string @@ -930,6 +824,18 @@ type ServiceExportConfigurationInfo struct { StorageAccountName *string } +// ServiceImportConfigurationInfo - Import operation configuration information +type ServiceImportConfigurationInfo struct { + // If the import operation is enabled. + Enabled *bool + + // If the FHIR service is in InitialImportMode. + InitialImportMode *bool + + // The name of the default integration storage account. + IntegrationDataStore *string +} + // ServiceManagedIdentity - Managed service identity (system assigned and/or user assigned identities) type ServiceManagedIdentity struct { // Setting indicating whether the service has a managed identity associated with it. @@ -977,46 +883,6 @@ type ServiceSpecification struct { MetricSpecifications []*MetricSpecification } -// ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate method. -type ServicesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServicesClientBeginDeleteOptions contains the optional parameters for the ServicesClient.BeginDelete method. -type ServicesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServicesClientBeginUpdateOptions contains the optional parameters for the ServicesClient.BeginUpdate method. -type ServicesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability -// method. -type ServicesClientCheckNameAvailabilityOptions struct { - // placeholder for future optional parameters -} - -// ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. -type ServicesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.NewListByResourceGroupPager -// method. -type ServicesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ServicesClientListOptions contains the optional parameters for the ServicesClient.NewListPager method. -type ServicesClientListOptions struct { - // placeholder for future optional parameters -} - // ServicesDescription - The description of the service. type ServicesDescription struct { // REQUIRED; The kind of the service. @@ -1100,6 +966,9 @@ type ServicesProperties struct { // The settings for the export operation of the service instance. ExportConfiguration *ServiceExportConfigurationInfo + // The settings for the import operation of the service instance. + ImportConfiguration *ServiceImportConfigurationInfo + // The list of private endpoint connections that are set up for this resource. PrivateEndpointConnections []*PrivateEndpointConnection @@ -1248,44 +1117,6 @@ type WorkspacePatchResource struct { Tags map[string]*string } -// WorkspacePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkspacePrivateEndpointConnectionsClient.BeginCreateOrUpdate -// method. -type WorkspacePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WorkspacePrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the WorkspacePrivateEndpointConnectionsClient.BeginDelete -// method. -type WorkspacePrivateEndpointConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WorkspacePrivateEndpointConnectionsClientGetOptions contains the optional parameters for the WorkspacePrivateEndpointConnectionsClient.Get -// method. -type WorkspacePrivateEndpointConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// WorkspacePrivateEndpointConnectionsClientListByWorkspaceOptions contains the optional parameters for the WorkspacePrivateEndpointConnectionsClient.NewListByWorkspacePager -// method. -type WorkspacePrivateEndpointConnectionsClientListByWorkspaceOptions struct { - // placeholder for future optional parameters -} - -// WorkspacePrivateLinkResourcesClientGetOptions contains the optional parameters for the WorkspacePrivateLinkResourcesClient.Get -// method. -type WorkspacePrivateLinkResourcesClientGetOptions struct { - // placeholder for future optional parameters -} - -// WorkspacePrivateLinkResourcesClientListByWorkspaceOptions contains the optional parameters for the WorkspacePrivateLinkResourcesClient.NewListByWorkspacePager -// method. -type WorkspacePrivateLinkResourcesClientListByWorkspaceOptions struct { - // placeholder for future optional parameters -} - // WorkspaceProperties - Workspaces resource specific properties. type WorkspaceProperties struct { // Control permission for data plane traffic coming from public networks while private endpoint is enabled. @@ -1297,39 +1128,3 @@ type WorkspaceProperties struct { // READ-ONLY; The provisioning state. ProvisioningState *ProvisioningState } - -// WorkspacesClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkspacesClient.BeginCreateOrUpdate -// method. -type WorkspacesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WorkspacesClientBeginDeleteOptions contains the optional parameters for the WorkspacesClient.BeginDelete method. -type WorkspacesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WorkspacesClientBeginUpdateOptions contains the optional parameters for the WorkspacesClient.BeginUpdate method. -type WorkspacesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method. -type WorkspacesClientGetOptions struct { - // placeholder for future optional parameters -} - -// WorkspacesClientListByResourceGroupOptions contains the optional parameters for the WorkspacesClient.NewListByResourceGroupPager -// method. -type WorkspacesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// WorkspacesClientListBySubscriptionOptions contains the optional parameters for the WorkspacesClient.NewListBySubscriptionPager -// method. -type WorkspacesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/models_serde.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/models_serde.go index 18674554f4c6..f3f41239e18a 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/models_serde.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/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 armhealthcareapis @@ -47,6 +46,49 @@ func (c *CheckNameAvailabilityParameters) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CorsConfiguration. +func (c CorsConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowCredentials", c.AllowCredentials) + populate(objectMap, "headers", c.Headers) + populate(objectMap, "maxAge", c.MaxAge) + populate(objectMap, "methods", c.Methods) + populate(objectMap, "origins", c.Origins) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CorsConfiguration. +func (c *CorsConfiguration) UnmarshalJSON(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 "allowCredentials": + err = unpopulate(val, "AllowCredentials", &c.AllowCredentials) + delete(rawMsg, key) + case "headers": + err = unpopulate(val, "Headers", &c.Headers) + delete(rawMsg, key) + case "maxAge": + err = unpopulate(val, "MaxAge", &c.MaxAge) + delete(rawMsg, key) + case "methods": + err = unpopulate(val, "Methods", &c.Methods) + delete(rawMsg, key) + case "origins": + err = unpopulate(val, "Origins", &c.Origins) + 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 DicomService. func (d DicomService) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -203,6 +245,8 @@ func (d *DicomServicePatchResource) UnmarshalJSON(data []byte) error { func (d DicomServiceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "authenticationConfiguration", d.AuthenticationConfiguration) + populate(objectMap, "corsConfiguration", d.CorsConfiguration) + populate(objectMap, "eventState", d.EventState) populate(objectMap, "privateEndpointConnections", d.PrivateEndpointConnections) populate(objectMap, "provisioningState", d.ProvisioningState) populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) @@ -222,6 +266,12 @@ func (d *DicomServiceProperties) UnmarshalJSON(data []byte) error { case "authenticationConfiguration": err = unpopulate(val, "AuthenticationConfiguration", &d.AuthenticationConfiguration) delete(rawMsg, key) + case "corsConfiguration": + err = unpopulate(val, "CorsConfiguration", &d.CorsConfiguration) + delete(rawMsg, key) + case "eventState": + err = unpopulate(val, "EventState", &d.EventState) + delete(rawMsg, key) case "privateEndpointConnections": err = unpopulate(val, "PrivateEndpointConnections", &d.PrivateEndpointConnections) delete(rawMsg, key) @@ -394,33 +444,6 @@ func (f *FhirService) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type FhirServiceAccessPolicyEntry. -func (f FhirServiceAccessPolicyEntry) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "objectId", f.ObjectID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FhirServiceAccessPolicyEntry. -func (f *FhirServiceAccessPolicyEntry) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "objectId": - err = unpopulate(val, "ObjectID", &f.ObjectID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type FhirServiceAcrConfiguration. func (f FhirServiceAcrConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -588,6 +611,41 @@ func (f *FhirServiceExportConfiguration) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type FhirServiceImportConfiguration. +func (f FhirServiceImportConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", f.Enabled) + populate(objectMap, "initialImportMode", f.InitialImportMode) + populate(objectMap, "integrationDataStore", f.IntegrationDataStore) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FhirServiceImportConfiguration. +func (f *FhirServiceImportConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &f.Enabled) + delete(rawMsg, key) + case "initialImportMode": + err = unpopulate(val, "InitialImportMode", &f.InitialImportMode) + delete(rawMsg, key) + case "integrationDataStore": + err = unpopulate(val, "IntegrationDataStore", &f.IntegrationDataStore) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type FhirServicePatchResource. func (f FhirServicePatchResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -622,12 +680,13 @@ func (f *FhirServicePatchResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FhirServiceProperties. func (f FhirServiceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "accessPolicies", f.AccessPolicies) populate(objectMap, "acrConfiguration", f.AcrConfiguration) populate(objectMap, "authenticationConfiguration", f.AuthenticationConfiguration) populate(objectMap, "corsConfiguration", f.CorsConfiguration) populate(objectMap, "eventState", f.EventState) populate(objectMap, "exportConfiguration", f.ExportConfiguration) + populate(objectMap, "implementationGuidesConfiguration", f.ImplementationGuidesConfiguration) + populate(objectMap, "importConfiguration", f.ImportConfiguration) populate(objectMap, "privateEndpointConnections", f.PrivateEndpointConnections) populate(objectMap, "provisioningState", f.ProvisioningState) populate(objectMap, "publicNetworkAccess", f.PublicNetworkAccess) @@ -644,9 +703,6 @@ func (f *FhirServiceProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "accessPolicies": - err = unpopulate(val, "AccessPolicies", &f.AccessPolicies) - delete(rawMsg, key) case "acrConfiguration": err = unpopulate(val, "AcrConfiguration", &f.AcrConfiguration) delete(rawMsg, key) @@ -662,6 +718,12 @@ func (f *FhirServiceProperties) UnmarshalJSON(data []byte) error { case "exportConfiguration": err = unpopulate(val, "ExportConfiguration", &f.ExportConfiguration) delete(rawMsg, key) + case "implementationGuidesConfiguration": + err = unpopulate(val, "ImplementationGuidesConfiguration", &f.ImplementationGuidesConfiguration) + delete(rawMsg, key) + case "importConfiguration": + err = unpopulate(val, "ImportConfiguration", &f.ImportConfiguration) + delete(rawMsg, key) case "privateEndpointConnections": err = unpopulate(val, "PrivateEndpointConnections", &f.PrivateEndpointConnections) delete(rawMsg, key) @@ -682,6 +744,33 @@ func (f *FhirServiceProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ImplementationGuidesConfiguration. +func (i ImplementationGuidesConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "usCoreMissingData", i.UsCoreMissingData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImplementationGuidesConfiguration. +func (i *ImplementationGuidesConfiguration) UnmarshalJSON(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 "usCoreMissingData": + err = unpopulate(val, "UsCoreMissingData", &i.UsCoreMissingData) + 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 IotConnector. func (i IotConnector) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1200,8 +1289,13 @@ func (m MetricSpecification) MarshalJSON() ([]byte, error) { populate(objectMap, "dimensions", m.Dimensions) populate(objectMap, "displayDescription", m.DisplayDescription) populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "enableRegionalMdmAccount", m.EnableRegionalMdmAccount) populate(objectMap, "fillGapWithZero", m.FillGapWithZero) + populate(objectMap, "isInternal", m.IsInternal) + populate(objectMap, "metricFilterPattern", m.MetricFilterPattern) populate(objectMap, "name", m.Name) + populate(objectMap, "resourceIdDimensionNameOverride", m.ResourceIDDimensionNameOverride) + populate(objectMap, "sourceMdmAccount", m.SourceMdmAccount) populate(objectMap, "sourceMdmNamespace", m.SourceMdmNamespace) populate(objectMap, "supportedAggregationTypes", m.SupportedAggregationTypes) populate(objectMap, "supportedTimeGrainTypes", m.SupportedTimeGrainTypes) @@ -1233,12 +1327,27 @@ func (m *MetricSpecification) UnmarshalJSON(data []byte) error { case "displayName": err = unpopulate(val, "DisplayName", &m.DisplayName) delete(rawMsg, key) + case "enableRegionalMdmAccount": + err = unpopulate(val, "EnableRegionalMdmAccount", &m.EnableRegionalMdmAccount) + delete(rawMsg, key) case "fillGapWithZero": err = unpopulate(val, "FillGapWithZero", &m.FillGapWithZero) delete(rawMsg, key) + case "isInternal": + err = unpopulate(val, "IsInternal", &m.IsInternal) + delete(rawMsg, key) + case "metricFilterPattern": + err = unpopulate(val, "MetricFilterPattern", &m.MetricFilterPattern) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) + case "resourceIdDimensionNameOverride": + err = unpopulate(val, "ResourceIDDimensionNameOverride", &m.ResourceIDDimensionNameOverride) + delete(rawMsg, key) + case "sourceMdmAccount": + err = unpopulate(val, "SourceMdmAccount", &m.SourceMdmAccount) + delete(rawMsg, key) case "sourceMdmNamespace": err = unpopulate(val, "SourceMdmNamespace", &m.SourceMdmNamespace) delete(rawMsg, key) @@ -2067,6 +2176,7 @@ func (s *ServiceCorsConfigurationInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ServiceCosmosDbConfigurationInfo. func (s ServiceCosmosDbConfigurationInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "crossTenantCmkApplicationId", s.CrossTenantCmkApplicationID) populate(objectMap, "keyVaultKeyUri", s.KeyVaultKeyURI) populate(objectMap, "offerThroughput", s.OfferThroughput) return json.Marshal(objectMap) @@ -2081,6 +2191,9 @@ func (s *ServiceCosmosDbConfigurationInfo) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "crossTenantCmkApplicationId": + err = unpopulate(val, "CrossTenantCmkApplicationID", &s.CrossTenantCmkApplicationID) + delete(rawMsg, key) case "keyVaultKeyUri": err = unpopulate(val, "KeyVaultKeyURI", &s.KeyVaultKeyURI) delete(rawMsg, key) @@ -2122,6 +2235,41 @@ func (s *ServiceExportConfigurationInfo) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ServiceImportConfigurationInfo. +func (s ServiceImportConfigurationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", s.Enabled) + populate(objectMap, "initialImportMode", s.InitialImportMode) + populate(objectMap, "integrationDataStore", s.IntegrationDataStore) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceImportConfigurationInfo. +func (s *ServiceImportConfigurationInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &s.Enabled) + delete(rawMsg, key) + case "initialImportMode": + err = unpopulate(val, "InitialImportMode", &s.InitialImportMode) + delete(rawMsg, key) + case "integrationDataStore": + err = unpopulate(val, "IntegrationDataStore", &s.IntegrationDataStore) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ServiceManagedIdentity. func (s ServiceManagedIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2423,6 +2571,7 @@ func (s ServicesProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "corsConfiguration", s.CorsConfiguration) populate(objectMap, "cosmosDbConfiguration", s.CosmosDbConfiguration) populate(objectMap, "exportConfiguration", s.ExportConfiguration) + populate(objectMap, "importConfiguration", s.ImportConfiguration) populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) populate(objectMap, "provisioningState", s.ProvisioningState) populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) @@ -2456,6 +2605,9 @@ func (s *ServicesProperties) UnmarshalJSON(data []byte) error { case "exportConfiguration": err = unpopulate(val, "ExportConfiguration", &s.ExportConfiguration) delete(rawMsg, key) + case "importConfiguration": + err = unpopulate(val, "ImportConfiguration", &s.ImportConfiguration) + delete(rawMsg, key) case "privateEndpointConnections": err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) delete(rawMsg, key) diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/operationresults_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/operationresults_client.go index 3dafc82130f9..b51811afedec 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/operationresults_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/operationresults_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 armhealthcareapis @@ -29,7 +28,7 @@ type OperationResultsClient struct { } // NewOperationResultsClient creates a new instance of OperationResultsClient with the specified values. -// - subscriptionID - The subscription identifier. +// - 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 NewOperationResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationResultsClient, error) { @@ -47,23 +46,26 @@ func NewOperationResultsClient(subscriptionID string, credential azcore.TokenCre // Get - Get the operation result for a long running operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - locationName - The location of the operation. // - operationResultID - The ID of the operation result to get. // - options - OperationResultsClientGetOptions contains the optional parameters for the OperationResultsClient.Get method. func (client *OperationResultsClient) Get(ctx context.Context, locationName string, operationResultID string, options *OperationResultsClientGetOptions) (OperationResultsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, locationName, operationResultID, options) if err != nil { return OperationResultsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OperationResultsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OperationResultsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OperationResultsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -86,7 +88,7 @@ func (client *OperationResultsClient) getCreateRequest(ctx context.Context, loca return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/operationresults_client_example_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/operationresults_client_example_test.go deleted file mode 100644 index 2fc51f1031e1..000000000000 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/operationresults_client_example_test.go +++ /dev/null @@ -1,47 +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 armhealthcareapis_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/OperationResultsGet.json -func ExampleOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationResultsClient().Get(ctx, "westus", "exampleid", 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.OperationResultsDescription = armhealthcareapis.OperationResultsDescription{ - // Name: to.Ptr("servicename"), - // EndTime: to.Ptr("2019-01-21T06:04:12.3413202Z"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.HealthcareApis/locations/westus/operationresults/exampleid"), - // Properties: map[string]any{ - // }, - // StartTime: to.Ptr("2019-01-21T06:03:30.2716301Z"), - // Status: to.Ptr(armhealthcareapis.OperationResultStatusRequested), - // } -} diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/operations_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/operations_client.go index 14792a6682fc..66dd390d54be 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/operations_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/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 armhealthcareapis @@ -40,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available operations supported by Microsoft Healthcare resource provider. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - 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-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/operations_client_example_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/operations_client_example_test.go deleted file mode 100644 index 1e8feef1e732..000000000000 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/operations_client_example_test.go +++ /dev/null @@ -1,162 +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 armhealthcareapis_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/OperationsList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(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.ListOperations = armhealthcareapis.ListOperations{ - // Value: []*armhealthcareapis.OperationDetail{ - // { - // Name: to.Ptr("Microsoft.HealthcareApis/services/read"), - // Display: &armhealthcareapis.OperationDisplay{ - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.HealthcareApis/services/write"), - // Display: &armhealthcareapis.OperationDisplay{ - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.HealthcareApis/services/delete"), - // Display: &armhealthcareapis.OperationDisplay{ - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.HealthcareApis/locations/operationresults/read"), - // Display: &armhealthcareapis.OperationDisplay{ - // Description: to.Ptr("Get the status of an asynchronous operation"), - // Operation: to.Ptr("read"), - // Provider: to.Ptr("Microsoft.HealthcareApis"), - // Resource: to.Ptr("operationresults"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.HealthcareApis/workspaces/read"), - // Display: &armhealthcareapis.OperationDisplay{ - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.HealthcareApis/workspaces/write"), - // Display: &armhealthcareapis.OperationDisplay{ - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.HealthcareApis/workspaces/delete"), - // Display: &armhealthcareapis.OperationDisplay{ - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.HealthcareApis/workspaces/dicomservices/read"), - // Display: &armhealthcareapis.OperationDisplay{ - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.HealthcareApis/workspaces/dicomservices/write"), - // Display: &armhealthcareapis.OperationDisplay{ - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.HealthcareApis/workspaces/dicomservices/delete"), - // Display: &armhealthcareapis.OperationDisplay{ - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.HealthcareApis/workspaces/iotconnectors/read"), - // Display: &armhealthcareapis.OperationDisplay{ - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.HealthcareApis/workspaces/iotconnectors/write"), - // Display: &armhealthcareapis.OperationDisplay{ - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.HealthcareApis/workspaces/iotconnectors/delete"), - // Display: &armhealthcareapis.OperationDisplay{ - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.HealthcareApis/workspaces/fhirservices/read"), - // Display: &armhealthcareapis.OperationDisplay{ - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.HealthcareApis/workspaces/fhirservices/write"), - // Display: &armhealthcareapis.OperationDisplay{ - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.HealthcareApis/workspaces/fhirservices/delete"), - // Display: &armhealthcareapis.OperationDisplay{ - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.HealthcareApis/checkNameAvailability/post"), - // Display: &armhealthcareapis.OperationDisplay{ - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("Microsoft.HealthcareApis/Operations/read"), - // Display: &armhealthcareapis.OperationDisplay{ - // Description: to.Ptr("Get the list of operations supported by this Resource Provider."), - // Operation: to.Ptr("read"), - // Provider: to.Ptr("Microsoft.HealthcareApis"), - // Resource: to.Ptr("operations"), - // }, - // Origin: to.Ptr("user,system"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/options.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/options.go new file mode 100644 index 000000000000..b04e71764059 --- /dev/null +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/options.go @@ -0,0 +1,286 @@ +//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 armhealthcareapis + +// DicomServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the DicomServicesClient.BeginCreateOrUpdate +// method. +type DicomServicesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DicomServicesClientBeginDeleteOptions contains the optional parameters for the DicomServicesClient.BeginDelete method. +type DicomServicesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DicomServicesClientBeginUpdateOptions contains the optional parameters for the DicomServicesClient.BeginUpdate method. +type DicomServicesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DicomServicesClientGetOptions contains the optional parameters for the DicomServicesClient.Get method. +type DicomServicesClientGetOptions struct { + // placeholder for future optional parameters +} + +// DicomServicesClientListByWorkspaceOptions contains the optional parameters for the DicomServicesClient.NewListByWorkspacePager +// method. +type DicomServicesClientListByWorkspaceOptions struct { + // placeholder for future optional parameters +} + +// FhirDestinationsClientListByIotConnectorOptions contains the optional parameters for the FhirDestinationsClient.NewListByIotConnectorPager +// method. +type FhirDestinationsClientListByIotConnectorOptions struct { + // placeholder for future optional parameters +} + +// FhirServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the FhirServicesClient.BeginCreateOrUpdate +// method. +type FhirServicesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FhirServicesClientBeginDeleteOptions contains the optional parameters for the FhirServicesClient.BeginDelete method. +type FhirServicesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FhirServicesClientBeginUpdateOptions contains the optional parameters for the FhirServicesClient.BeginUpdate method. +type FhirServicesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// FhirServicesClientGetOptions contains the optional parameters for the FhirServicesClient.Get method. +type FhirServicesClientGetOptions struct { + // placeholder for future optional parameters +} + +// FhirServicesClientListByWorkspaceOptions contains the optional parameters for the FhirServicesClient.NewListByWorkspacePager +// method. +type FhirServicesClientListByWorkspaceOptions struct { + // placeholder for future optional parameters +} + +// IotConnectorFhirDestinationClientBeginCreateOrUpdateOptions contains the optional parameters for the IotConnectorFhirDestinationClient.BeginCreateOrUpdate +// method. +type IotConnectorFhirDestinationClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IotConnectorFhirDestinationClientBeginDeleteOptions contains the optional parameters for the IotConnectorFhirDestinationClient.BeginDelete +// method. +type IotConnectorFhirDestinationClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IotConnectorFhirDestinationClientGetOptions contains the optional parameters for the IotConnectorFhirDestinationClient.Get +// method. +type IotConnectorFhirDestinationClientGetOptions struct { + // placeholder for future optional parameters +} + +// IotConnectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the IotConnectorsClient.BeginCreateOrUpdate +// method. +type IotConnectorsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IotConnectorsClientBeginDeleteOptions contains the optional parameters for the IotConnectorsClient.BeginDelete method. +type IotConnectorsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IotConnectorsClientBeginUpdateOptions contains the optional parameters for the IotConnectorsClient.BeginUpdate method. +type IotConnectorsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// IotConnectorsClientGetOptions contains the optional parameters for the IotConnectorsClient.Get method. +type IotConnectorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// IotConnectorsClientListByWorkspaceOptions contains the optional parameters for the IotConnectorsClient.NewListByWorkspacePager +// method. +type IotConnectorsClientListByWorkspaceOptions struct { + // placeholder for future optional parameters +} + +// OperationResultsClientGetOptions contains the optional parameters for the OperationResultsClient.Get method. +type OperationResultsClientGetOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate +// method. +type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. +type PrivateEndpointConnectionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. +type PrivateEndpointConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientListByServiceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByServicePager +// method. +type PrivateEndpointConnectionsClientListByServiceOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method. +type PrivateLinkResourcesClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResourcesClientListByServiceOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByService +// method. +type PrivateLinkResourcesClientListByServiceOptions struct { + // placeholder for future optional parameters +} + +// ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate method. +type ServicesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServicesClientBeginDeleteOptions contains the optional parameters for the ServicesClient.BeginDelete method. +type ServicesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServicesClientBeginUpdateOptions contains the optional parameters for the ServicesClient.BeginUpdate method. +type ServicesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability +// method. +type ServicesClientCheckNameAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. +type ServicesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.NewListByResourceGroupPager +// method. +type ServicesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ServicesClientListOptions contains the optional parameters for the ServicesClient.NewListPager method. +type ServicesClientListOptions struct { + // placeholder for future optional parameters +} + +// WorkspacePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkspacePrivateEndpointConnectionsClient.BeginCreateOrUpdate +// method. +type WorkspacePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkspacePrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the WorkspacePrivateEndpointConnectionsClient.BeginDelete +// method. +type WorkspacePrivateEndpointConnectionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkspacePrivateEndpointConnectionsClientGetOptions contains the optional parameters for the WorkspacePrivateEndpointConnectionsClient.Get +// method. +type WorkspacePrivateEndpointConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// WorkspacePrivateEndpointConnectionsClientListByWorkspaceOptions contains the optional parameters for the WorkspacePrivateEndpointConnectionsClient.NewListByWorkspacePager +// method. +type WorkspacePrivateEndpointConnectionsClientListByWorkspaceOptions struct { + // placeholder for future optional parameters +} + +// WorkspacePrivateLinkResourcesClientGetOptions contains the optional parameters for the WorkspacePrivateLinkResourcesClient.Get +// method. +type WorkspacePrivateLinkResourcesClientGetOptions struct { + // placeholder for future optional parameters +} + +// WorkspacePrivateLinkResourcesClientListByWorkspaceOptions contains the optional parameters for the WorkspacePrivateLinkResourcesClient.NewListByWorkspacePager +// method. +type WorkspacePrivateLinkResourcesClientListByWorkspaceOptions struct { + // placeholder for future optional parameters +} + +// WorkspacesClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkspacesClient.BeginCreateOrUpdate +// method. +type WorkspacesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkspacesClientBeginDeleteOptions contains the optional parameters for the WorkspacesClient.BeginDelete method. +type WorkspacesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkspacesClientBeginUpdateOptions contains the optional parameters for the WorkspacesClient.BeginUpdate method. +type WorkspacesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method. +type WorkspacesClientGetOptions struct { + // placeholder for future optional parameters +} + +// WorkspacesClientListByResourceGroupOptions contains the optional parameters for the WorkspacesClient.NewListByResourceGroupPager +// method. +type WorkspacesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// WorkspacesClientListBySubscriptionOptions contains the optional parameters for the WorkspacesClient.NewListBySubscriptionPager +// method. +type WorkspacesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/privateendpointconnections_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/privateendpointconnections_client.go index 8b6c40d7ab0c..2497cb1c4b7a 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/privateendpointconnections_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/privateendpointconnections_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 armhealthcareapis @@ -29,7 +28,7 @@ type PrivateEndpointConnectionsClient struct { } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. -// - subscriptionID - The subscription identifier. +// - 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 NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { @@ -47,7 +46,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Update the state of the specified private endpoint connection associated with the service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - resourceName - The name of the service instance. // - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource @@ -60,7 +59,8 @@ func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context. if err != nil { return nil, err } - return runtime.NewPoller[PrivateEndpointConnectionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[PrivateEndpointConnectionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -69,20 +69,22 @@ func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Update the state of the specified private endpoint connection associated with the service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, properties, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -109,16 +111,19 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, properties) + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - resourceName - The name of the service instance. // - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource @@ -130,7 +135,8 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[PrivateEndpointConnectionsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[PrivateEndpointConnectionsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -139,20 +145,22 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, 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 +187,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,25 +196,28 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets the specified private endpoint connection associated with the service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - resourceName - The name of the service instance. // - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource // - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get // method. func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) if err != nil { return PrivateEndpointConnectionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateEndpointConnectionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointConnectionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -233,7 +244,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +261,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByServicePager - Lists all private endpoint connections for a service. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - resourceName - The name of the service instance. // - options - PrivateEndpointConnectionsClientListByServiceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByServicePager @@ -297,7 +308,7 @@ func (client *PrivateEndpointConnectionsClient) listByServiceCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/privateendpointconnections_client_example_test.go deleted file mode 100644 index ab331e3421fa..000000000000 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,165 +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 armhealthcareapis_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/healthcareapis/armhealthcareapis" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceListPrivateEndpointConnections.json -func ExamplePrivateEndpointConnectionsClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByServicePager("rgname", "service1", 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.PrivateEndpointConnectionListResultDescription = armhealthcareapis.PrivateEndpointConnectionListResultDescription{ - // Value: []*armhealthcareapis.PrivateEndpointConnectionDescription{ - // { - // Name: to.Ptr("myConnection"), - // Type: to.Ptr("Microsoft.HealthcareApis/services/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HealthcareApis/services/service1/privateEndpointConnections/myConnection"), - // Properties: &armhealthcareapis.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhealthcareapis.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/peexample01"), - // }, - // PrivateLinkServiceConnectionState: &armhealthcareapis.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armhealthcareapis.PrivateEndpointServiceConnectionStatusApproved), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceGetPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "rgname", "service1", "myConnection", 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.PrivateEndpointConnectionDescription = armhealthcareapis.PrivateEndpointConnectionDescription{ - // Name: to.Ptr("myConnection"), - // Type: to.Ptr("Microsoft.HealthcareApis/services/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HealthcareApis/services/service1/privateEndpointConnections/myConnection"), - // Properties: &armhealthcareapis.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhealthcareapis.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/peexample01"), - // }, - // PrivateLinkServiceConnectionState: &armhealthcareapis.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armhealthcareapis.PrivateEndpointServiceConnectionStatusApproved), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceCreatePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "rgname", "service1", "myConnection", armhealthcareapis.PrivateEndpointConnection{ - Properties: &armhealthcareapis.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armhealthcareapis.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Auto-Approved"), - Status: to.Ptr(armhealthcareapis.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, 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.PrivateEndpointConnectionDescription = armhealthcareapis.PrivateEndpointConnectionDescription{ - // Name: to.Ptr("myConnection"), - // Type: to.Ptr("Microsoft.HealthcareApis/services/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HealthcareApis/services/service1/privateEndpointConnections/myConnection"), - // Properties: &armhealthcareapis.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhealthcareapis.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/peexample01"), - // }, - // PrivateLinkServiceConnectionState: &armhealthcareapis.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armhealthcareapis.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceDeletePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "rgname", "service1", "myConnection", 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) - } -} diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/privatelinkresources_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/privatelinkresources_client.go index 90b85a6780ab..5ca3674e44cc 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/privatelinkresources_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/privatelinkresources_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 armhealthcareapis @@ -29,7 +28,7 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// - subscriptionID - The subscription identifier. +// - 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 NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { @@ -47,25 +46,28 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets a private link resource that need to be created for a service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - resourceName - The name of the service instance. // - groupName - The name of the private link resource group. // - options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get // method. func (client *PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, resourceName string, groupName string, options *PrivateLinkResourcesClientGetOptions) (PrivateLinkResourcesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, groupName, options) if err != nil { return PrivateLinkResourcesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateLinkResourcesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkResourcesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateLinkResourcesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -92,7 +94,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,24 +112,27 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // ListByService - Gets the private link resources that need to be created for a service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - resourceName - The name of the service instance. // - options - PrivateLinkResourcesClientListByServiceOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByService // method. func (client *PrivateLinkResourcesClient) ListByService(ctx context.Context, resourceGroupName string, resourceName string, options *PrivateLinkResourcesClientListByServiceOptions) (PrivateLinkResourcesClientListByServiceResponse, error) { + var err error req, err := client.listByServiceCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return PrivateLinkResourcesClientListByServiceResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateLinkResourcesClientListByServiceResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkResourcesClientListByServiceResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateLinkResourcesClientListByServiceResponse{}, err } - return client.listByServiceHandleResponse(resp) + resp, err := client.listByServiceHandleResponse(httpResp) + return resp, err } // listByServiceCreateRequest creates the ListByService request. @@ -150,7 +155,7 @@ func (client *PrivateLinkResourcesClient) listByServiceCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/privatelinkresources_client_example_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/privatelinkresources_client_example_test.go deleted file mode 100644 index 29d2f982f2a3..000000000000 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,85 +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 armhealthcareapis_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/PrivateLinkResourcesListByService.json -func ExamplePrivateLinkResourcesClient_ListByService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().ListByService(ctx, "rgname", "service1", 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.PrivateLinkResourceListResultDescription = armhealthcareapis.PrivateLinkResourceListResultDescription{ - // Value: []*armhealthcareapis.PrivateLinkResourceDescription{ - // { - // Name: to.Ptr("fhir"), - // Type: to.Ptr("Microsoft.HealthcareApis/services/privateLinkResources"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HealthcareApis/services/service1/privateLinkResources/fhir"), - // Properties: &armhealthcareapis.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("fhir"), - // RequiredMembers: []*string{ - // to.Ptr("fhir")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.azurehealthcareapis.com")}, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/PrivateLinkResourceGet.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateLinkResourcesClient().Get(ctx, "rgname", "service1", "fhir", 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.PrivateLinkResourceDescription = armhealthcareapis.PrivateLinkResourceDescription{ - // Name: to.Ptr("fhir"), - // Type: to.Ptr("Microsoft.HealthcareApis/services/privateLinkResources"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HealthcareApis/services/service1/privateLinkResources/fhir"), - // Properties: &armhealthcareapis.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("fhir"), - // RequiredMembers: []*string{ - // to.Ptr("fhir")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.azurehealthcareapis.com")}, - // }, - // } -} diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/response_types.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/response_types.go index 3fc6eb397855..be96d186a1ea 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/response_types.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/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 armhealthcareapis // DicomServicesClientCreateOrUpdateResponse contains the response from method DicomServicesClient.BeginCreateOrUpdate. type DicomServicesClientCreateOrUpdateResponse struct { + // The description of Dicom Service DicomService } @@ -21,26 +21,31 @@ type DicomServicesClientDeleteResponse struct { // DicomServicesClientGetResponse contains the response from method DicomServicesClient.Get. type DicomServicesClientGetResponse struct { + // The description of Dicom Service DicomService } // DicomServicesClientListByWorkspaceResponse contains the response from method DicomServicesClient.NewListByWorkspacePager. type DicomServicesClientListByWorkspaceResponse struct { + // The collection of Dicom Services. DicomServiceCollection } // DicomServicesClientUpdateResponse contains the response from method DicomServicesClient.BeginUpdate. type DicomServicesClientUpdateResponse struct { + // The description of Dicom Service DicomService } // FhirDestinationsClientListByIotConnectorResponse contains the response from method FhirDestinationsClient.NewListByIotConnectorPager. type FhirDestinationsClientListByIotConnectorResponse struct { + // A collection of IoT Connector FHIR destinations. IotFhirDestinationCollection } // FhirServicesClientCreateOrUpdateResponse contains the response from method FhirServicesClient.BeginCreateOrUpdate. type FhirServicesClientCreateOrUpdateResponse struct { + // The description of Fhir Service FhirService } @@ -51,21 +56,25 @@ type FhirServicesClientDeleteResponse struct { // FhirServicesClientGetResponse contains the response from method FhirServicesClient.Get. type FhirServicesClientGetResponse struct { + // The description of Fhir Service FhirService } // FhirServicesClientListByWorkspaceResponse contains the response from method FhirServicesClient.NewListByWorkspacePager. type FhirServicesClientListByWorkspaceResponse struct { + // A collection of Fhir services. FhirServiceCollection } // FhirServicesClientUpdateResponse contains the response from method FhirServicesClient.BeginUpdate. type FhirServicesClientUpdateResponse struct { + // The description of Fhir Service FhirService } // IotConnectorFhirDestinationClientCreateOrUpdateResponse contains the response from method IotConnectorFhirDestinationClient.BeginCreateOrUpdate. type IotConnectorFhirDestinationClientCreateOrUpdateResponse struct { + // IoT Connector FHIR destination definition. IotFhirDestination } @@ -76,11 +85,13 @@ type IotConnectorFhirDestinationClientDeleteResponse struct { // IotConnectorFhirDestinationClientGetResponse contains the response from method IotConnectorFhirDestinationClient.Get. type IotConnectorFhirDestinationClientGetResponse struct { + // IoT Connector FHIR destination definition. IotFhirDestination } // IotConnectorsClientCreateOrUpdateResponse contains the response from method IotConnectorsClient.BeginCreateOrUpdate. type IotConnectorsClientCreateOrUpdateResponse struct { + // IoT Connector definition. IotConnector } @@ -91,31 +102,37 @@ type IotConnectorsClientDeleteResponse struct { // IotConnectorsClientGetResponse contains the response from method IotConnectorsClient.Get. type IotConnectorsClientGetResponse struct { + // IoT Connector definition. IotConnector } // IotConnectorsClientListByWorkspaceResponse contains the response from method IotConnectorsClient.NewListByWorkspacePager. type IotConnectorsClientListByWorkspaceResponse struct { + // A collection of IoT Connectors. IotConnectorCollection } // IotConnectorsClientUpdateResponse contains the response from method IotConnectorsClient.BeginUpdate. type IotConnectorsClientUpdateResponse struct { + // IoT Connector definition. IotConnector } // OperationResultsClientGetResponse contains the response from method OperationResultsClient.Get. type OperationResultsClientGetResponse struct { + // The properties indicating the operation result of an operation on a service. OperationResultsDescription } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // Available operations of the service ListOperations } // PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginCreateOrUpdate. type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct { + // The Private Endpoint Connection resource. PrivateEndpointConnectionDescription } @@ -126,31 +143,37 @@ type PrivateEndpointConnectionsClientDeleteResponse struct { // PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. type PrivateEndpointConnectionsClientGetResponse struct { + // The Private Endpoint Connection resource. PrivateEndpointConnectionDescription } // PrivateEndpointConnectionsClientListByServiceResponse contains the response from method PrivateEndpointConnectionsClient.NewListByServicePager. type PrivateEndpointConnectionsClientListByServiceResponse struct { + // List of private endpoint connection associated with the specified storage account PrivateEndpointConnectionListResultDescription } // PrivateLinkResourcesClientGetResponse contains the response from method PrivateLinkResourcesClient.Get. type PrivateLinkResourcesClientGetResponse struct { + // The Private Endpoint Connection resource. PrivateLinkResourceDescription } // PrivateLinkResourcesClientListByServiceResponse contains the response from method PrivateLinkResourcesClient.ListByService. type PrivateLinkResourcesClientListByServiceResponse struct { + // A list of private link resources PrivateLinkResourceListResultDescription } // ServicesClientCheckNameAvailabilityResponse contains the response from method ServicesClient.CheckNameAvailability. type ServicesClientCheckNameAvailabilityResponse struct { + // The properties indicating whether a given service name is available. ServicesNameAvailabilityInfo } // ServicesClientCreateOrUpdateResponse contains the response from method ServicesClient.BeginCreateOrUpdate. type ServicesClientCreateOrUpdateResponse struct { + // The description of the service. ServicesDescription } @@ -161,26 +184,31 @@ type ServicesClientDeleteResponse struct { // ServicesClientGetResponse contains the response from method ServicesClient.Get. type ServicesClientGetResponse struct { + // The description of the service. ServicesDescription } // ServicesClientListByResourceGroupResponse contains the response from method ServicesClient.NewListByResourceGroupPager. type ServicesClientListByResourceGroupResponse struct { + // A list of service description objects with a next link. ServicesDescriptionListResult } // ServicesClientListResponse contains the response from method ServicesClient.NewListPager. type ServicesClientListResponse struct { + // A list of service description objects with a next link. ServicesDescriptionListResult } // ServicesClientUpdateResponse contains the response from method ServicesClient.BeginUpdate. type ServicesClientUpdateResponse struct { + // The description of the service. ServicesDescription } // WorkspacePrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method WorkspacePrivateEndpointConnectionsClient.BeginCreateOrUpdate. type WorkspacePrivateEndpointConnectionsClientCreateOrUpdateResponse struct { + // The Private Endpoint Connection resource. PrivateEndpointConnectionDescription } @@ -191,26 +219,31 @@ type WorkspacePrivateEndpointConnectionsClientDeleteResponse struct { // WorkspacePrivateEndpointConnectionsClientGetResponse contains the response from method WorkspacePrivateEndpointConnectionsClient.Get. type WorkspacePrivateEndpointConnectionsClientGetResponse struct { + // The Private Endpoint Connection resource. PrivateEndpointConnectionDescription } // WorkspacePrivateEndpointConnectionsClientListByWorkspaceResponse contains the response from method WorkspacePrivateEndpointConnectionsClient.NewListByWorkspacePager. type WorkspacePrivateEndpointConnectionsClientListByWorkspaceResponse struct { + // List of private endpoint connection associated with the specified storage account PrivateEndpointConnectionListResultDescription } // WorkspacePrivateLinkResourcesClientGetResponse contains the response from method WorkspacePrivateLinkResourcesClient.Get. type WorkspacePrivateLinkResourcesClientGetResponse struct { + // The Private Endpoint Connection resource. PrivateLinkResourceDescription } // WorkspacePrivateLinkResourcesClientListByWorkspaceResponse contains the response from method WorkspacePrivateLinkResourcesClient.NewListByWorkspacePager. type WorkspacePrivateLinkResourcesClientListByWorkspaceResponse struct { + // A list of private link resources PrivateLinkResourceListResultDescription } // WorkspacesClientCreateOrUpdateResponse contains the response from method WorkspacesClient.BeginCreateOrUpdate. type WorkspacesClientCreateOrUpdateResponse struct { + // Workspace resource. Workspace } @@ -221,20 +254,24 @@ type WorkspacesClientDeleteResponse struct { // WorkspacesClientGetResponse contains the response from method WorkspacesClient.Get. type WorkspacesClientGetResponse struct { + // Workspace resource. Workspace } // WorkspacesClientListByResourceGroupResponse contains the response from method WorkspacesClient.NewListByResourceGroupPager. type WorkspacesClientListByResourceGroupResponse struct { + // Collection of workspace object with a next link WorkspaceList } // WorkspacesClientListBySubscriptionResponse contains the response from method WorkspacesClient.NewListBySubscriptionPager. type WorkspacesClientListBySubscriptionResponse struct { + // Collection of workspace object with a next link WorkspaceList } // WorkspacesClientUpdateResponse contains the response from method WorkspacesClient.BeginUpdate. type WorkspacesClientUpdateResponse struct { + // Workspace resource. Workspace } diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/services_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/services_client.go index 0272d0cd24eb..1df704ebdf31 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/services_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/services_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 armhealthcareapis @@ -29,7 +28,7 @@ type ServicesClient struct { } // NewServicesClient creates a new instance of ServicesClient with the specified values. -// - subscriptionID - The subscription identifier. +// - 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 NewServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServicesClient, error) { @@ -47,24 +46,27 @@ func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, // CheckNameAvailability - Check if a service instance name is available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - checkNameAvailabilityInputs - Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the // service instance to check. // - options - ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability // method. func (client *ServicesClient) CheckNameAvailability(ctx context.Context, checkNameAvailabilityInputs CheckNameAvailabilityParameters, options *ServicesClientCheckNameAvailabilityOptions) (ServicesClientCheckNameAvailabilityResponse, error) { + var err error req, err := client.checkNameAvailabilityCreateRequest(ctx, checkNameAvailabilityInputs, options) if err != nil { return ServicesClientCheckNameAvailabilityResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServicesClientCheckNameAvailabilityResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServicesClientCheckNameAvailabilityResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServicesClientCheckNameAvailabilityResponse{}, err } - return client.checkNameAvailabilityHandleResponse(resp) + resp, err := client.checkNameAvailabilityHandleResponse(httpResp) + return resp, err } // checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. @@ -79,10 +81,13 @@ func (client *ServicesClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, checkNameAvailabilityInputs) + if err := runtime.MarshalAsJSON(req, checkNameAvailabilityInputs); err != nil { + return nil, err + } + return req, nil } // checkNameAvailabilityHandleResponse handles the CheckNameAvailability response. @@ -97,7 +102,7 @@ func (client *ServicesClient) checkNameAvailabilityHandleResponse(resp *http.Res // BeginCreateOrUpdate - Create or update the metadata of a service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - resourceName - The name of the service instance. // - serviceDescription - The service instance metadata. @@ -109,7 +114,8 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[ServicesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServicesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServicesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -118,20 +124,22 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create or update the metadata of a service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *ServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, serviceDescription ServicesDescription, options *ServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, serviceDescription, 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. @@ -154,16 +162,19 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, serviceDescription) + if err := runtime.MarshalAsJSON(req, serviceDescription); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete a service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - resourceName - The name of the service instance. // - options - ServicesClientBeginDeleteOptions contains the optional parameters for the ServicesClient.BeginDelete method. @@ -173,7 +184,8 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ServicesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServicesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServicesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -182,20 +194,22 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *ServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ServicesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, 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. @@ -218,7 +232,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -227,23 +241,26 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get the metadata of a service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - resourceName - The name of the service instance. // - options - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. func (client *ServicesClient) Get(ctx context.Context, resourceGroupName string, resourceName string, options *ServicesClientGetOptions) (ServicesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { return ServicesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServicesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServicesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServicesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -266,7 +283,7 @@ func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +300,7 @@ func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesCl // NewListPager - Get all the service instances in a subscription. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - options - ServicesClientListOptions contains the optional parameters for the ServicesClient.NewListPager method. func (client *ServicesClient) NewListPager(options *ServicesClientListOptions) *runtime.Pager[ServicesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ServicesClientListResponse]{ @@ -325,7 +342,7 @@ func (client *ServicesClient) listCreateRequest(ctx context.Context, options *Se return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -342,7 +359,7 @@ func (client *ServicesClient) listHandleResponse(resp *http.Response) (ServicesC // NewListByResourceGroupPager - Get all the service instances in a resource group. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - options - ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.NewListByResourceGroupPager // method. @@ -390,7 +407,7 @@ func (client *ServicesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -408,7 +425,7 @@ func (client *ServicesClient) listByResourceGroupHandleResponse(resp *http.Respo // BeginUpdate - Update the metadata of a service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - resourceName - The name of the service instance. // - servicePatchDescription - The service instance metadata and security metadata. @@ -419,7 +436,8 @@ func (client *ServicesClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ServicesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServicesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServicesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -428,20 +446,22 @@ func (client *ServicesClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Update the metadata of a service instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *ServicesClient) update(ctx context.Context, resourceGroupName string, resourceName string, servicePatchDescription ServicesPatchDescription, options *ServicesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, servicePatchDescription, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -464,8 +484,11 @@ func (client *ServicesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, servicePatchDescription) + if err := runtime.MarshalAsJSON(req, servicePatchDescription); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/services_client_example_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/services_client_example_test.go deleted file mode 100644 index c93460bf6ecc..000000000000 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/services_client_example_test.go +++ /dev/null @@ -1,558 +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 armhealthcareapis_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/healthcareapis/armhealthcareapis" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceGet.json -func ExampleServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Get(ctx, "rg1", "service1", 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.ServicesDescription = armhealthcareapis.ServicesDescription{ - // Name: to.Ptr("service1"), - // Type: to.Ptr("Microsoft.HealthcareApis/services"), - // Etag: to.Ptr("etagvalue"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HealthcareApis/services/service1"), - // Kind: to.Ptr(armhealthcareapis.KindFhirR4), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armhealthcareapis.ServicesProperties{ - // AccessPolicies: []*armhealthcareapis.ServiceAccessPolicyEntry{ - // { - // ObjectID: to.Ptr("c487e7d1-3210-41a3-8ccc-e9372b78da47"), - // }, - // { - // ObjectID: to.Ptr("5b307da8-43d4-492b-8b66-b0294ade872f"), - // }}, - // AuthenticationConfiguration: &armhealthcareapis.ServiceAuthenticationConfigurationInfo{ - // Audience: to.Ptr("https://azurehealthcareapis.com"), - // Authority: to.Ptr("https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc"), - // SmartProxyEnabled: to.Ptr(true), - // }, - // CorsConfiguration: &armhealthcareapis.ServiceCorsConfigurationInfo{ - // AllowCredentials: to.Ptr(false), - // Headers: []*string{ - // to.Ptr("*")}, - // MaxAge: to.Ptr[int32](1440), - // Methods: []*string{ - // to.Ptr("DELETE"), - // to.Ptr("GET"), - // to.Ptr("OPTIONS"), - // to.Ptr("PATCH"), - // to.Ptr("POST"), - // to.Ptr("PUT")}, - // Origins: []*string{ - // to.Ptr("*")}, - // }, - // CosmosDbConfiguration: &armhealthcareapis.ServiceCosmosDbConfigurationInfo{ - // KeyVaultKeyURI: to.Ptr("https://my-vault.vault.azure.net/keys/my-key"), - // OfferThroughput: to.Ptr[int32](1000), - // }, - // PrivateEndpointConnections: []*armhealthcareapis.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armhealthcareapis.PublicNetworkAccessDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceCreate.json -func ExampleServicesClient_BeginCreateOrUpdate_createOrUpdateAServiceWithAllParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "service1", armhealthcareapis.ServicesDescription{ - Identity: &armhealthcareapis.ServicesResourceIdentity{ - Type: to.Ptr(armhealthcareapis.ManagedServiceIdentityTypeSystemAssigned), - }, - Kind: to.Ptr(armhealthcareapis.KindFhirR4), - Location: to.Ptr("westus2"), - Tags: map[string]*string{}, - Properties: &armhealthcareapis.ServicesProperties{ - AccessPolicies: []*armhealthcareapis.ServiceAccessPolicyEntry{ - { - ObjectID: to.Ptr("c487e7d1-3210-41a3-8ccc-e9372b78da47"), - }, - { - ObjectID: to.Ptr("5b307da8-43d4-492b-8b66-b0294ade872f"), - }}, - AuthenticationConfiguration: &armhealthcareapis.ServiceAuthenticationConfigurationInfo{ - Audience: to.Ptr("https://azurehealthcareapis.com"), - Authority: to.Ptr("https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc"), - SmartProxyEnabled: to.Ptr(true), - }, - CorsConfiguration: &armhealthcareapis.ServiceCorsConfigurationInfo{ - AllowCredentials: to.Ptr(false), - Headers: []*string{ - to.Ptr("*")}, - MaxAge: to.Ptr[int32](1440), - Methods: []*string{ - to.Ptr("DELETE"), - to.Ptr("GET"), - to.Ptr("OPTIONS"), - to.Ptr("PATCH"), - to.Ptr("POST"), - to.Ptr("PUT")}, - Origins: []*string{ - to.Ptr("*")}, - }, - CosmosDbConfiguration: &armhealthcareapis.ServiceCosmosDbConfigurationInfo{ - KeyVaultKeyURI: to.Ptr("https://my-vault.vault.azure.net/keys/my-key"), - OfferThroughput: to.Ptr[int32](1000), - }, - ExportConfiguration: &armhealthcareapis.ServiceExportConfigurationInfo{ - StorageAccountName: to.Ptr("existingStorageAccount"), - }, - PrivateEndpointConnections: []*armhealthcareapis.PrivateEndpointConnection{}, - PublicNetworkAccess: to.Ptr(armhealthcareapis.PublicNetworkAccessDisabled), - }, - }, 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.ServicesDescription = armhealthcareapis.ServicesDescription{ - // Name: to.Ptr("service1"), - // Type: to.Ptr("Microsoft.HealthcareApis/services"), - // Etag: to.Ptr("etagvalue"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HealthcareApis/services/service1"), - // Identity: &armhealthcareapis.ServicesResourceIdentity{ - // Type: to.Ptr(armhealthcareapis.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("03fe6ae0-952c-4e4b-954b-cc0364dd252e"), - // TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d8cd011db47"), - // }, - // Kind: to.Ptr(armhealthcareapis.KindFhirR4), - // Location: to.Ptr("West US 2"), - // Tags: map[string]*string{ - // }, - // Properties: &armhealthcareapis.ServicesProperties{ - // AccessPolicies: []*armhealthcareapis.ServiceAccessPolicyEntry{ - // { - // ObjectID: to.Ptr("c487e7d1-3210-41a3-8ccc-e9372b78da47"), - // }, - // { - // ObjectID: to.Ptr("5b307da8-43d4-492b-8b66-b0294ade872f"), - // }}, - // AuthenticationConfiguration: &armhealthcareapis.ServiceAuthenticationConfigurationInfo{ - // Audience: to.Ptr("https://azurehealthcareapis.com"), - // Authority: to.Ptr("https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc"), - // SmartProxyEnabled: to.Ptr(true), - // }, - // CorsConfiguration: &armhealthcareapis.ServiceCorsConfigurationInfo{ - // AllowCredentials: to.Ptr(false), - // Headers: []*string{ - // to.Ptr("*")}, - // MaxAge: to.Ptr[int32](1440), - // Methods: []*string{ - // to.Ptr("DELETE"), - // to.Ptr("GET"), - // to.Ptr("OPTIONS"), - // to.Ptr("PATCH"), - // to.Ptr("POST"), - // to.Ptr("PUT")}, - // Origins: []*string{ - // to.Ptr("*")}, - // }, - // CosmosDbConfiguration: &armhealthcareapis.ServiceCosmosDbConfigurationInfo{ - // KeyVaultKeyURI: to.Ptr("https://my-vault.vault.azure.net/keys/my-key"), - // OfferThroughput: to.Ptr[int32](1000), - // }, - // ExportConfiguration: &armhealthcareapis.ServiceExportConfigurationInfo{ - // StorageAccountName: to.Ptr("existingStorageAccount"), - // }, - // PrivateEndpointConnections: []*armhealthcareapis.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armhealthcareapis.PublicNetworkAccessDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceCreateMinimum.json -func ExampleServicesClient_BeginCreateOrUpdate_createOrUpdateAServiceWithMinimumParameters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "service2", armhealthcareapis.ServicesDescription{ - Kind: to.Ptr(armhealthcareapis.KindFhirR4), - Location: to.Ptr("westus2"), - Tags: map[string]*string{}, - Properties: &armhealthcareapis.ServicesProperties{ - AccessPolicies: []*armhealthcareapis.ServiceAccessPolicyEntry{ - { - ObjectID: to.Ptr("c487e7d1-3210-41a3-8ccc-e9372b78da47"), - }}, - }, - }, 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.ServicesDescription = armhealthcareapis.ServicesDescription{ - // Name: to.Ptr("service2"), - // Type: to.Ptr("Microsoft.HealthcareApis/services"), - // Etag: to.Ptr("etagvalue"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HealthcareApis/services/service2"), - // Kind: to.Ptr(armhealthcareapis.KindFhirR4), - // Location: to.Ptr("westus2"), - // Tags: map[string]*string{ - // }, - // Properties: &armhealthcareapis.ServicesProperties{ - // AccessPolicies: []*armhealthcareapis.ServiceAccessPolicyEntry{ - // { - // ObjectID: to.Ptr("c487e7d1-3210-41a3-8ccc-e9372b78da47"), - // }}, - // AuthenticationConfiguration: &armhealthcareapis.ServiceAuthenticationConfigurationInfo{ - // Audience: to.Ptr("https://azurehealthcareapis.com"), - // Authority: to.Ptr("https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc"), - // SmartProxyEnabled: to.Ptr(false), - // }, - // CorsConfiguration: &armhealthcareapis.ServiceCorsConfigurationInfo{ - // AllowCredentials: to.Ptr(false), - // Headers: []*string{ - // }, - // Methods: []*string{ - // }, - // Origins: []*string{ - // }, - // }, - // CosmosDbConfiguration: &armhealthcareapis.ServiceCosmosDbConfigurationInfo{ - // OfferThroughput: to.Ptr[int32](1000), - // }, - // PrivateEndpointConnections: []*armhealthcareapis.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armhealthcareapis.PublicNetworkAccessDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServicePatch.json -func ExampleServicesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginUpdate(ctx, "rg1", "service1", armhealthcareapis.ServicesPatchDescription{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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.ServicesDescription = armhealthcareapis.ServicesDescription{ - // Name: to.Ptr("service1"), - // Type: to.Ptr("Microsoft.HealthcareApis/services"), - // Etag: to.Ptr("etagvalue"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HealthcareApis/services/service1"), - // Kind: to.Ptr(armhealthcareapis.KindFhirR4), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armhealthcareapis.ServicesProperties{ - // AccessPolicies: []*armhealthcareapis.ServiceAccessPolicyEntry{ - // { - // ObjectID: to.Ptr("c487e7d1-3210-41a3-8ccc-e9372b78da47"), - // }, - // { - // ObjectID: to.Ptr("5b307da8-43d4-492b-8b66-b0294ade872f"), - // }}, - // AuthenticationConfiguration: &armhealthcareapis.ServiceAuthenticationConfigurationInfo{ - // Audience: to.Ptr("https://azurehealthcareapis.com"), - // Authority: to.Ptr("https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc"), - // SmartProxyEnabled: to.Ptr(true), - // }, - // CorsConfiguration: &armhealthcareapis.ServiceCorsConfigurationInfo{ - // AllowCredentials: to.Ptr(false), - // Headers: []*string{ - // to.Ptr("*")}, - // MaxAge: to.Ptr[int32](1440), - // Methods: []*string{ - // to.Ptr("DELETE"), - // to.Ptr("GET"), - // to.Ptr("OPTIONS"), - // to.Ptr("PATCH"), - // to.Ptr("POST"), - // to.Ptr("PUT")}, - // Origins: []*string{ - // to.Ptr("*")}, - // }, - // CosmosDbConfiguration: &armhealthcareapis.ServiceCosmosDbConfigurationInfo{ - // KeyVaultKeyURI: to.Ptr("https://my-vault.vault.azure.net/keys/my-key"), - // OfferThroughput: to.Ptr[int32](1000), - // }, - // PrivateEndpointConnections: []*armhealthcareapis.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armhealthcareapis.PublicNetworkAccessDisabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceDelete.json -func ExampleServicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginDelete(ctx, "rg1", "service1", 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceList.json -func ExampleServicesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServicesClient().NewListPager(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.ServicesDescriptionListResult = armhealthcareapis.ServicesDescriptionListResult{ - // Value: []*armhealthcareapis.ServicesDescription{ - // { - // Name: to.Ptr("service1"), - // Type: to.Ptr("Microsoft.HealthcareApis/services"), - // Etag: to.Ptr("etag"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HealthcareApis/services/service1"), - // Kind: to.Ptr(armhealthcareapis.KindFhirR4), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Properties: &armhealthcareapis.ServicesProperties{ - // AccessPolicies: []*armhealthcareapis.ServiceAccessPolicyEntry{ - // { - // ObjectID: to.Ptr("c487e7d1-3210-41a3-8ccc-e9372b78da47"), - // }, - // { - // ObjectID: to.Ptr("5b307da8-43d4-492b-8b66-b0294ade872f"), - // }}, - // AuthenticationConfiguration: &armhealthcareapis.ServiceAuthenticationConfigurationInfo{ - // Audience: to.Ptr("https://azurehealthcareapis.com"), - // Authority: to.Ptr("https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc"), - // SmartProxyEnabled: to.Ptr(true), - // }, - // CorsConfiguration: &armhealthcareapis.ServiceCorsConfigurationInfo{ - // AllowCredentials: to.Ptr(false), - // Headers: []*string{ - // to.Ptr("*")}, - // MaxAge: to.Ptr[int32](1440), - // Methods: []*string{ - // to.Ptr("DELETE"), - // to.Ptr("GET"), - // to.Ptr("OPTIONS"), - // to.Ptr("PATCH"), - // to.Ptr("POST"), - // to.Ptr("PUT")}, - // Origins: []*string{ - // to.Ptr("*")}, - // }, - // CosmosDbConfiguration: &armhealthcareapis.ServiceCosmosDbConfigurationInfo{ - // KeyVaultKeyURI: to.Ptr("https://my-vault.vault.azure.net/keys/my-key"), - // OfferThroughput: to.Ptr[int32](1000), - // }, - // PrivateEndpointConnections: []*armhealthcareapis.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armhealthcareapis.PublicNetworkAccessDisabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceListByResourceGroup.json -func ExampleServicesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServicesClient().NewListByResourceGroupPager("rgname", 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.ServicesDescriptionListResult = armhealthcareapis.ServicesDescriptionListResult{ - // Value: []*armhealthcareapis.ServicesDescription{ - // { - // Name: to.Ptr("service1"), - // Type: to.Ptr("Microsoft.HealthcareApis/services"), - // Etag: to.Ptr("etagvalue"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HealthcareApis/services/dddb8dcb-effb-4290-bb47-ce1e8440c729"), - // Kind: to.Ptr(armhealthcareapis.KindFhirR4), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armhealthcareapis.ServicesProperties{ - // AccessPolicies: []*armhealthcareapis.ServiceAccessPolicyEntry{ - // { - // ObjectID: to.Ptr("c487e7d1-3210-41a3-8ccc-e9372b78da47"), - // }, - // { - // ObjectID: to.Ptr("5b307da8-43d4-492b-8b66-b0294ade872f"), - // }}, - // AuthenticationConfiguration: &armhealthcareapis.ServiceAuthenticationConfigurationInfo{ - // Audience: to.Ptr("https://azurehealthcareapis.com"), - // Authority: to.Ptr("https://login.microsoftonline.com/abfde7b2-df0f-47e6-aabf-2462b07508dc"), - // SmartProxyEnabled: to.Ptr(true), - // }, - // CorsConfiguration: &armhealthcareapis.ServiceCorsConfigurationInfo{ - // AllowCredentials: to.Ptr(false), - // Headers: []*string{ - // to.Ptr("*")}, - // MaxAge: to.Ptr[int32](1440), - // Methods: []*string{ - // to.Ptr("DELETE"), - // to.Ptr("GET"), - // to.Ptr("OPTIONS"), - // to.Ptr("PATCH"), - // to.Ptr("POST"), - // to.Ptr("PUT")}, - // Origins: []*string{ - // to.Ptr("*")}, - // }, - // CosmosDbConfiguration: &armhealthcareapis.ServiceCosmosDbConfigurationInfo{ - // KeyVaultKeyURI: to.Ptr("https://my-vault.vault.azure.net/keys/my-key"), - // OfferThroughput: to.Ptr[int32](1000), - // }, - // PrivateEndpointConnections: []*armhealthcareapis.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armhealthcareapis.PublicNetworkAccessDisabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/CheckNameAvailabilityPost.json -func ExampleServicesClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().CheckNameAvailability(ctx, armhealthcareapis.CheckNameAvailabilityParameters{ - Name: to.Ptr("serviceName"), - Type: to.Ptr("Microsoft.HealthcareApis/services"), - }, 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.ServicesNameAvailabilityInfo = armhealthcareapis.ServicesNameAvailabilityInfo{ - // Message: to.Ptr("Service name is not available."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr(armhealthcareapis.ServiceNameUnavailabilityReasonAlreadyExists), - // } -} diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/time_rfc3339.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/time_rfc3339.go index c5f42f9dced6..380f0b05e249 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/time_rfc3339.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/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 armhealthcareapis diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaceprivateendpointconnections_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaceprivateendpointconnections_client.go index 1976b9bd8330..3fb705cea923 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaceprivateendpointconnections_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaceprivateendpointconnections_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 armhealthcareapis @@ -29,7 +28,7 @@ type WorkspacePrivateEndpointConnectionsClient struct { } // NewWorkspacePrivateEndpointConnectionsClient creates a new instance of WorkspacePrivateEndpointConnectionsClient with the specified values. -// - subscriptionID - The subscription identifier. +// - 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 NewWorkspacePrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkspacePrivateEndpointConnectionsClient, error) { @@ -47,7 +46,7 @@ func NewWorkspacePrivateEndpointConnectionsClient(subscriptionID string, credent // BeginCreateOrUpdate - Update the state of the specified private endpoint connection associated with the workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource @@ -60,7 +59,8 @@ func (client *WorkspacePrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx if err != nil { return nil, err } - return runtime.NewPoller[WorkspacePrivateEndpointConnectionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[WorkspacePrivateEndpointConnectionsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[WorkspacePrivateEndpointConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -69,20 +69,22 @@ func (client *WorkspacePrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx // CreateOrUpdate - Update the state of the specified private endpoint connection associated with the workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *WorkspacePrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, properties PrivateEndpointConnectionDescription, options *WorkspacePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, properties, 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) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -109,16 +111,19 @@ func (client *WorkspacePrivateEndpointConnectionsClient) createOrUpdateCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, properties) + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource @@ -130,7 +135,8 @@ func (client *WorkspacePrivateEndpointConnectionsClient) BeginDelete(ctx context if err != nil { return nil, err } - return runtime.NewPoller[WorkspacePrivateEndpointConnectionsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[WorkspacePrivateEndpointConnectionsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[WorkspacePrivateEndpointConnectionsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -139,20 +145,22 @@ func (client *WorkspacePrivateEndpointConnectionsClient) BeginDelete(ctx context // Delete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *WorkspacePrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *WorkspacePrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, 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 +187,7 @@ func (client *WorkspacePrivateEndpointConnectionsClient) deleteCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,25 +196,28 @@ func (client *WorkspacePrivateEndpointConnectionsClient) deleteCreateRequest(ctx // Get - Gets the specified private endpoint connection associated with the workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource // - options - WorkspacePrivateEndpointConnectionsClientGetOptions contains the optional parameters for the WorkspacePrivateEndpointConnectionsClient.Get // method. func (client *WorkspacePrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *WorkspacePrivateEndpointConnectionsClientGetOptions) (WorkspacePrivateEndpointConnectionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, options) if err != nil { return WorkspacePrivateEndpointConnectionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return WorkspacePrivateEndpointConnectionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkspacePrivateEndpointConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkspacePrivateEndpointConnectionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -233,7 +244,7 @@ func (client *WorkspacePrivateEndpointConnectionsClient) getCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +261,7 @@ func (client *WorkspacePrivateEndpointConnectionsClient) getHandleResponse(resp // NewListByWorkspacePager - Lists all private endpoint connections for a workspace. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - options - WorkspacePrivateEndpointConnectionsClientListByWorkspaceOptions contains the optional parameters for the WorkspacePrivateEndpointConnectionsClient.NewListByWorkspacePager @@ -297,7 +308,7 @@ func (client *WorkspacePrivateEndpointConnectionsClient) listByWorkspaceCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaceprivateendpointconnections_client_example_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaceprivateendpointconnections_client_example_test.go deleted file mode 100644 index bedf3256e2a1..000000000000 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaceprivateendpointconnections_client_example_test.go +++ /dev/null @@ -1,165 +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 armhealthcareapis_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/healthcareapis/armhealthcareapis" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspaceListPrivateEndpointConnections.json -func ExampleWorkspacePrivateEndpointConnectionsClient_NewListByWorkspacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkspacePrivateEndpointConnectionsClient().NewListByWorkspacePager("testRG", "workspace1", 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.PrivateEndpointConnectionListResultDescription = armhealthcareapis.PrivateEndpointConnectionListResultDescription{ - // Value: []*armhealthcareapis.PrivateEndpointConnectionDescription{ - // { - // Name: to.Ptr("myConnection"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HealthcareApis/workspaces/workspace1/privateEndpointConnections/myConnection"), - // Properties: &armhealthcareapis.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhealthcareapis.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/peexample01"), - // }, - // PrivateLinkServiceConnectionState: &armhealthcareapis.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armhealthcareapis.PrivateEndpointServiceConnectionStatusApproved), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspaceGetPrivateEndpointConnection.json -func ExampleWorkspacePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacePrivateEndpointConnectionsClient().Get(ctx, "testRG", "workspace1", "myConnection", 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.PrivateEndpointConnectionDescription = armhealthcareapis.PrivateEndpointConnectionDescription{ - // Name: to.Ptr("myConnection"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HealthcareApis/workspaces/workspace1/privateEndpointConnections/myConnection"), - // Properties: &armhealthcareapis.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhealthcareapis.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/peexample01"), - // }, - // PrivateLinkServiceConnectionState: &armhealthcareapis.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armhealthcareapis.PrivateEndpointServiceConnectionStatusApproved), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspaceCreatePrivateEndpointConnection.json -func ExampleWorkspacePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkspacePrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "testRG", "workspace1", "myConnection", armhealthcareapis.PrivateEndpointConnectionDescription{ - Properties: &armhealthcareapis.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armhealthcareapis.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Auto-Approved"), - Status: to.Ptr(armhealthcareapis.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, 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.PrivateEndpointConnectionDescription = armhealthcareapis.PrivateEndpointConnectionDescription{ - // Name: to.Ptr("myConnection"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HealthcareApis/workspaces/workspace1/privateEndpointConnections/myConnection"), - // Properties: &armhealthcareapis.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armhealthcareapis.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/c80fb759-c965-4c6a-9110-9b2b2d038882/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/peexample01"), - // }, - // PrivateLinkServiceConnectionState: &armhealthcareapis.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armhealthcareapis.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armhealthcareapis.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspaceDeletePrivateEndpointConnection.json -func ExampleWorkspacePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkspacePrivateEndpointConnectionsClient().BeginDelete(ctx, "testRG", "workspace1", "myConnection", 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) - } -} diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaceprivatelinkresources_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaceprivatelinkresources_client.go index a1bf787f8714..bd1010d1562a 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaceprivatelinkresources_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaceprivatelinkresources_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 armhealthcareapis @@ -29,7 +28,7 @@ type WorkspacePrivateLinkResourcesClient struct { } // NewWorkspacePrivateLinkResourcesClient creates a new instance of WorkspacePrivateLinkResourcesClient with the specified values. -// - subscriptionID - The subscription identifier. +// - 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 NewWorkspacePrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkspacePrivateLinkResourcesClient, error) { @@ -47,25 +46,28 @@ func NewWorkspacePrivateLinkResourcesClient(subscriptionID string, credential az // Get - Gets a private link resource that need to be created for a workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - groupName - The name of the private link resource group. // - options - WorkspacePrivateLinkResourcesClientGetOptions contains the optional parameters for the WorkspacePrivateLinkResourcesClient.Get // method. func (client *WorkspacePrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, groupName string, options *WorkspacePrivateLinkResourcesClientGetOptions) (WorkspacePrivateLinkResourcesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, groupName, options) if err != nil { return WorkspacePrivateLinkResourcesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return WorkspacePrivateLinkResourcesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkspacePrivateLinkResourcesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkspacePrivateLinkResourcesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -92,7 +94,7 @@ func (client *WorkspacePrivateLinkResourcesClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,7 +111,7 @@ func (client *WorkspacePrivateLinkResourcesClient) getHandleResponse(resp *http. // NewListByWorkspacePager - Gets the private link resources that need to be created for a workspace. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - options - WorkspacePrivateLinkResourcesClientListByWorkspaceOptions contains the optional parameters for the WorkspacePrivateLinkResourcesClient.NewListByWorkspacePager @@ -156,7 +158,7 @@ func (client *WorkspacePrivateLinkResourcesClient) listByWorkspaceCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaceprivatelinkresources_client_example_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaceprivatelinkresources_client_example_test.go deleted file mode 100644 index e10203a07c6a..000000000000 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaceprivatelinkresources_client_example_test.go +++ /dev/null @@ -1,94 +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 armhealthcareapis_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/PrivateLinkResourcesListByWorkspace.json -func ExampleWorkspacePrivateLinkResourcesClient_NewListByWorkspacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkspacePrivateLinkResourcesClient().NewListByWorkspacePager("testRG", "workspace1", 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.PrivateLinkResourceListResultDescription = armhealthcareapis.PrivateLinkResourceListResultDescription{ - // Value: []*armhealthcareapis.PrivateLinkResourceDescription{ - // { - // Name: to.Ptr("healthcareworkspace"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/privateLinkResources"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HealthcareApis/workspaces/workspace1/privateLinkResources/healthcareworkspace"), - // Properties: &armhealthcareapis.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("healthcareworkspace"), - // RequiredMembers: []*string{ - // to.Ptr("fhirservices"), - // to.Ptr("dicomservices")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.fhir.azurehealthcareapis.com"), - // to.Ptr("privatelink.dicom.azurehealthcareapis.com")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspacePrivateLinkResourceGet.json -func ExampleWorkspacePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacePrivateLinkResourcesClient().Get(ctx, "testRG", "workspace1", "healthcareworkspace", 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.PrivateLinkResourceDescription = armhealthcareapis.PrivateLinkResourceDescription{ - // Name: to.Ptr("fhir"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces/privateLinkResources"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.HealthcareApis/workspaces/workspace1/privateLinkResources/fhir"), - // Properties: &armhealthcareapis.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("healthcareworkspace"), - // RequiredMembers: []*string{ - // to.Ptr("fhirservices"), - // to.Ptr("dicomservices")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.fhir.azurehealthcareapis.com"), - // to.Ptr("privatelink.dicom.azurehealthcareapis.com")}, - // }, - // } -} diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaces_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaces_client.go index d48342a17787..990d9d184845 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaces_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaces_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 armhealthcareapis @@ -29,7 +28,7 @@ type WorkspacesClient struct { } // NewWorkspacesClient creates a new instance of WorkspacesClient with the specified values. -// - subscriptionID - The subscription identifier. +// - 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 NewWorkspacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkspacesClient, error) { @@ -47,7 +46,7 @@ func NewWorkspacesClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Creates or updates a workspace resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - workspace - The parameters for creating or updating a healthcare workspace. @@ -59,7 +58,8 @@ func (client *WorkspacesClient) BeginCreateOrUpdate(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller[WorkspacesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[WorkspacesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[WorkspacesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -68,20 +68,22 @@ func (client *WorkspacesClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates a workspace resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *WorkspacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, workspace Workspace, options *WorkspacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, workspace, 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. @@ -104,16 +106,19 @@ func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, workspace) + if err := runtime.MarshalAsJSON(req, workspace); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Deletes a specified workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - options - WorkspacesClientBeginDeleteOptions contains the optional parameters for the WorkspacesClient.BeginDelete method. @@ -123,7 +128,8 @@ func (client *WorkspacesClient) BeginDelete(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller[WorkspacesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[WorkspacesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[WorkspacesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -132,20 +138,22 @@ func (client *WorkspacesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes a specified workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *WorkspacesClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, 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. @@ -168,7 +176,7 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -177,23 +185,26 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets the properties of the specified workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - options - WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method. func (client *WorkspacesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientGetOptions) (WorkspacesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, options) if err != nil { return WorkspacesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return WorkspacesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkspacesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkspacesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -216,7 +227,7 @@ func (client *WorkspacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -233,7 +244,7 @@ func (client *WorkspacesClient) getHandleResponse(resp *http.Response) (Workspac // NewListByResourceGroupPager - Lists all the available workspaces under the specified resource group. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - options - WorkspacesClientListByResourceGroupOptions contains the optional parameters for the WorkspacesClient.NewListByResourceGroupPager // method. @@ -281,7 +292,7 @@ func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -298,7 +309,7 @@ func (client *WorkspacesClient) listByResourceGroupHandleResponse(resp *http.Res // NewListBySubscriptionPager - Lists all the available workspaces under the specified subscription. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - options - WorkspacesClientListBySubscriptionOptions contains the optional parameters for the WorkspacesClient.NewListBySubscriptionPager // method. func (client *WorkspacesClient) NewListBySubscriptionPager(options *WorkspacesClientListBySubscriptionOptions) *runtime.Pager[WorkspacesClientListBySubscriptionResponse] { @@ -341,7 +352,7 @@ func (client *WorkspacesClient) listBySubscriptionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -359,7 +370,7 @@ func (client *WorkspacesClient) listBySubscriptionHandleResponse(resp *http.Resp // BeginUpdate - Patch workspace details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 // - resourceGroupName - The name of the resource group that contains the service instance. // - workspaceName - The name of workspace resource. // - workspacePatchResource - The parameters for updating a specified workspace. @@ -370,7 +381,8 @@ func (client *WorkspacesClient) BeginUpdate(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller[WorkspacesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[WorkspacesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[WorkspacesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -379,20 +391,22 @@ func (client *WorkspacesClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Patch workspace details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2021-11-01 +// Generated from API version 2023-09-06 func (client *WorkspacesClient) update(ctx context.Context, resourceGroupName string, workspaceName string, workspacePatchResource WorkspacePatchResource, options *WorkspacesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, workspacePatchResource, 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. @@ -415,8 +429,11 @@ func (client *WorkspacesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2023-09-06") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, workspacePatchResource) + if err := runtime.MarshalAsJSON(req, workspacePatchResource); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaces_client_example_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaces_client_example_test.go deleted file mode 100644 index c1334a4b31d4..000000000000 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/workspaces_client_example_test.go +++ /dev/null @@ -1,219 +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 armhealthcareapis_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/healthcareapis/armhealthcareapis" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_ListBySubscription.json -func ExampleWorkspacesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkspacesClient().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.WorkspaceList = armhealthcareapis.WorkspaceList{ - // Value: []*armhealthcareapis.Workspace{ - // { - // Name: to.Ptr("workspace1"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1"), - // Location: to.Ptr("eastus"), - // Properties: &armhealthcareapis.WorkspaceProperties{ - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_ListByResourceGroup.json -func ExampleWorkspacesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkspacesClient().NewListByResourceGroupPager("testRG", 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.WorkspaceList = armhealthcareapis.WorkspaceList{ - // Value: []*armhealthcareapis.Workspace{ - // { - // Name: to.Ptr("workspace1"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1"), - // Location: to.Ptr("eastus"), - // Properties: &armhealthcareapis.WorkspaceProperties{ - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_Get.json -func ExampleWorkspacesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().Get(ctx, "testRG", "workspace1", 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.Workspace = armhealthcareapis.Workspace{ - // Name: to.Ptr("workspace1"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1"), - // Location: to.Ptr("westus"), - // Properties: &armhealthcareapis.WorkspaceProperties{ - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_Create.json -func ExampleWorkspacesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkspacesClient().BeginCreateOrUpdate(ctx, "testRG", "workspace1", armhealthcareapis.Workspace{ - Location: to.Ptr("westus"), - Properties: &armhealthcareapis.WorkspaceProperties{}, - }, 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.Workspace = armhealthcareapis.Workspace{ - // Name: to.Ptr("workspace1"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1"), - // Location: to.Ptr("westus"), - // Properties: &armhealthcareapis.WorkspaceProperties{ - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_Patch.json -func ExampleWorkspacesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkspacesClient().BeginUpdate(ctx, "testRG", "workspace1", armhealthcareapis.WorkspacePatchResource{ - Tags: map[string]*string{ - "tagKey": to.Ptr("tagValue"), - }, - }, 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.Workspace = armhealthcareapis.Workspace{ - // Name: to.Ptr("workspace1"), - // Type: to.Ptr("Microsoft.HealthcareApis/workspaces"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tagKey": to.Ptr("tagValue"), - // }, - // Properties: &armhealthcareapis.WorkspaceProperties{ - // ProvisioningState: to.Ptr(armhealthcareapis.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_Delete.json -func ExampleWorkspacesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armhealthcareapis.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewWorkspacesClient().BeginDelete(ctx, "testRG", "workspace1", 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) - } -}