diff --git a/profiles/latest/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go b/profiles/latest/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go new file mode 100644 index 000000000000..ebd9615bd1ab --- /dev/null +++ b/profiles/latest/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go @@ -0,0 +1,26 @@ +// +build go1.9 + +// Copyright 2019 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/tools/profileBuilder + +package healthcareapisapi + +import original "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2019-09-16/healthcareapis/healthcareapisapi" + +type OperationResultsClientAPI = original.OperationResultsClientAPI +type OperationsClientAPI = original.OperationsClientAPI +type ServicesClientAPI = original.ServicesClientAPI diff --git a/profiles/latest/healthcareapis/mgmt/healthcareapis/models.go b/profiles/latest/healthcareapis/mgmt/healthcareapis/models.go new file mode 100644 index 000000000000..0018a473de12 --- /dev/null +++ b/profiles/latest/healthcareapis/mgmt/healthcareapis/models.go @@ -0,0 +1,154 @@ +// +build go1.9 + +// Copyright 2019 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/tools/profileBuilder + +package healthcareapis + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2019-09-16/healthcareapis" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type Kind = original.Kind + +const ( + Fhir Kind = original.Fhir + FhirR4 Kind = original.FhirR4 + FhirStu3 Kind = original.FhirStu3 +) + +type OperationResultStatus = original.OperationResultStatus + +const ( + Canceled OperationResultStatus = original.Canceled + Failed OperationResultStatus = original.Failed + Requested OperationResultStatus = original.Requested + Running OperationResultStatus = original.Running + Succeeded OperationResultStatus = original.Succeeded +) + +type ProvisioningState = original.ProvisioningState + +const ( + ProvisioningStateAccepted ProvisioningState = original.ProvisioningStateAccepted + ProvisioningStateCanceled ProvisioningState = original.ProvisioningStateCanceled + ProvisioningStateCreating ProvisioningState = original.ProvisioningStateCreating + ProvisioningStateDeleting ProvisioningState = original.ProvisioningStateDeleting + ProvisioningStateDeprovisioned ProvisioningState = original.ProvisioningStateDeprovisioned + ProvisioningStateFailed ProvisioningState = original.ProvisioningStateFailed + ProvisioningStateSucceeded ProvisioningState = original.ProvisioningStateSucceeded + ProvisioningStateUpdating ProvisioningState = original.ProvisioningStateUpdating + ProvisioningStateVerifying ProvisioningState = original.ProvisioningStateVerifying +) + +type ServiceNameUnavailabilityReason = original.ServiceNameUnavailabilityReason + +const ( + AlreadyExists ServiceNameUnavailabilityReason = original.AlreadyExists + Invalid ServiceNameUnavailabilityReason = original.Invalid +) + +type BaseClient = original.BaseClient +type CheckNameAvailabilityParameters = original.CheckNameAvailabilityParameters +type ErrorDetails = original.ErrorDetails +type ErrorDetailsInternal = original.ErrorDetailsInternal +type Operation = original.Operation +type OperationDisplay = original.OperationDisplay +type OperationListResult = original.OperationListResult +type OperationListResultIterator = original.OperationListResultIterator +type OperationListResultPage = original.OperationListResultPage +type OperationResultsClient = original.OperationResultsClient +type OperationResultsDescription = original.OperationResultsDescription +type OperationsClient = original.OperationsClient +type Resource = original.Resource +type ServiceAccessPolicyEntry = original.ServiceAccessPolicyEntry +type ServiceAuthenticationConfigurationInfo = original.ServiceAuthenticationConfigurationInfo +type ServiceCorsConfigurationInfo = original.ServiceCorsConfigurationInfo +type ServiceCosmosDbConfigurationInfo = original.ServiceCosmosDbConfigurationInfo +type ServicesClient = original.ServicesClient +type ServicesCreateOrUpdateFuture = original.ServicesCreateOrUpdateFuture +type ServicesDeleteFuture = original.ServicesDeleteFuture +type ServicesDescription = original.ServicesDescription +type ServicesDescriptionListResult = original.ServicesDescriptionListResult +type ServicesDescriptionListResultIterator = original.ServicesDescriptionListResultIterator +type ServicesDescriptionListResultPage = original.ServicesDescriptionListResultPage +type ServicesNameAvailabilityInfo = original.ServicesNameAvailabilityInfo +type ServicesPatchDescription = original.ServicesPatchDescription +type ServicesProperties = original.ServicesProperties +type ServicesUpdateFuture = original.ServicesUpdateFuture +type SetObject = original.SetObject + +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) +} +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return original.NewOperationListResultIterator(page) +} +func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return original.NewOperationListResultPage(getNextPage) +} +func NewOperationResultsClient(subscriptionID string) OperationResultsClient { + return original.NewOperationResultsClient(subscriptionID) +} +func NewOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) OperationResultsClient { + return original.NewOperationResultsClientWithBaseURI(baseURI, subscriptionID) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewServicesClient(subscriptionID string) ServicesClient { + return original.NewServicesClient(subscriptionID) +} +func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient { + return original.NewServicesClientWithBaseURI(baseURI, subscriptionID) +} +func NewServicesDescriptionListResultIterator(page ServicesDescriptionListResultPage) ServicesDescriptionListResultIterator { + return original.NewServicesDescriptionListResultIterator(page) +} +func NewServicesDescriptionListResultPage(getNextPage func(context.Context, ServicesDescriptionListResult) (ServicesDescriptionListResult, error)) ServicesDescriptionListResultPage { + return original.NewServicesDescriptionListResultPage(getNextPage) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleKindValues() []Kind { + return original.PossibleKindValues() +} +func PossibleOperationResultStatusValues() []OperationResultStatus { + return original.PossibleOperationResultStatusValues() +} +func PossibleProvisioningStateValues() []ProvisioningState { + return original.PossibleProvisioningStateValues() +} +func PossibleServiceNameUnavailabilityReasonValues() []ServiceNameUnavailabilityReason { + return original.PossibleServiceNameUnavailabilityReasonValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/latest" +} +func Version() string { + return original.Version() +} diff --git a/profiles/preview/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go b/profiles/preview/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go new file mode 100644 index 000000000000..ebd9615bd1ab --- /dev/null +++ b/profiles/preview/healthcareapis/mgmt/healthcareapis/healthcareapisapi/models.go @@ -0,0 +1,26 @@ +// +build go1.9 + +// Copyright 2019 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/tools/profileBuilder + +package healthcareapisapi + +import original "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2019-09-16/healthcareapis/healthcareapisapi" + +type OperationResultsClientAPI = original.OperationResultsClientAPI +type OperationsClientAPI = original.OperationsClientAPI +type ServicesClientAPI = original.ServicesClientAPI diff --git a/profiles/preview/healthcareapis/mgmt/healthcareapis/models.go b/profiles/preview/healthcareapis/mgmt/healthcareapis/models.go new file mode 100644 index 000000000000..13f5929787eb --- /dev/null +++ b/profiles/preview/healthcareapis/mgmt/healthcareapis/models.go @@ -0,0 +1,154 @@ +// +build go1.9 + +// Copyright 2019 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/tools/profileBuilder + +package healthcareapis + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2019-09-16/healthcareapis" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type Kind = original.Kind + +const ( + Fhir Kind = original.Fhir + FhirR4 Kind = original.FhirR4 + FhirStu3 Kind = original.FhirStu3 +) + +type OperationResultStatus = original.OperationResultStatus + +const ( + Canceled OperationResultStatus = original.Canceled + Failed OperationResultStatus = original.Failed + Requested OperationResultStatus = original.Requested + Running OperationResultStatus = original.Running + Succeeded OperationResultStatus = original.Succeeded +) + +type ProvisioningState = original.ProvisioningState + +const ( + ProvisioningStateAccepted ProvisioningState = original.ProvisioningStateAccepted + ProvisioningStateCanceled ProvisioningState = original.ProvisioningStateCanceled + ProvisioningStateCreating ProvisioningState = original.ProvisioningStateCreating + ProvisioningStateDeleting ProvisioningState = original.ProvisioningStateDeleting + ProvisioningStateDeprovisioned ProvisioningState = original.ProvisioningStateDeprovisioned + ProvisioningStateFailed ProvisioningState = original.ProvisioningStateFailed + ProvisioningStateSucceeded ProvisioningState = original.ProvisioningStateSucceeded + ProvisioningStateUpdating ProvisioningState = original.ProvisioningStateUpdating + ProvisioningStateVerifying ProvisioningState = original.ProvisioningStateVerifying +) + +type ServiceNameUnavailabilityReason = original.ServiceNameUnavailabilityReason + +const ( + AlreadyExists ServiceNameUnavailabilityReason = original.AlreadyExists + Invalid ServiceNameUnavailabilityReason = original.Invalid +) + +type BaseClient = original.BaseClient +type CheckNameAvailabilityParameters = original.CheckNameAvailabilityParameters +type ErrorDetails = original.ErrorDetails +type ErrorDetailsInternal = original.ErrorDetailsInternal +type Operation = original.Operation +type OperationDisplay = original.OperationDisplay +type OperationListResult = original.OperationListResult +type OperationListResultIterator = original.OperationListResultIterator +type OperationListResultPage = original.OperationListResultPage +type OperationResultsClient = original.OperationResultsClient +type OperationResultsDescription = original.OperationResultsDescription +type OperationsClient = original.OperationsClient +type Resource = original.Resource +type ServiceAccessPolicyEntry = original.ServiceAccessPolicyEntry +type ServiceAuthenticationConfigurationInfo = original.ServiceAuthenticationConfigurationInfo +type ServiceCorsConfigurationInfo = original.ServiceCorsConfigurationInfo +type ServiceCosmosDbConfigurationInfo = original.ServiceCosmosDbConfigurationInfo +type ServicesClient = original.ServicesClient +type ServicesCreateOrUpdateFuture = original.ServicesCreateOrUpdateFuture +type ServicesDeleteFuture = original.ServicesDeleteFuture +type ServicesDescription = original.ServicesDescription +type ServicesDescriptionListResult = original.ServicesDescriptionListResult +type ServicesDescriptionListResultIterator = original.ServicesDescriptionListResultIterator +type ServicesDescriptionListResultPage = original.ServicesDescriptionListResultPage +type ServicesNameAvailabilityInfo = original.ServicesNameAvailabilityInfo +type ServicesPatchDescription = original.ServicesPatchDescription +type ServicesProperties = original.ServicesProperties +type ServicesUpdateFuture = original.ServicesUpdateFuture +type SetObject = original.SetObject + +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) +} +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return original.NewOperationListResultIterator(page) +} +func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return original.NewOperationListResultPage(getNextPage) +} +func NewOperationResultsClient(subscriptionID string) OperationResultsClient { + return original.NewOperationResultsClient(subscriptionID) +} +func NewOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) OperationResultsClient { + return original.NewOperationResultsClientWithBaseURI(baseURI, subscriptionID) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewServicesClient(subscriptionID string) ServicesClient { + return original.NewServicesClient(subscriptionID) +} +func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient { + return original.NewServicesClientWithBaseURI(baseURI, subscriptionID) +} +func NewServicesDescriptionListResultIterator(page ServicesDescriptionListResultPage) ServicesDescriptionListResultIterator { + return original.NewServicesDescriptionListResultIterator(page) +} +func NewServicesDescriptionListResultPage(getNextPage func(context.Context, ServicesDescriptionListResult) (ServicesDescriptionListResult, error)) ServicesDescriptionListResultPage { + return original.NewServicesDescriptionListResultPage(getNextPage) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleKindValues() []Kind { + return original.PossibleKindValues() +} +func PossibleOperationResultStatusValues() []OperationResultStatus { + return original.PossibleOperationResultStatusValues() +} +func PossibleProvisioningStateValues() []ProvisioningState { + return original.PossibleProvisioningStateValues() +} +func PossibleServiceNameUnavailabilityReasonValues() []ServiceNameUnavailabilityReason { + return original.PossibleServiceNameUnavailabilityReasonValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/preview" +} +func Version() string { + return original.Version() +} diff --git a/services/healthcareapis/mgmt/2019-09-16/healthcareapis/client.go b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/client.go new file mode 100644 index 000000000000..c2bd63627422 --- /dev/null +++ b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/client.go @@ -0,0 +1,51 @@ +// Package healthcareapis implements the Azure ARM Healthcareapis service API version 2019-09-16. +// +// Azure Healthcare APIs Client +package healthcareapis + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Healthcareapis + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Healthcareapis. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client. +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/healthcareapis/mgmt/2019-09-16/healthcareapis/healthcareapisapi/interfaces.go b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/healthcareapisapi/interfaces.go new file mode 100644 index 000000000000..1d06a54548b2 --- /dev/null +++ b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/healthcareapisapi/interfaces.go @@ -0,0 +1,50 @@ +package healthcareapisapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2019-09-16/healthcareapis" +) + +// ServicesClientAPI contains the set of methods on the ServicesClient type. +type ServicesClientAPI interface { + CheckNameAvailability(ctx context.Context, checkNameAvailabilityInputs healthcareapis.CheckNameAvailabilityParameters) (result healthcareapis.ServicesNameAvailabilityInfo, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, serviceDescription healthcareapis.ServicesDescription) (result healthcareapis.ServicesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string) (result healthcareapis.ServicesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string) (result healthcareapis.ServicesDescription, err error) + List(ctx context.Context) (result healthcareapis.ServicesDescriptionListResultPage, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result healthcareapis.ServicesDescriptionListResultPage, err error) + Update(ctx context.Context, resourceGroupName string, resourceName string, servicePatchDescription healthcareapis.ServicesPatchDescription) (result healthcareapis.ServicesUpdateFuture, err error) +} + +var _ ServicesClientAPI = (*healthcareapis.ServicesClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result healthcareapis.OperationListResultPage, err error) +} + +var _ OperationsClientAPI = (*healthcareapis.OperationsClient)(nil) + +// OperationResultsClientAPI contains the set of methods on the OperationResultsClient type. +type OperationResultsClientAPI interface { + Get(ctx context.Context, locationName string, operationResultID string) (result healthcareapis.SetObject, err error) +} + +var _ OperationResultsClientAPI = (*healthcareapis.OperationResultsClient)(nil) diff --git a/services/healthcareapis/mgmt/2019-09-16/healthcareapis/models.go b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/models.go new file mode 100644 index 000000000000..23c268b77377 --- /dev/null +++ b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/models.go @@ -0,0 +1,708 @@ +package healthcareapis + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2019-09-16/healthcareapis" + +// Kind enumerates the values for kind. +type Kind string + +const ( + // Fhir ... + Fhir Kind = "fhir" + // FhirR4 ... + FhirR4 Kind = "fhir-R4" + // FhirStu3 ... + FhirStu3 Kind = "fhir-Stu3" +) + +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{Fhir, FhirR4, FhirStu3} +} + +// OperationResultStatus enumerates the values for operation result status. +type OperationResultStatus string + +const ( + // Canceled ... + Canceled OperationResultStatus = "Canceled" + // Failed ... + Failed OperationResultStatus = "Failed" + // Requested ... + Requested OperationResultStatus = "Requested" + // Running ... + Running OperationResultStatus = "Running" + // Succeeded ... + Succeeded OperationResultStatus = "Succeeded" +) + +// PossibleOperationResultStatusValues returns an array of possible values for the OperationResultStatus const type. +func PossibleOperationResultStatusValues() []OperationResultStatus { + return []OperationResultStatus{Canceled, Failed, Requested, Running, Succeeded} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateAccepted ... + ProvisioningStateAccepted ProvisioningState = "Accepted" + // ProvisioningStateCanceled ... + ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateCreating ... + ProvisioningStateCreating ProvisioningState = "Creating" + // ProvisioningStateDeleting ... + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateDeprovisioned ... + ProvisioningStateDeprovisioned ProvisioningState = "Deprovisioned" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUpdating ... + ProvisioningStateUpdating ProvisioningState = "Updating" + // ProvisioningStateVerifying ... + ProvisioningStateVerifying ProvisioningState = "Verifying" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateAccepted, ProvisioningStateCanceled, ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateDeprovisioned, ProvisioningStateFailed, ProvisioningStateSucceeded, ProvisioningStateUpdating, ProvisioningStateVerifying} +} + +// ServiceNameUnavailabilityReason enumerates the values for service name unavailability reason. +type ServiceNameUnavailabilityReason string + +const ( + // AlreadyExists ... + AlreadyExists ServiceNameUnavailabilityReason = "AlreadyExists" + // Invalid ... + Invalid ServiceNameUnavailabilityReason = "Invalid" +) + +// PossibleServiceNameUnavailabilityReasonValues returns an array of possible values for the ServiceNameUnavailabilityReason const type. +func PossibleServiceNameUnavailabilityReasonValues() []ServiceNameUnavailabilityReason { + return []ServiceNameUnavailabilityReason{AlreadyExists, Invalid} +} + +// CheckNameAvailabilityParameters input values. +type CheckNameAvailabilityParameters struct { + // Name - The name of the service instance to check. + Name *string `json:"name,omitempty"` + // Type - The fully qualified resource type which includes provider namespace. + Type *string `json:"type,omitempty"` +} + +// ErrorDetails error details. +type ErrorDetails struct { + // Error - Object containing error details. + Error *ErrorDetailsInternal `json:"error,omitempty"` +} + +// ErrorDetailsInternal error details. +type ErrorDetailsInternal struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The target of the particular error. + Target *string `json:"target,omitempty"` +} + +// Operation service REST API operation. +type Operation struct { + // Name - READ-ONLY; Operation name: {provider}/{resource}/{read | write | action | delete} + Name *string `json:"name,omitempty"` + // Origin - READ-ONLY; Default value is 'user,system'. + Origin *string `json:"origin,omitempty"` + // Display - The information displayed about the operation. + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay the object that represents the operation. +type OperationDisplay struct { + // Provider - READ-ONLY; Service provider: Microsoft.HealthcareApis + Provider *string `json:"provider,omitempty"` + // Resource - READ-ONLY; Resource Type: Services + Resource *string `json:"resource,omitempty"` + // Operation - READ-ONLY; Name of the operation + Operation *string `json:"operation,omitempty"` + // Description - READ-ONLY; Friendly description for the operation, + Description *string `json:"description,omitempty"` +} + +// OperationListResult a list of service operations. It contains a list of operations and a URL link to get +// the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // NextLink - The link used to get the next page of service description objects. + NextLink *string `json:"nextLink,omitempty"` + // Value - READ-ONLY; A list of service operations supported by the Microsoft.HealthcareApis resource provider. + Value *[]Operation `json:"value,omitempty"` +} + +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationListResultIterator) Response() OperationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationListResultIterator type. +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return OperationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { + if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(context.Context, OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// Creates a new instance of the OperationListResultPage type. +func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{fn: getNextPage} +} + +// OperationResultsDescription the properties indicating the operation result of an operation on a service. +type OperationResultsDescription struct { + // ID - READ-ONLY; The ID of the operation returned. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the operation result. + Name *string `json:"name,omitempty"` + // Status - READ-ONLY; The status of the operation being performed. Possible values include: 'Canceled', 'Succeeded', 'Failed', 'Requested', 'Running' + Status OperationResultStatus `json:"status,omitempty"` + // StartTime - READ-ONLY; The time that the operation was started. + StartTime *string `json:"startTime,omitempty"` + // Properties - Additional properties of the operation result. + Properties interface{} `json:"properties,omitempty"` +} + +// Resource the common properties of a service. +type Resource struct { + // ID - READ-ONLY; The resource identifier. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The resource type. + Type *string `json:"type,omitempty"` + // Kind - The kind of the service. Possible values include: 'Fhir', 'FhirStu3', 'FhirR4' + Kind Kind `json:"kind,omitempty"` + // Location - The resource location. + Location *string `json:"location,omitempty"` + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` + // Etag - An etag associated with the resource, used for optimistic concurrency when editing it. + Etag *string `json:"etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Kind != "" { + objectMap["kind"] = r.Kind + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + if r.Etag != nil { + objectMap["etag"] = r.Etag + } + return json.Marshal(objectMap) +} + +// ServiceAccessPolicyEntry an access policy entry. +type ServiceAccessPolicyEntry struct { + // ObjectID - An Azure AD object ID (User or Apps) that is allowed access to the FHIR service. + ObjectID *string `json:"objectId,omitempty"` +} + +// ServiceAuthenticationConfigurationInfo authentication configuration information +type ServiceAuthenticationConfigurationInfo struct { + // Authority - The authority url for the service + Authority *string `json:"authority,omitempty"` + // Audience - The audience url for the service + Audience *string `json:"audience,omitempty"` + // SmartProxyEnabled - If the SMART on FHIR proxy is enabled + SmartProxyEnabled *bool `json:"smartProxyEnabled,omitempty"` +} + +// ServiceCorsConfigurationInfo the settings for the CORS configuration of the service instance. +type ServiceCorsConfigurationInfo struct { + // Origins - The origins to be allowed via CORS. + Origins *[]string `json:"origins,omitempty"` + // Headers - The headers to be allowed via CORS. + Headers *[]string `json:"headers,omitempty"` + // Methods - The methods to be allowed via CORS. + Methods *[]string `json:"methods,omitempty"` + // MaxAge - The max age to be allowed via CORS. + MaxAge *int32 `json:"maxAge,omitempty"` + // AllowCredentials - If credentials are allowed via CORS. + AllowCredentials *bool `json:"allowCredentials,omitempty"` +} + +// ServiceCosmosDbConfigurationInfo the settings for the Cosmos DB database backing the service. +type ServiceCosmosDbConfigurationInfo struct { + // OfferThroughput - The provisioned throughput for the backing database. + OfferThroughput *int32 `json:"offerThroughput,omitempty"` +} + +// ServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServicesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServicesCreateOrUpdateFuture) Result(client ServicesClient) (sd ServicesDescription, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("healthcareapis.ServicesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sd.Response.Response, err = future.GetResult(sender); err == nil && sd.Response.Response.StatusCode != http.StatusNoContent { + sd, err = client.CreateOrUpdateResponder(sd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesCreateOrUpdateFuture", "Result", sd.Response.Response, "Failure responding to request") + } + } + return +} + +// ServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServicesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServicesDeleteFuture) Result(client ServicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("healthcareapis.ServicesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ServicesDescription the description of the service. +type ServicesDescription struct { + autorest.Response `json:"-"` + // Properties - The common properties of a service. + Properties *ServicesProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource identifier. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The resource type. + Type *string `json:"type,omitempty"` + // Kind - The kind of the service. Possible values include: 'Fhir', 'FhirStu3', 'FhirR4' + Kind Kind `json:"kind,omitempty"` + // Location - The resource location. + Location *string `json:"location,omitempty"` + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` + // Etag - An etag associated with the resource, used for optimistic concurrency when editing it. + Etag *string `json:"etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServicesDescription. +func (sd ServicesDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sd.Properties != nil { + objectMap["properties"] = sd.Properties + } + if sd.Kind != "" { + objectMap["kind"] = sd.Kind + } + if sd.Location != nil { + objectMap["location"] = sd.Location + } + if sd.Tags != nil { + objectMap["tags"] = sd.Tags + } + if sd.Etag != nil { + objectMap["etag"] = sd.Etag + } + return json.Marshal(objectMap) +} + +// ServicesDescriptionListResult a list of service description objects with a next link. +type ServicesDescriptionListResult struct { + autorest.Response `json:"-"` + // NextLink - The link used to get the next page of service description objects. + NextLink *string `json:"nextLink,omitempty"` + // Value - A list of service description objects. + Value *[]ServicesDescription `json:"value,omitempty"` +} + +// ServicesDescriptionListResultIterator provides access to a complete listing of ServicesDescription +// values. +type ServicesDescriptionListResultIterator struct { + i int + page ServicesDescriptionListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ServicesDescriptionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesDescriptionListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ServicesDescriptionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServicesDescriptionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ServicesDescriptionListResultIterator) Response() ServicesDescriptionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ServicesDescriptionListResultIterator) Value() ServicesDescription { + if !iter.page.NotDone() { + return ServicesDescription{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ServicesDescriptionListResultIterator type. +func NewServicesDescriptionListResultIterator(page ServicesDescriptionListResultPage) ServicesDescriptionListResultIterator { + return ServicesDescriptionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sdlr ServicesDescriptionListResult) IsEmpty() bool { + return sdlr.Value == nil || len(*sdlr.Value) == 0 +} + +// servicesDescriptionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sdlr ServicesDescriptionListResult) servicesDescriptionListResultPreparer(ctx context.Context) (*http.Request, error) { + if sdlr.NextLink == nil || len(to.String(sdlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sdlr.NextLink))) +} + +// ServicesDescriptionListResultPage contains a page of ServicesDescription values. +type ServicesDescriptionListResultPage struct { + fn func(context.Context, ServicesDescriptionListResult) (ServicesDescriptionListResult, error) + sdlr ServicesDescriptionListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ServicesDescriptionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesDescriptionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.sdlr) + if err != nil { + return err + } + page.sdlr = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ServicesDescriptionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServicesDescriptionListResultPage) NotDone() bool { + return !page.sdlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServicesDescriptionListResultPage) Response() ServicesDescriptionListResult { + return page.sdlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServicesDescriptionListResultPage) Values() []ServicesDescription { + if page.sdlr.IsEmpty() { + return nil + } + return *page.sdlr.Value +} + +// Creates a new instance of the ServicesDescriptionListResultPage type. +func NewServicesDescriptionListResultPage(getNextPage func(context.Context, ServicesDescriptionListResult) (ServicesDescriptionListResult, error)) ServicesDescriptionListResultPage { + return ServicesDescriptionListResultPage{fn: getNextPage} +} + +// ServicesNameAvailabilityInfo the properties indicating whether a given service name is available. +type ServicesNameAvailabilityInfo struct { + autorest.Response `json:"-"` + // NameAvailable - READ-ONLY; The value which indicates whether the provided name is available. + NameAvailable *bool `json:"nameAvailable,omitempty"` + // Reason - READ-ONLY; The reason for unavailability. Possible values include: 'Invalid', 'AlreadyExists' + Reason ServiceNameUnavailabilityReason `json:"reason,omitempty"` + // Message - The detailed reason message. + Message *string `json:"message,omitempty"` +} + +// ServicesPatchDescription the description of the service. +type ServicesPatchDescription struct { + // Tags - Instance tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ServicesPatchDescription. +func (spd ServicesPatchDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spd.Tags != nil { + objectMap["tags"] = spd.Tags + } + return json.Marshal(objectMap) +} + +// ServicesProperties the properties of a service instance. +type ServicesProperties struct { + // ProvisioningState - READ-ONLY; The provisioning state. Possible values include: 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateCreating', 'ProvisioningStateAccepted', 'ProvisioningStateVerifying', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateDeprovisioned' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // AccessPolicies - The access policies of the service instance. + AccessPolicies *[]ServiceAccessPolicyEntry `json:"accessPolicies,omitempty"` + // CosmosDbConfiguration - The settings for the Cosmos DB database backing the service. + CosmosDbConfiguration *ServiceCosmosDbConfigurationInfo `json:"cosmosDbConfiguration,omitempty"` + // AuthenticationConfiguration - The authentication configuration for the service instance. + AuthenticationConfiguration *ServiceAuthenticationConfigurationInfo `json:"authenticationConfiguration,omitempty"` + // CorsConfiguration - The settings for the CORS configuration of the service instance. + CorsConfiguration *ServiceCorsConfigurationInfo `json:"corsConfiguration,omitempty"` +} + +// ServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServicesUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServicesUpdateFuture) Result(client ServicesClient) (sd ServicesDescription, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("healthcareapis.ServicesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sd.Response.Response, err = future.GetResult(sender); err == nil && sd.Response.Response.StatusCode != http.StatusNoContent { + sd, err = client.UpdateResponder(sd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesUpdateFuture", "Result", sd.Response.Response, "Failure responding to request") + } + } + return +} + +// SetObject ... +type SetObject struct { + autorest.Response `json:"-"` + Value interface{} `json:"value,omitempty"` +} diff --git a/services/healthcareapis/mgmt/2019-09-16/healthcareapis/operationresults.go b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/operationresults.go new file mode 100644 index 000000000000..10f2174c33df --- /dev/null +++ b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/operationresults.go @@ -0,0 +1,118 @@ +package healthcareapis + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationResultsClient is the azure Healthcare APIs Client +type OperationResultsClient struct { + BaseClient +} + +// NewOperationResultsClient creates an instance of the OperationResultsClient client. +func NewOperationResultsClient(subscriptionID string) OperationResultsClient { + return NewOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationResultsClientWithBaseURI creates an instance of the OperationResultsClient client. +func NewOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) OperationResultsClient { + return OperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get the operation result for a long running operation. +// Parameters: +// locationName - the location of the operation. +// operationResultID - the ID of the operation result to get. +func (client OperationResultsClient) Get(ctx context.Context, locationName string, operationResultID string) (result SetObject, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationResultsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, locationName, operationResultID) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.OperationResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "healthcareapis.OperationResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.OperationResultsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client OperationResultsClient) GetPreparer(ctx context.Context, locationName string, operationResultID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "locationName": autorest.Encode("path", locationName), + "operationResultId": autorest.Encode("path", operationResultID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-16" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/locations/{locationName}/operationresults/{operationResultId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client OperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client OperationResultsClient) GetResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/healthcareapis/mgmt/2019-09-16/healthcareapis/operations.go b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/operations.go new file mode 100644 index 000000000000..5acb766ce32c --- /dev/null +++ b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/operations.go @@ -0,0 +1,147 @@ +package healthcareapis + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the azure Healthcare APIs Client +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available Healthcare service REST API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.olr.Response.Response != nil { + sc = result.olr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.olr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "healthcareapis.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-09-16" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.HealthcareApis/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationListResult) (result OperationListResult, err error) { + req, err := lastResults.operationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "healthcareapis.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "healthcareapis.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/healthcareapis/mgmt/2019-09-16/healthcareapis/services.go b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/services.go new file mode 100644 index 000000000000..129dd2f0fc13 --- /dev/null +++ b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/services.go @@ -0,0 +1,730 @@ +package healthcareapis + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ServicesClient is the azure Healthcare APIs Client +type ServicesClient struct { + BaseClient +} + +// NewServicesClient creates an instance of the ServicesClient client. +func NewServicesClient(subscriptionID string) ServicesClient { + return NewServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServicesClientWithBaseURI creates an instance of the ServicesClient client. +func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient { + return ServicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability check if a service instance name is available. +// Parameters: +// checkNameAvailabilityInputs - set the name parameter in the CheckNameAvailabilityParameters structure to the +// name of the service instance to check. +func (client ServicesClient) CheckNameAvailability(ctx context.Context, checkNameAvailabilityInputs CheckNameAvailabilityParameters) (result ServicesNameAvailabilityInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.CheckNameAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: checkNameAvailabilityInputs, + Constraints: []validation.Constraint{{Target: "checkNameAvailabilityInputs.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "checkNameAvailabilityInputs.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.ServicesClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, checkNameAvailabilityInputs) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "CheckNameAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client ServicesClient) CheckNameAvailabilityPreparer(ctx context.Context, checkNameAvailabilityInputs CheckNameAvailabilityParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-16" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/checkNameAvailability", pathParameters), + autorest.WithJSON(checkNameAvailabilityInputs), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client ServicesClient) CheckNameAvailabilityResponder(resp *http.Response) (result ServicesNameAvailabilityInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate create or update the metadata of a service instance. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// resourceName - the name of the service instance. +// serviceDescription - the service instance metadata. +func (client ServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, serviceDescription ServicesDescription) (result ServicesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: serviceDescription, + Constraints: []validation.Constraint{{Target: "serviceDescription.Properties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "serviceDescription.Properties.AccessPolicies", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "serviceDescription.Properties.CosmosDbConfiguration", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CosmosDbConfiguration.OfferThroughput", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CosmosDbConfiguration.OfferThroughput", Name: validation.InclusiveMaximum, Rule: int64(10000), Chain: nil}, + {Target: "serviceDescription.Properties.CosmosDbConfiguration.OfferThroughput", Name: validation.InclusiveMinimum, Rule: 400, Chain: nil}, + }}, + }}, + {Target: "serviceDescription.Properties.CorsConfiguration", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CorsConfiguration.MaxAge", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CorsConfiguration.MaxAge", Name: validation.InclusiveMaximum, Rule: int64(99999), Chain: nil}, + {Target: "serviceDescription.Properties.CorsConfiguration.MaxAge", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("healthcareapis.ServicesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, serviceDescription) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, serviceDescription ServicesDescription) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-16" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", pathParameters), + autorest.WithJSON(serviceDescription), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) CreateOrUpdateSender(req *http.Request) (future ServicesCreateOrUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ServicesClient) CreateOrUpdateResponder(resp *http.Response) (result ServicesDescription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a service instance. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// resourceName - the name of the service instance. +func (client ServicesClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result ServicesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.ServicesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-16" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) DeleteSender(req *http.Request) (future ServicesDeleteFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the metadata of a service instance. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// resourceName - the name of the service instance. +func (client ServicesClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result ServicesDescription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.ServicesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-16" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) GetSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ServicesClient) GetResponder(resp *http.Response) (result ServicesDescription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List get all the service instances in a subscription. +func (client ServicesClient) List(ctx context.Context) (result ServicesDescriptionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.List") + defer func() { + sc := -1 + if result.sdlr.Response.Response != nil { + sc = result.sdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "List", resp, "Failure sending request") + return + } + + result.sdlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ServicesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-16" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/services", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) ListSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ServicesClient) ListResponder(resp *http.Response) (result ServicesDescriptionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ServicesClient) listNextResults(ctx context.Context, lastResults ServicesDescriptionListResult) (result ServicesDescriptionListResult, err error) { + req, err := lastResults.servicesDescriptionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServicesClient) ListComplete(ctx context.Context) (result ServicesDescriptionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup get all the service instances in a resource group. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +func (client ServicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ServicesDescriptionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.sdlr.Response.Response != nil { + sc = result.sdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.ServicesClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.sdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.sdlr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ServicesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-16" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ServicesClient) ListByResourceGroupResponder(resp *http.Response) (result ServicesDescriptionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ServicesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ServicesDescriptionListResult) (result ServicesDescriptionListResult, err error) { + req, err := lastResults.servicesDescriptionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServicesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ServicesDescriptionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// Update update the metadata of a service instance. +// Parameters: +// 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. +func (client ServicesClient) Update(ctx context.Context, resourceGroupName string, resourceName string, servicePatchDescription ServicesPatchDescription) (result ServicesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.ServicesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, servicePatchDescription) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.ServicesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ServicesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, servicePatchDescription ServicesPatchDescription) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-16" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/services/{resourceName}", pathParameters), + autorest.WithJSON(servicePatchDescription), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ServicesClient) UpdateSender(req *http.Request) (future ServicesUpdateFuture, err error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, sd...) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ServicesClient) UpdateResponder(resp *http.Response) (result ServicesDescription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/healthcareapis/mgmt/2019-09-16/healthcareapis/version.go b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/version.go new file mode 100644 index 000000000000..f7a574efeb9b --- /dev/null +++ b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/version.go @@ -0,0 +1,30 @@ +package healthcareapis + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " healthcareapis/2019-09-16" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +}