From 7ac8f895c83fbf5d4cd034003883a45b97159a81 Mon Sep 17 00:00:00 2001 From: Xiaxin <92154856+xiaxyi@users.noreply.github.com> Date: Wed, 16 Mar 2022 20:44:10 +0800 Subject: [PATCH] Healthcareapi/workspace (#15759) * add pandora sdk for healthcare api * add workspace * workspace * hc worksapce update * remove pandora sdk * fmt * sort import * update * tidy vendor * update workspace * rename * go mod * add healthcare workspace data source docs and add an update test for tags for healthcare workspace resource Co-authored-by: Steph --- internal/services/healthcare/client/client.go | 13 +- .../healthcare/healthcare_service_resource.go | 16 +- .../healthcare_workspace_data_source.go | 67 + .../healthcare_workspace_data_source_test.go | 35 + .../healthcare_workspace_resource.go | 217 + .../healthcare_workspace_resource_test.go | 157 + .../services/healthcare/parse/workspace.go | 69 + .../healthcare/parse/workspace_test.go | 112 + internal/services/healthcare/registration.go | 6 +- internal/services/healthcare/resourceids.go | 1 + .../healthcare/validate/workspace_id.go | 23 + .../healthcare/validate/workspace_id_test.go | 76 + .../healthcare/validate/workspace_name.go | 24 + .../mgmt/2020-03-30/healthcareapis/_meta.json | 11 - .../mgmt/2020-03-30/healthcareapis/enums.go | 156 - .../mgmt/2020-03-30/healthcareapis/models.go | 1217 ------ .../healthcareapis/CHANGELOG.md | 0 .../mgmt/2021-11-01/healthcareapis/_meta.json | 11 + .../healthcareapis/client.go | 2 +- .../healthcareapis/dicomservices.go | 543 +++ .../mgmt/2021-11-01/healthcareapis/enums.go | 279 ++ .../healthcareapis/fhirdestinations.go | 167 + .../2021-11-01/healthcareapis/fhirservices.go | 552 +++ .../iotconnectorfhirdestination.go | 337 ++ .../healthcareapis/iotconnectors.go | 543 +++ .../mgmt/2021-11-01/healthcareapis/models.go | 3810 +++++++++++++++++ .../healthcareapis/operationresults.go | 10 +- .../healthcareapis/operations.go | 24 +- .../privateendpointconnections.go | 18 +- .../healthcareapis/privatelinkresources.go | 12 +- .../healthcareapis/services.go | 14 +- .../healthcareapis/version.go | 2 +- .../workspaceprivateendpointconnections.go | 399 ++ .../workspaceprivatelinkresources.go | 209 + .../2021-11-01/healthcareapis/workspaces.go | 631 +++ vendor/modules.txt | 2 +- .../docs/d/healthcare_workspace.html.markdown | 46 + .../docs/r/healthcare_workspace.html.markdown | 53 + 38 files changed, 8424 insertions(+), 1440 deletions(-) create mode 100644 internal/services/healthcare/healthcare_workspace_data_source.go create mode 100644 internal/services/healthcare/healthcare_workspace_data_source_test.go create mode 100644 internal/services/healthcare/healthcare_workspace_resource.go create mode 100644 internal/services/healthcare/healthcare_workspace_resource_test.go create mode 100644 internal/services/healthcare/parse/workspace.go create mode 100644 internal/services/healthcare/parse/workspace_test.go create mode 100644 internal/services/healthcare/validate/workspace_id.go create mode 100644 internal/services/healthcare/validate/workspace_id_test.go create mode 100644 internal/services/healthcare/validate/workspace_name.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/_meta.json delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/enums.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/models.go rename vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/{2020-03-30 => 2021-11-01}/healthcareapis/CHANGELOG.md (100%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/_meta.json rename vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/{2020-03-30 => 2021-11-01}/healthcareapis/client.go (97%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/dicomservices.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/enums.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/fhirdestinations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/fhirservices.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/iotconnectorfhirdestination.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/iotconnectors.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/models.go rename vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/{2020-03-30 => 2021-11-01}/healthcareapis/operationresults.go (93%) rename vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/{2020-03-30 => 2021-11-01}/healthcareapis/operations.go (87%) rename vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/{2020-03-30 => 2021-11-01}/healthcareapis/privateendpointconnections.go (97%) rename vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/{2020-03-30 => 2021-11-01}/healthcareapis/privatelinkresources.go (96%) rename vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/{2020-03-30 => 2021-11-01}/healthcareapis/services.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/{2020-03-30 => 2021-11-01}/healthcareapis/version.go (89%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/workspaceprivateendpointconnections.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/workspaceprivatelinkresources.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/workspaces.go create mode 100644 website/docs/d/healthcare_workspace.html.markdown create mode 100644 website/docs/r/healthcare_workspace.html.markdown diff --git a/internal/services/healthcare/client/client.go b/internal/services/healthcare/client/client.go index 42c700678457..6b6e37e26e4a 100644 --- a/internal/services/healthcare/client/client.go +++ b/internal/services/healthcare/client/client.go @@ -1,19 +1,24 @@ package client import ( - healthcare "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis" + "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) type Client struct { - HealthcareServiceClient *healthcare.ServicesClient + HealthcareServiceClient *healthcareapis.ServicesClient + HealthcareWorkspaceClient *healthcareapis.WorkspacesClient } func NewClient(o *common.ClientOptions) *Client { - HealthcareServiceClient := healthcare.NewServicesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + HealthcareServiceClient := healthcareapis.NewServicesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&HealthcareServiceClient.Client, o.ResourceManagerAuthorizer) + HealthcareWorkspaceClient := healthcareapis.NewWorkspacesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + o.ConfigureClient(&HealthcareWorkspaceClient.Client, o.ResourceManagerAuthorizer) + return &Client{ - HealthcareServiceClient: &HealthcareServiceClient, + HealthcareServiceClient: &HealthcareServiceClient, + HealthcareWorkspaceClient: &HealthcareWorkspaceClient, } } diff --git a/internal/services/healthcare/healthcare_service_resource.go b/internal/services/healthcare/healthcare_service_resource.go index 5284fa2f56c9..938db0576086 100644 --- a/internal/services/healthcare/healthcare_service_resource.go +++ b/internal/services/healthcare/healthcare_service_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis" + "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -54,11 +54,11 @@ func resourceHealthcareService() *pluginsdk.Resource { "kind": { Type: pluginsdk.TypeString, Optional: true, - Default: string(healthcareapis.Fhir), + Default: string(healthcareapis.KindFhir), ValidateFunc: validation.StringInSlice([]string{ - string(healthcareapis.Fhir), - string(healthcareapis.FhirR4), - string(healthcareapis.FhirStu3), + string(healthcareapis.KindFhir), + string(healthcareapis.KindFhirR4), + string(healthcareapis.KindFhirStu3), }, false), }, @@ -246,9 +246,9 @@ func resourceHealthcareServiceCreateUpdate(d *pluginsdk.ResourceData, meta inter publicNetworkAccess := d.Get("public_network_access_enabled").(bool) if !publicNetworkAccess { - healthcareServiceDescription.Properties.PublicNetworkAccess = healthcareapis.Disabled + healthcareServiceDescription.Properties.PublicNetworkAccess = healthcareapis.PublicNetworkAccessDisabled } else { - healthcareServiceDescription.Properties.PublicNetworkAccess = healthcareapis.Enabled + healthcareServiceDescription.Properties.PublicNetworkAccess = healthcareapis.PublicNetworkAccessEnabled } future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.Name, healthcareServiceDescription) @@ -311,7 +311,7 @@ func resourceHealthcareServiceRead(d *pluginsdk.ResourceData, meta interface{}) } d.Set("cosmosdb_key_vault_key_versionless_id", cosmodDbKeyVaultKeyVersionlessId) d.Set("cosmosdb_throughput", cosmosDbThroughput) - if props.PublicNetworkAccess == healthcareapis.Enabled { + if props.PublicNetworkAccess == healthcareapis.PublicNetworkAccessEnabled { d.Set("public_network_access_enabled", true) } else { d.Set("public_network_access_enabled", false) diff --git a/internal/services/healthcare/healthcare_workspace_data_source.go b/internal/services/healthcare/healthcare_workspace_data_source.go new file mode 100644 index 000000000000..954751c8df8b --- /dev/null +++ b/internal/services/healthcare/healthcare_workspace_data_source.go @@ -0,0 +1,67 @@ +package healthcare + +import ( + "fmt" + "time" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/healthcare/parse" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/healthcare/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/tags" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +func dataSourceHealthcareWorkspace() *pluginsdk.Resource { + return &pluginsdk.Resource{ + Read: dataSourceHealthcareWorkspaceRead, + + Timeouts: &pluginsdk.ResourceTimeout{ + Read: pluginsdk.DefaultTimeout(5 * time.Minute), + }, + + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validate.WorkspaceName, + }, + + "resource_group_name": commonschema.ResourceGroupName(), + + "location": commonschema.LocationComputed(), + + "tags": tags.SchemaDataSource(), + }, + } +} + +func dataSourceHealthcareWorkspaceRead(d *pluginsdk.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).HealthCare.HealthcareWorkspaceClient + subscriptionId := meta.(*clients.Client).Account.SubscriptionId + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + + id := parse.NewWorkspaceID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) + resp, err := client.Get(ctx, id.ResourceGroup, id.Name) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("%s was not found", id) + } + return fmt.Errorf("retrieving %s: %+v", id, err) + } + + d.SetId(id.ID()) + + d.Set("name", id.Name) + d.Set("resource_group_name", id.ResourceGroup) + + if locations := resp.Location; locations != nil { + d.Set("location", location.Normalize(*locations)) + } + + return tags.FlattenAndSet(d, resp.Tags) +} diff --git a/internal/services/healthcare/healthcare_workspace_data_source_test.go b/internal/services/healthcare/healthcare_workspace_data_source_test.go new file mode 100644 index 000000000000..66387ab98f93 --- /dev/null +++ b/internal/services/healthcare/healthcare_workspace_data_source_test.go @@ -0,0 +1,35 @@ +package healthcare_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" +) + +type HealthCareWorkspaceDataSource struct{} + +func TestAccHealthCareWorkspaceDataSource_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_healthcare_workspace", "test") + r := HealthCareWorkspaceDataSource{} + + data.DataSourceTest(t, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("name").Exists()), + }, + }) +} + +func (HealthCareWorkspaceDataSource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +data "azurerm_healthcare_workspace" "test" { + name = azurerm_healthcare_workspace.test.name + resource_group_name = azurerm_healthcare_workspace.test.resource_group_name +} +`, HealthCareWorkspaceResource{}.complete(data)) +} diff --git a/internal/services/healthcare/healthcare_workspace_resource.go b/internal/services/healthcare/healthcare_workspace_resource.go new file mode 100644 index 000000000000..462bf317f1a6 --- /dev/null +++ b/internal/services/healthcare/healthcare_workspace_resource.go @@ -0,0 +1,217 @@ +package healthcare + +import ( + "fmt" + "log" + "time" + + "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/healthcare/parse" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/healthcare/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/tags" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/timeouts" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +func resourceHealthcareApisWorkspace() *pluginsdk.Resource { + return &pluginsdk.Resource{ + Create: resourceHealthcareApisWorkspaceCreate, + Read: resourceHealthcareApisWorkspaceRead, + Update: resourceHealthcareApisWorkspaceUpdate, + Delete: resourceHealthcareApisWorkspaceDelete, + + Timeouts: &pluginsdk.ResourceTimeout{ + Create: pluginsdk.DefaultTimeout(30 * time.Minute), + Read: pluginsdk.DefaultTimeout(5 * time.Minute), + Update: pluginsdk.DefaultTimeout(30 * time.Minute), + Delete: pluginsdk.DefaultTimeout(30 * time.Minute), + }, + + Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { + _, err := parse.WorkspaceID(id) + return err + }), + + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.WorkspaceName, + }, + + "resource_group_name": commonschema.ResourceGroupName(), + + "location": commonschema.Location(), + + "private_endpoint_connection": { + Type: pluginsdk.TypeSet, + Computed: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + }, + }, + }, + + "tags": commonschema.Tags(), + }, + } +} + +func resourceHealthcareApisWorkspaceCreate(d *pluginsdk.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).HealthCare.HealthcareWorkspaceClient + subscriptionId := meta.(*clients.Client).Account.SubscriptionId + ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) + defer cancel() + log.Printf("[INFO] preparing arguments for AzureRM Healthcare Workspace creation.") + + id := parse.NewWorkspaceID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string)) + if d.IsNewResource() { + existing, err := client.Get(ctx, id.ResourceGroup, id.Name) + if err != nil { + if !utils.ResponseWasNotFound(existing.Response) { + return fmt.Errorf("checking for presence of existing %s: %+v", id, err) + } + } + if !utils.ResponseWasNotFound(existing.Response) { + return tf.ImportAsExistsError("azurerm_healthcare_workspace", id.ID()) + } + } + + location := location.Normalize(d.Get("location").(string)) + t := d.Get("tags").(map[string]interface{}) + + parameters := healthcareapis.Workspace{ + Location: &location, + Tags: tags.Expand(t), + } + + future, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.Name, parameters) + if err != nil { + return fmt.Errorf("creating/ updating %s: %+v", id, err) + } + + if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { + return fmt.Errorf("waiting for creation/update of %s: %+v", id, err) + } + + d.SetId(id.ID()) + + return resourceHealthcareApisWorkspaceRead(d, meta) +} + +func resourceHealthcareApisWorkspaceRead(d *pluginsdk.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).HealthCare.HealthcareWorkspaceClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := parse.WorkspaceID(d.Id()) + if err != nil { + return err + } + + resp, err := client.Get(ctx, id.ResourceGroup, id.Name) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + d.SetId("") + return nil + } + return fmt.Errorf("retrieving %s: %+v", *id, err) + } + + d.Set("name", id.Name) + d.Set("resource_group_name", id.ResourceGroup) + if locations := resp.Location; locations != nil { + d.Set("location", location.Normalize(*locations)) + } + + if props := resp.Properties; props != nil { + d.Set("private_endpoint_connection", flattenWorkspacePrivateEndpoint(props.PrivateEndpointConnections)) + } + + return tags.FlattenAndSet(d, resp.Tags) +} + +func resourceHealthcareApisWorkspaceUpdate(d *pluginsdk.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).HealthCare.HealthcareWorkspaceClient + ctx, cancel := timeouts.ForUpdate(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := parse.WorkspaceID(d.Id()) + if err != nil { + return err + } + + t := d.Get("tags").(map[string]interface{}) + + parameters := healthcareapis.WorkspacePatchResource{ + Tags: tags.Expand(t), + } + + future, err := client.Update(ctx, id.ResourceGroup, id.Name, parameters) + if err != nil { + return fmt.Errorf("updating %s: %+v", id, err) + } + + if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { + return fmt.Errorf("waiting for update of %s: %+v", id, err) + } + + d.SetId(id.ID()) + + return resourceHealthcareApisWorkspaceRead(d, meta) +} + +func resourceHealthcareApisWorkspaceDelete(d *pluginsdk.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).HealthCare.HealthcareWorkspaceClient + ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := parse.WorkspaceID(d.Id()) + if err != nil { + return err + } + + future, err := client.Delete(ctx, id.ResourceGroup, id.Name) + if err != nil { + return fmt.Errorf("deleting %s: %+v", id, err) + } + + if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { + return fmt.Errorf("waiting for the deletion of %s: %+v", *id, err) + } + return nil +} + +func flattenWorkspacePrivateEndpoint(input *[]healthcareapis.PrivateEndpointConnection) []interface{} { + results := make([]interface{}, 0) + if input == nil { + return results + } + + for _, endpoint := range *input { + result := map[string]interface{}{} + if endpoint.Name != nil { + result["name"] = *endpoint.Name + } + + if endpoint.ID != nil { + result["id"] = *endpoint.ID + } + } + return results +} diff --git a/internal/services/healthcare/healthcare_workspace_resource_test.go b/internal/services/healthcare/healthcare_workspace_resource_test.go new file mode 100644 index 000000000000..21272219174d --- /dev/null +++ b/internal/services/healthcare/healthcare_workspace_resource_test.go @@ -0,0 +1,157 @@ +package healthcare_test + +import ( + "context" + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/healthcare/parse" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +type HealthCareWorkspaceResource struct{} + +func TestAccHealthCareWorkspace_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_healthcare_workspace", "test") + r := HealthCareWorkspaceResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r)), + }, + data.ImportStep(), + }) +} + +func TestAccHealthCareWorkspace_update(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_healthcare_workspace", "test") + r := HealthCareWorkspaceResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.complete(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r)), + }, + data.ImportStep(), + { + Config: r.update(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r)), + }, + data.ImportStep(), + }) +} + +func TestAccHealthCareWorkspace_requiresImport(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_healthcare_workspace", "test") + r := HealthCareWorkspaceResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r)), + }, + data.RequiresImportErrorStep(r.requiresImport), + }) +} + +func (HealthCareWorkspaceResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { + id, err := parse.WorkspaceID(state.ID) + if err != nil { + return nil, err + } + + resp, err := clients.HealthCare.HealthcareWorkspaceClient.Get(ctx, id.ResourceGroup, id.Name) + if err != nil { + return nil, fmt.Errorf("retrieving %s, %+v", *id, err) + } + + return utils.Bool(resp.Properties != nil), nil +} + +func (HealthCareWorkspaceResource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-health-%d" + location = "%s" +} + +resource "azurerm_healthcare_workspace" "test" { + name = "acctestwk%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location +} +`, data.RandomInteger, data.Locations.Primary, data.RandomIntOfLength(8)) +} + +func (HealthCareWorkspaceResource) complete(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-health-%d" + location = "%s" +} + +resource "azurerm_healthcare_workspace" "test" { + name = "acctestwk%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + + tags = { + environment = "Dev" + test = "true" + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomIntOfLength(8)) +} + +func (HealthCareWorkspaceResource) update(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-health-%d" + location = "%s" +} + +resource "azurerm_healthcare_workspace" "test" { + name = "acctestwk%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + + tags = { + environment = "Prod" + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomIntOfLength(8)) +} + +func (r HealthCareWorkspaceResource) requiresImport(data acceptance.TestData) string { + return fmt.Sprintf(` +%s +resource "azurerm_healthcare_workspace" "import" { + name = azurerm_healthcare_workspace.test.name + resource_group_name = azurerm_healthcare_workspace.test.resource_group_name + location = azurerm_healthcare_workspace.test.location +} + + +`, r.basic(data)) +} diff --git a/internal/services/healthcare/parse/workspace.go b/internal/services/healthcare/parse/workspace.go new file mode 100644 index 000000000000..5bacfa4aad96 --- /dev/null +++ b/internal/services/healthcare/parse/workspace.go @@ -0,0 +1,69 @@ +package parse + +// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +type WorkspaceId struct { + SubscriptionId string + ResourceGroup string + Name string +} + +func NewWorkspaceID(subscriptionId, resourceGroup, name string) WorkspaceId { + return WorkspaceId{ + SubscriptionId: subscriptionId, + ResourceGroup: resourceGroup, + Name: name, + } +} + +func (id WorkspaceId) String() string { + segments := []string{ + fmt.Sprintf("Name %q", id.Name), + fmt.Sprintf("Resource Group %q", id.ResourceGroup), + } + segmentsStr := strings.Join(segments, " / ") + return fmt.Sprintf("%s: (%s)", "Workspace", segmentsStr) +} + +func (id WorkspaceId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.HealthcareApis/workspaces/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.Name) +} + +// WorkspaceID parses a Workspace ID into an WorkspaceId struct +func WorkspaceID(input string) (*WorkspaceId, error) { + id, err := resourceids.ParseAzureResourceID(input) + if err != nil { + return nil, err + } + + resourceId := WorkspaceId{ + SubscriptionId: id.SubscriptionID, + ResourceGroup: id.ResourceGroup, + } + + if resourceId.SubscriptionId == "" { + return nil, fmt.Errorf("ID was missing the 'subscriptions' element") + } + + if resourceId.ResourceGroup == "" { + return nil, fmt.Errorf("ID was missing the 'resourceGroups' element") + } + + if resourceId.Name, err = id.PopSegment("workspaces"); err != nil { + return nil, err + } + + if err := id.ValidateNoEmptySegments(input); err != nil { + return nil, err + } + + return &resourceId, nil +} diff --git a/internal/services/healthcare/parse/workspace_test.go b/internal/services/healthcare/parse/workspace_test.go new file mode 100644 index 000000000000..955a5c56fa12 --- /dev/null +++ b/internal/services/healthcare/parse/workspace_test.go @@ -0,0 +1,112 @@ +package parse + +// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +var _ resourceids.Id = WorkspaceId{} + +func TestWorkspaceIDFormatter(t *testing.T) { + actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "group1", "workspace1").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.HealthcareApis/workspaces/workspace1" + if actual != expected { + t.Fatalf("Expected %q but got %q", expected, actual) + } +} + +func TestWorkspaceID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *WorkspaceId + }{ + + { + // empty + Input: "", + Error: true, + }, + + { + // missing SubscriptionId + Input: "/", + Error: true, + }, + + { + // missing value for SubscriptionId + Input: "/subscriptions/", + Error: true, + }, + + { + // missing ResourceGroup + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", + Error: true, + }, + + { + // missing value for ResourceGroup + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", + Error: true, + }, + + { + // missing Name + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.HealthcareApis/", + Error: true, + }, + + { + // missing value for Name + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.HealthcareApis/workspaces/", + Error: true, + }, + + { + // valid + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.HealthcareApis/workspaces/workspace1", + Expected: &WorkspaceId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroup: "group1", + Name: "workspace1", + }, + }, + + { + // upper-cased + Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/GROUP1/PROVIDERS/MICROSOFT.HEALTHCAREAPIS/WORKSPACES/WORKSPACE1", + Error: true, + }, + } + + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := WorkspaceID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %s", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + if actual.ResourceGroup != v.Expected.ResourceGroup { + t.Fatalf("Expected %q but got %q for ResourceGroup", v.Expected.ResourceGroup, actual.ResourceGroup) + } + if actual.Name != v.Expected.Name { + t.Fatalf("Expected %q but got %q for Name", v.Expected.Name, actual.Name) + } + } +} diff --git a/internal/services/healthcare/registration.go b/internal/services/healthcare/registration.go index bba2df08bc85..75f534108c4f 100644 --- a/internal/services/healthcare/registration.go +++ b/internal/services/healthcare/registration.go @@ -28,13 +28,15 @@ func (r Registration) WebsiteCategories() []string { // SupportedDataSources returns the supported Data Sources supported by this Service func (r Registration) SupportedDataSources() map[string]*pluginsdk.Resource { return map[string]*pluginsdk.Resource{ - "azurerm_healthcare_service": dataSourceHealthcareService(), + "azurerm_healthcare_service": dataSourceHealthcareService(), + "azurerm_healthcare_workspace": dataSourceHealthcareWorkspace(), } } // SupportedResources returns the supported Resources supported by this Service func (r Registration) SupportedResources() map[string]*pluginsdk.Resource { return map[string]*pluginsdk.Resource{ - "azurerm_healthcare_service": resourceHealthcareService(), + "azurerm_healthcare_service": resourceHealthcareService(), + "azurerm_healthcare_workspace": resourceHealthcareApisWorkspace(), } } diff --git a/internal/services/healthcare/resourceids.go b/internal/services/healthcare/resourceids.go index 1b5375fbea28..0f0d65503ecb 100644 --- a/internal/services/healthcare/resourceids.go +++ b/internal/services/healthcare/resourceids.go @@ -1,3 +1,4 @@ package healthcare //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=Service -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.HealthcareApis/services/service1 +//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=Workspace -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.HealthcareApis/workspaces/workspace1 diff --git a/internal/services/healthcare/validate/workspace_id.go b/internal/services/healthcare/validate/workspace_id.go new file mode 100644 index 000000000000..2a5a61d9ef87 --- /dev/null +++ b/internal/services/healthcare/validate/workspace_id.go @@ -0,0 +1,23 @@ +package validate + +// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten + +import ( + "fmt" + + "github.com/hashicorp/terraform-provider-azurerm/internal/services/healthcare/parse" +) + +func WorkspaceID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := parse.WorkspaceID(v); err != nil { + errors = append(errors, err) + } + + return +} diff --git a/internal/services/healthcare/validate/workspace_id_test.go b/internal/services/healthcare/validate/workspace_id_test.go new file mode 100644 index 000000000000..566e24e629c7 --- /dev/null +++ b/internal/services/healthcare/validate/workspace_id_test.go @@ -0,0 +1,76 @@ +package validate + +// NOTE: this file is generated via 'go:generate' - manual changes will be overwritten + +import "testing" + +func TestWorkspaceID(t *testing.T) { + cases := []struct { + Input string + Valid bool + }{ + + { + // empty + Input: "", + Valid: false, + }, + + { + // missing SubscriptionId + Input: "/", + Valid: false, + }, + + { + // missing value for SubscriptionId + Input: "/subscriptions/", + Valid: false, + }, + + { + // missing ResourceGroup + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/", + Valid: false, + }, + + { + // missing value for ResourceGroup + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/", + Valid: false, + }, + + { + // missing Name + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.HealthcareApis/", + Valid: false, + }, + + { + // missing value for Name + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.HealthcareApis/workspaces/", + Valid: false, + }, + + { + // valid + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.HealthcareApis/workspaces/workspace1", + Valid: true, + }, + + { + // upper-cased + Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/GROUP1/PROVIDERS/MICROSOFT.HEALTHCAREAPIS/WORKSPACES/WORKSPACE1", + Valid: false, + }, + } + for _, tc := range cases { + t.Logf("[DEBUG] Testing Value %s", tc.Input) + _, errors := WorkspaceID(tc.Input, "test") + valid := len(errors) == 0 + + if tc.Valid != valid { + t.Fatalf("Expected %t but got %t", tc.Valid, valid) + } + } +} diff --git a/internal/services/healthcare/validate/workspace_name.go b/internal/services/healthcare/validate/workspace_name.go new file mode 100644 index 000000000000..c72fa5129312 --- /dev/null +++ b/internal/services/healthcare/validate/workspace_name.go @@ -0,0 +1,24 @@ +package validate + +import ( + "fmt" + "regexp" +) + +func WorkspaceName(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be string", k)) + return + } + + // The name attribute rules are : + // 1. The value must be between 1 and 24 characters long + // 2. must contain only lowercase letters or numbers. + + if !regexp.MustCompile(`^[a-z0-9]{1,24}$`).MatchString(v) { + errors = append(errors, fmt.Errorf("%s must be between 1 and 24 characters long and can contain only lowercase letters or numbers", k)) + return + } + return warnings, errors +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/_meta.json deleted file mode 100644 index 69c6d4b5b9e9..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", - "readme": "/_/azure-rest-api-specs/specification/healthcareapis/resource-manager/readme.md", - "tag": "package-2020-03-30", - "use": "@microsoft.azure/autorest.go@2.1.187", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2020-03-30 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/healthcareapis/resource-manager/readme.md", - "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" - } -} \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/enums.go deleted file mode 100644 index 853d6b5754dc..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/enums.go +++ /dev/null @@ -1,156 +0,0 @@ -package healthcareapis - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// 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} -} - -// ManagedServiceIdentityType enumerates the values for managed service identity type. -type ManagedServiceIdentityType string - -const ( - // None ... - None ManagedServiceIdentityType = "None" - // SystemAssigned ... - SystemAssigned ManagedServiceIdentityType = "SystemAssigned" -) - -// PossibleManagedServiceIdentityTypeValues returns an array of possible values for the ManagedServiceIdentityType const type. -func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { - return []ManagedServiceIdentityType{None, SystemAssigned} -} - -// 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} -} - -// PrivateEndpointConnectionProvisioningState enumerates the values for private endpoint connection -// provisioning state. -type PrivateEndpointConnectionProvisioningState string - -const ( - // PrivateEndpointConnectionProvisioningStateCreating ... - PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" - // PrivateEndpointConnectionProvisioningStateDeleting ... - PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" - // PrivateEndpointConnectionProvisioningStateFailed ... - PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" - // PrivateEndpointConnectionProvisioningStateSucceeded ... - PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" -) - -// PossiblePrivateEndpointConnectionProvisioningStateValues returns an array of possible values for the PrivateEndpointConnectionProvisioningState const type. -func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { - return []PrivateEndpointConnectionProvisioningState{PrivateEndpointConnectionProvisioningStateCreating, PrivateEndpointConnectionProvisioningStateDeleting, PrivateEndpointConnectionProvisioningStateFailed, PrivateEndpointConnectionProvisioningStateSucceeded} -} - -// PrivateEndpointServiceConnectionStatus enumerates the values for private endpoint service connection status. -type PrivateEndpointServiceConnectionStatus string - -const ( - // Approved ... - Approved PrivateEndpointServiceConnectionStatus = "Approved" - // Pending ... - Pending PrivateEndpointServiceConnectionStatus = "Pending" - // Rejected ... - Rejected PrivateEndpointServiceConnectionStatus = "Rejected" -) - -// PossiblePrivateEndpointServiceConnectionStatusValues returns an array of possible values for the PrivateEndpointServiceConnectionStatus const type. -func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { - return []PrivateEndpointServiceConnectionStatus{Approved, Pending, Rejected} -} - -// 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} -} - -// PublicNetworkAccess enumerates the values for public network access. -type PublicNetworkAccess string - -const ( - // Disabled ... - Disabled PublicNetworkAccess = "Disabled" - // Enabled ... - Enabled PublicNetworkAccess = "Enabled" -) - -// PossiblePublicNetworkAccessValues returns an array of possible values for the PublicNetworkAccess const type. -func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { - return []PublicNetworkAccess{Disabled, Enabled} -} - -// 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} -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/models.go deleted file mode 100644 index 0ae136e67319..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/models.go +++ /dev/null @@ -1,1217 +0,0 @@ -package healthcareapis - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -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/2020-03-30/healthcareapis" - -// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. -type AzureEntityResource struct { - // Etag - READ-ONLY; Resource Etag. - Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureEntityResource. -func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// 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"` -} - -// MarshalJSON is the custom marshaler for ErrorDetailsInternal. -func (edi ErrorDetailsInternal) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// 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"` -} - -// MarshalJSON is the custom marshaler for Operation. -func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if o.Display != nil { - objectMap["display"] = o.Display - } - return json.Marshal(objectMap) -} - -// 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"` -} - -// MarshalJSON is the custom marshaler for OperationDisplay. -func (od OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// 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"` -} - -// MarshalJSON is the custom marshaler for OperationListResult. -func (olr OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if olr.NextLink != nil { - objectMap["nextLink"] = olr.NextLink - } - return json.Marshal(objectMap) -} - -// 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 -} - -// hasNextLink returns true if the NextLink is not empty. -func (olr OperationListResult) hasNextLink() bool { - return olr.NextLink != nil && len(*olr.NextLink) != 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.hasNextLink() { - 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) - }() - } - for { - next, err := page.fn(ctx, page.olr) - if err != nil { - return err - } - page.olr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - 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(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { - return OperationListResultPage{ - fn: getNextPage, - olr: cur, - } -} - -// 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"` -} - -// MarshalJSON is the custom marshaler for OperationResultsDescription. -func (ord OperationResultsDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ord.Properties != nil { - objectMap["properties"] = ord.Properties - } - return json.Marshal(objectMap) -} - -// PrivateEndpoint the Private Endpoint resource. -type PrivateEndpoint struct { - // ID - READ-ONLY; The ARM identifier for Private Endpoint - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpoint. -func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PrivateEndpointConnection the Private Endpoint Connection resource. -type PrivateEndpointConnection struct { - autorest.Response `json:"-"` - // PrivateEndpointConnectionProperties - Resource properties. - *PrivateEndpointConnectionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointConnection. -func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pec.PrivateEndpointConnectionProperties != nil { - objectMap["properties"] = pec.PrivateEndpointConnectionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. -func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateEndpointConnectionProperties PrivateEndpointConnectionProperties - err = json.Unmarshal(*v, &privateEndpointConnectionProperties) - if err != nil { - return err - } - pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pec.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pec.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pec.Type = &typeVar - } - } - } - - return nil -} - -// PrivateEndpointConnectionListResult list of private endpoint connection associated with the specified -// storage account -type PrivateEndpointConnectionListResult struct { - autorest.Response `json:"-"` - // Value - Array of private endpoint connections - Value *[]PrivateEndpointConnection `json:"value,omitempty"` -} - -// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties. -type PrivateEndpointConnectionProperties struct { - // PrivateEndpoint - The resource of private end point. - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - // ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'PrivateEndpointConnectionProvisioningStateSucceeded', 'PrivateEndpointConnectionProvisioningStateCreating', 'PrivateEndpointConnectionProvisioningStateDeleting', 'PrivateEndpointConnectionProvisioningStateFailed' - ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` -} - -// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type PrivateEndpointConnectionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateEndpointConnectionsCreateOrUpdateFuture.Result. -func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "healthcareapis.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pec.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("healthcareapis.PrivateEndpointConnectionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { - pec, err = client.CreateOrUpdateResponder(pec.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "healthcareapis.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request") - } - } - return -} - -// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateEndpointConnectionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateEndpointConnectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result. -func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "healthcareapis.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("healthcareapis.PrivateEndpointConnectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PrivateLinkResource a private link resource -type PrivateLinkResource struct { - autorest.Response `json:"-"` - // PrivateLinkResourceProperties - Resource properties. - *PrivateLinkResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkResource. -func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plr.PrivateLinkResourceProperties != nil { - objectMap["properties"] = plr.PrivateLinkResourceProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. -func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateLinkResourceProperties PrivateLinkResourceProperties - err = json.Unmarshal(*v, &privateLinkResourceProperties) - if err != nil { - return err - } - plr.PrivateLinkResourceProperties = &privateLinkResourceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - plr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - plr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - plr.Type = &typeVar - } - } - } - - return nil -} - -// PrivateLinkResourceListResult a list of private link resources -type PrivateLinkResourceListResult struct { - autorest.Response `json:"-"` - // Value - Array of private link resources - Value *[]PrivateLinkResource `json:"value,omitempty"` -} - -// PrivateLinkResourceProperties properties of a private link resource. -type PrivateLinkResourceProperties struct { - // GroupID - READ-ONLY; The private link resource group id. - GroupID *string `json:"groupId,omitempty"` - // RequiredMembers - READ-ONLY; The private link resource required member names. - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - // RequiredZoneNames - The private link resource Private link DNS zone name. - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. -func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plrp.RequiredZoneNames != nil { - objectMap["requiredZoneNames"] = plrp.RequiredZoneNames - } - return json.Marshal(objectMap) -} - -// PrivateLinkServiceConnectionState a collection of information about the state of the connection between -// service consumer and provider. -type PrivateLinkServiceConnectionState struct { - // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected' - Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` - // Description - The reason for approval/rejection of the connection. - Description *string `json:"description,omitempty"` - // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. - ActionsRequired *string `json:"actionsRequired,omitempty"` -} - -// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not -// have tags and a location -type ProxyResource struct { - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProxyResource. -func (pr ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// Resource common fields that are returned in the response for all Azure Resource Manager resources -type Resource struct { - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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"` - // KeyVaultKeyURI - The URI of the customer-managed key for the backing database. - KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` -} - -// ServiceExportConfigurationInfo export operation configuration information -type ServiceExportConfigurationInfo struct { - // StorageAccountName - The name of the default export storage account. - StorageAccountName *string `json:"storageAccountName,omitempty"` -} - -// ServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServicesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ServicesClient) (ServicesDescription, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ServicesCreateOrUpdateFuture.Result. -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 { - sd.Response.Response = future.Response() - 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.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServicesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ServicesDeleteFuture.Result. -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 { - ar.Response = future.Response() - 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"` - // Identity - Setting indicating whether the service has a managed identity associated with it. - Identity *ServicesResourceIdentity `json:"identity,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 - } - if sd.Identity != nil { - objectMap["identity"] = sd.Identity - } - 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 -} - -// hasNextLink returns true if the NextLink is not empty. -func (sdlr ServicesDescriptionListResult) hasNextLink() bool { - return sdlr.NextLink != nil && len(*sdlr.NextLink) != 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.hasNextLink() { - 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) - }() - } - for { - next, err := page.fn(ctx, page.sdlr) - if err != nil { - return err - } - page.sdlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - 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(cur ServicesDescriptionListResult, getNextPage func(context.Context, ServicesDescriptionListResult) (ServicesDescriptionListResult, error)) ServicesDescriptionListResultPage { - return ServicesDescriptionListResultPage{ - fn: getNextPage, - sdlr: cur, - } -} - -// 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"` -} - -// MarshalJSON is the custom marshaler for ServicesNameAvailabilityInfo. -func (snai ServicesNameAvailabilityInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if snai.Message != nil { - objectMap["message"] = snai.Message - } - return json.Marshal(objectMap) -} - -// ServicesPatchDescription the description of the service. -type ServicesPatchDescription struct { - // Tags - Instance tags - Tags map[string]*string `json:"tags"` - // ServicesPropertiesUpdateParameters - The properties for updating a service instance. - *ServicesPropertiesUpdateParameters `json:"properties,omitempty"` -} - -// 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 - } - if spd.ServicesPropertiesUpdateParameters != nil { - objectMap["properties"] = spd.ServicesPropertiesUpdateParameters - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServicesPatchDescription struct. -func (spd *ServicesPatchDescription) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - spd.Tags = tags - } - case "properties": - if v != nil { - var servicesPropertiesUpdateParameters ServicesPropertiesUpdateParameters - err = json.Unmarshal(*v, &servicesPropertiesUpdateParameters) - if err != nil { - return err - } - spd.ServicesPropertiesUpdateParameters = &servicesPropertiesUpdateParameters - } - } - } - - return nil -} - -// 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"` - // ExportConfiguration - The settings for the export operation of the service instance. - ExportConfiguration *ServiceExportConfigurationInfo `json:"exportConfiguration,omitempty"` - // PrivateEndpointConnections - The list of private endpoint connections that are set up for this resource. - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - // PublicNetworkAccess - Control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: 'Enabled', 'Disabled' - PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServicesProperties. -func (sp ServicesProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sp.AccessPolicies != nil { - objectMap["accessPolicies"] = sp.AccessPolicies - } - if sp.CosmosDbConfiguration != nil { - objectMap["cosmosDbConfiguration"] = sp.CosmosDbConfiguration - } - if sp.AuthenticationConfiguration != nil { - objectMap["authenticationConfiguration"] = sp.AuthenticationConfiguration - } - if sp.CorsConfiguration != nil { - objectMap["corsConfiguration"] = sp.CorsConfiguration - } - if sp.ExportConfiguration != nil { - objectMap["exportConfiguration"] = sp.ExportConfiguration - } - if sp.PrivateEndpointConnections != nil { - objectMap["privateEndpointConnections"] = sp.PrivateEndpointConnections - } - if sp.PublicNetworkAccess != "" { - objectMap["publicNetworkAccess"] = sp.PublicNetworkAccess - } - return json.Marshal(objectMap) -} - -// ServicesPropertiesUpdateParameters the properties for updating a service instance. -type ServicesPropertiesUpdateParameters struct { - // PublicNetworkAccess - Control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: 'Enabled', 'Disabled' - PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` -} - -// ServicesResource the common properties of a service. -type ServicesResource 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"` - // Identity - Setting indicating whether the service has a managed identity associated with it. - Identity *ServicesResourceIdentity `json:"identity,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServicesResource. -func (sr ServicesResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sr.Kind != "" { - objectMap["kind"] = sr.Kind - } - if sr.Location != nil { - objectMap["location"] = sr.Location - } - if sr.Tags != nil { - objectMap["tags"] = sr.Tags - } - if sr.Etag != nil { - objectMap["etag"] = sr.Etag - } - if sr.Identity != nil { - objectMap["identity"] = sr.Identity - } - return json.Marshal(objectMap) -} - -// ServicesResourceIdentity setting indicating whether the service has a managed identity associated with -// it. -type ServicesResourceIdentity struct { - // PrincipalID - READ-ONLY; The principal ID of the resource identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant ID of the resource. - TenantID *string `json:"tenantId,omitempty"` - // Type - Type of identity being specified, currently SystemAssigned and None are allowed. Possible values include: 'SystemAssigned', 'None' - Type ManagedServiceIdentityType `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServicesResourceIdentity. -func (sr ServicesResourceIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sr.Type != "" { - objectMap["type"] = sr.Type - } - return json.Marshal(objectMap) -} - -// ServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServicesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ServicesClient) (ServicesDescription, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServicesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ServicesUpdateFuture.Result. -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 { - sd.Response.Response = future.Response() - 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"` -} - -// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource -// which has 'tags' and a 'location' -type TrackedResource struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // Location - The geo-location where the resource lives - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for TrackedResource. -func (tr TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tr.Tags != nil { - objectMap["tags"] = tr.Tags - } - if tr.Location != nil { - objectMap["location"] = tr.Location - } - return json.Marshal(objectMap) -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/CHANGELOG.md similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/CHANGELOG.md rename to vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/CHANGELOG.md diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/_meta.json new file mode 100644 index 000000000000..bddcbd6c46f3 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "58cb0aa2979e64c7335cc26fe45a1854a6d0b7ad", + "readme": "/_/azure-rest-api-specs/specification/healthcareapis/resource-manager/readme.md", + "tag": "package-2021-11", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-11 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/healthcareapis/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" + } +} \ No newline at end of file diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/client.go similarity index 97% rename from vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/client.go index 6bd99e47fcf3..9d4d4a46ff86 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/client.go @@ -1,4 +1,4 @@ -// Package healthcareapis implements the Azure ARM Healthcareapis service API version 2020-03-30. +// Package healthcareapis implements the Azure ARM Healthcareapis service API version 2021-11-01. // // Azure Healthcare APIs Client package healthcareapis diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/dicomservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/dicomservices.go new file mode 100644 index 000000000000..72d80b1477e7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/dicomservices.go @@ -0,0 +1,543 @@ +package healthcareapis + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +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" +) + +// DicomServicesClient is the azure Healthcare APIs Client +type DicomServicesClient struct { + BaseClient +} + +// NewDicomServicesClient creates an instance of the DicomServicesClient client. +func NewDicomServicesClient(subscriptionID string) DicomServicesClient { + return NewDicomServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDicomServicesClientWithBaseURI creates an instance of the DicomServicesClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewDicomServicesClientWithBaseURI(baseURI string, subscriptionID string) DicomServicesClient { + return DicomServicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a DICOM Service resource with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +// dicomServiceName - the name of DICOM Service resource. +// dicomservice - the parameters for creating or updating a Dicom Service resource. +func (client DicomServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, dicomServiceName string, dicomservice DicomService) (result DicomServicesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DicomServicesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: dicomServiceName, + Constraints: []validation.Constraint{{Target: "dicomServiceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "dicomServiceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.DicomServicesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, dicomServiceName, dicomservice) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DicomServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, dicomServiceName string, dicomservice DicomService) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dicomServiceName": autorest.Encode("path", dicomServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", pathParameters), + autorest.WithJSON(dicomservice), + 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 DicomServicesClient) CreateOrUpdateSender(req *http.Request) (future DicomServicesCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DicomServicesClient) CreateOrUpdateResponder(resp *http.Response) (result DicomService, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a DICOM Service. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// dicomServiceName - the name of DICOM Service resource. +// workspaceName - the name of workspace resource. +func (client DicomServicesClient) Delete(ctx context.Context, resourceGroupName string, dicomServiceName string, workspaceName string) (result DicomServicesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DicomServicesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.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: dicomServiceName, + Constraints: []validation.Constraint{{Target: "dicomServiceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "dicomServiceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.DicomServicesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, dicomServiceName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DicomServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, dicomServiceName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dicomServiceName": autorest.Encode("path", dicomServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", 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 DicomServicesClient) DeleteSender(req *http.Request) (future DicomServicesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DicomServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified DICOM Service. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +// dicomServiceName - the name of DICOM Service resource. +func (client DicomServicesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, dicomServiceName string) (result DicomService, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DicomServicesClient.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: dicomServiceName, + Constraints: []validation.Constraint{{Target: "dicomServiceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "dicomServiceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.DicomServicesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, dicomServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesClient", "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.DicomServicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DicomServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, dicomServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dicomServiceName": autorest.Encode("path", dicomServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", 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 DicomServicesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DicomServicesClient) GetResponder(resp *http.Response) (result DicomService, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace lists all DICOM Services for the given workspace +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +func (client DicomServicesClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result DicomServiceCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DicomServicesClient.ListByWorkspace") + defer func() { + sc := -1 + if result.dsc.Response.Response != nil { + sc = result.dsc.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.DicomServicesClient", "ListByWorkspace", err.Error()) + } + + result.fn = client.listByWorkspaceNextResults + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.dsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result.dsc, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesClient", "ListByWorkspace", resp, "Failure responding to request") + return + } + if result.dsc.hasNextLink() && result.dsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client DicomServicesClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/dicomservices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client DicomServicesClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client DicomServicesClient) ListByWorkspaceResponder(resp *http.Response) (result DicomServiceCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByWorkspaceNextResults retrieves the next set of results, if any. +func (client DicomServicesClient) listByWorkspaceNextResults(ctx context.Context, lastResults DicomServiceCollection) (result DicomServiceCollection, err error) { + req, err := lastResults.dicomServiceCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "healthcareapis.DicomServicesClient", "listByWorkspaceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "healthcareapis.DicomServicesClient", "listByWorkspaceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesClient", "listByWorkspaceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByWorkspaceComplete enumerates all values, automatically crossing page boundaries as required. +func (client DicomServicesClient) ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result DicomServiceCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DicomServicesClient.ListByWorkspace") + 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.ListByWorkspace(ctx, resourceGroupName, workspaceName) + return +} + +// Update patch DICOM Service details. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// dicomServiceName - the name of DICOM Service resource. +// workspaceName - the name of workspace resource. +// dicomservicePatchResource - the parameters for updating a Dicom Service. +func (client DicomServicesClient) Update(ctx context.Context, resourceGroupName string, dicomServiceName string, workspaceName string, dicomservicePatchResource DicomServicePatchResource) (result DicomServicesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DicomServicesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.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: dicomServiceName, + Constraints: []validation.Constraint{{Target: "dicomServiceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "dicomServiceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.DicomServicesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, dicomServiceName, workspaceName, dicomservicePatchResource) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DicomServicesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, dicomServiceName string, workspaceName string, dicomservicePatchResource DicomServicePatchResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dicomServiceName": autorest.Encode("path", dicomServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/dicomservices/{dicomServiceName}", pathParameters), + autorest.WithJSON(dicomservicePatchResource), + 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 DicomServicesClient) UpdateSender(req *http.Request) (future DicomServicesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DicomServicesClient) UpdateResponder(resp *http.Response) (result DicomService, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/enums.go new file mode 100644 index 000000000000..2af1c222526a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/enums.go @@ -0,0 +1,279 @@ +package healthcareapis + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// ActionType enumerates the values for action type. +type ActionType string + +const ( + // ActionTypeInternal ... + ActionTypeInternal ActionType = "Internal" +) + +// PossibleActionTypeValues returns an array of possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ActionTypeInternal} +} + +// CreatedByType enumerates the values for created by type. +type CreatedByType string + +const ( + // CreatedByTypeApplication ... + CreatedByTypeApplication CreatedByType = "Application" + // CreatedByTypeKey ... + CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeManagedIdentity ... + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + // CreatedByTypeUser ... + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{CreatedByTypeApplication, CreatedByTypeKey, CreatedByTypeManagedIdentity, CreatedByTypeUser} +} + +// FhirResourceVersionPolicy enumerates the values for fhir resource version policy. +type FhirResourceVersionPolicy string + +const ( + // FhirResourceVersionPolicyNoVersion ... + FhirResourceVersionPolicyNoVersion FhirResourceVersionPolicy = "no-version" + // FhirResourceVersionPolicyVersioned ... + FhirResourceVersionPolicyVersioned FhirResourceVersionPolicy = "versioned" + // FhirResourceVersionPolicyVersionedUpdate ... + FhirResourceVersionPolicyVersionedUpdate FhirResourceVersionPolicy = "versioned-update" +) + +// PossibleFhirResourceVersionPolicyValues returns an array of possible values for the FhirResourceVersionPolicy const type. +func PossibleFhirResourceVersionPolicyValues() []FhirResourceVersionPolicy { + return []FhirResourceVersionPolicy{FhirResourceVersionPolicyNoVersion, FhirResourceVersionPolicyVersioned, FhirResourceVersionPolicyVersionedUpdate} +} + +// FhirServiceKind enumerates the values for fhir service kind. +type FhirServiceKind string + +const ( + // FhirServiceKindFhirR4 ... + FhirServiceKindFhirR4 FhirServiceKind = "fhir-R4" + // FhirServiceKindFhirStu3 ... + FhirServiceKindFhirStu3 FhirServiceKind = "fhir-Stu3" +) + +// PossibleFhirServiceKindValues returns an array of possible values for the FhirServiceKind const type. +func PossibleFhirServiceKindValues() []FhirServiceKind { + return []FhirServiceKind{FhirServiceKindFhirR4, FhirServiceKindFhirStu3} +} + +// IotIdentityResolutionType enumerates the values for iot identity resolution type. +type IotIdentityResolutionType string + +const ( + // IotIdentityResolutionTypeCreate ... + IotIdentityResolutionTypeCreate IotIdentityResolutionType = "Create" + // IotIdentityResolutionTypeLookup ... + IotIdentityResolutionTypeLookup IotIdentityResolutionType = "Lookup" +) + +// PossibleIotIdentityResolutionTypeValues returns an array of possible values for the IotIdentityResolutionType const type. +func PossibleIotIdentityResolutionTypeValues() []IotIdentityResolutionType { + return []IotIdentityResolutionType{IotIdentityResolutionTypeCreate, IotIdentityResolutionTypeLookup} +} + +// Kind enumerates the values for kind. +type Kind string + +const ( + // KindFhir ... + KindFhir Kind = "fhir" + // KindFhirR4 ... + KindFhirR4 Kind = "fhir-R4" + // KindFhirStu3 ... + KindFhirStu3 Kind = "fhir-Stu3" +) + +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{KindFhir, KindFhirR4, KindFhirStu3} +} + +// ManagedServiceIdentityType enumerates the values for managed service identity type. +type ManagedServiceIdentityType string + +const ( + // ManagedServiceIdentityTypeNone ... + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" + // ManagedServiceIdentityTypeSystemAssigned ... + ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" +) + +// PossibleManagedServiceIdentityTypeValues returns an array of possible values for the ManagedServiceIdentityType const type. +func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { + return []ManagedServiceIdentityType{ManagedServiceIdentityTypeNone, ManagedServiceIdentityTypeSystemAssigned} +} + +// OperationResultStatus enumerates the values for operation result status. +type OperationResultStatus string + +const ( + // OperationResultStatusCanceled ... + OperationResultStatusCanceled OperationResultStatus = "Canceled" + // OperationResultStatusFailed ... + OperationResultStatusFailed OperationResultStatus = "Failed" + // OperationResultStatusRequested ... + OperationResultStatusRequested OperationResultStatus = "Requested" + // OperationResultStatusRunning ... + OperationResultStatusRunning OperationResultStatus = "Running" + // OperationResultStatusSucceeded ... + OperationResultStatusSucceeded OperationResultStatus = "Succeeded" +) + +// PossibleOperationResultStatusValues returns an array of possible values for the OperationResultStatus const type. +func PossibleOperationResultStatusValues() []OperationResultStatus { + return []OperationResultStatus{OperationResultStatusCanceled, OperationResultStatusFailed, OperationResultStatusRequested, OperationResultStatusRunning, OperationResultStatusSucceeded} +} + +// PrivateEndpointConnectionProvisioningState enumerates the values for private endpoint connection +// provisioning state. +type PrivateEndpointConnectionProvisioningState string + +const ( + // PrivateEndpointConnectionProvisioningStateCreating ... + PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" + // PrivateEndpointConnectionProvisioningStateDeleting ... + PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" + // PrivateEndpointConnectionProvisioningStateFailed ... + PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + // PrivateEndpointConnectionProvisioningStateSucceeded ... + PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" +) + +// PossiblePrivateEndpointConnectionProvisioningStateValues returns an array of possible values for the PrivateEndpointConnectionProvisioningState const type. +func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { + return []PrivateEndpointConnectionProvisioningState{PrivateEndpointConnectionProvisioningStateCreating, PrivateEndpointConnectionProvisioningStateDeleting, PrivateEndpointConnectionProvisioningStateFailed, PrivateEndpointConnectionProvisioningStateSucceeded} +} + +// PrivateEndpointServiceConnectionStatus enumerates the values for private endpoint service connection status. +type PrivateEndpointServiceConnectionStatus string + +const ( + // PrivateEndpointServiceConnectionStatusApproved ... + PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" + // PrivateEndpointServiceConnectionStatusPending ... + PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" + // PrivateEndpointServiceConnectionStatusRejected ... + PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" +) + +// PossiblePrivateEndpointServiceConnectionStatusValues returns an array of possible values for the PrivateEndpointServiceConnectionStatus const type. +func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { + return []PrivateEndpointServiceConnectionStatus{PrivateEndpointServiceConnectionStatusApproved, PrivateEndpointServiceConnectionStatusPending, PrivateEndpointServiceConnectionStatusRejected} +} + +// 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" + // ProvisioningStateMoving ... + ProvisioningStateMoving ProvisioningState = "Moving" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateSuspended ... + ProvisioningStateSuspended ProvisioningState = "Suspended" + // ProvisioningStateSystemMaintenance ... + ProvisioningStateSystemMaintenance ProvisioningState = "SystemMaintenance" + // ProvisioningStateUpdating ... + ProvisioningStateUpdating ProvisioningState = "Updating" + // ProvisioningStateVerifying ... + ProvisioningStateVerifying ProvisioningState = "Verifying" + // ProvisioningStateWarned ... + ProvisioningStateWarned ProvisioningState = "Warned" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateAccepted, ProvisioningStateCanceled, ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateDeprovisioned, ProvisioningStateFailed, ProvisioningStateMoving, ProvisioningStateSucceeded, ProvisioningStateSuspended, ProvisioningStateSystemMaintenance, ProvisioningStateUpdating, ProvisioningStateVerifying, ProvisioningStateWarned} +} + +// PublicNetworkAccess enumerates the values for public network access. +type PublicNetworkAccess string + +const ( + // PublicNetworkAccessDisabled ... + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + // PublicNetworkAccessEnabled ... + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" +) + +// PossiblePublicNetworkAccessValues returns an array of possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{PublicNetworkAccessDisabled, PublicNetworkAccessEnabled} +} + +// ServiceEventState enumerates the values for service event state. +type ServiceEventState string + +const ( + // ServiceEventStateDisabled ... + ServiceEventStateDisabled ServiceEventState = "Disabled" + // ServiceEventStateEnabled ... + ServiceEventStateEnabled ServiceEventState = "Enabled" + // ServiceEventStateUpdating ... + ServiceEventStateUpdating ServiceEventState = "Updating" +) + +// PossibleServiceEventStateValues returns an array of possible values for the ServiceEventState const type. +func PossibleServiceEventStateValues() []ServiceEventState { + return []ServiceEventState{ServiceEventStateDisabled, ServiceEventStateEnabled, ServiceEventStateUpdating} +} + +// ServiceManagedIdentityType enumerates the values for service managed identity type. +type ServiceManagedIdentityType string + +const ( + // ServiceManagedIdentityTypeNone ... + ServiceManagedIdentityTypeNone ServiceManagedIdentityType = "None" + // ServiceManagedIdentityTypeSystemAssigned ... + ServiceManagedIdentityTypeSystemAssigned ServiceManagedIdentityType = "SystemAssigned" + // ServiceManagedIdentityTypeSystemAssignedUserAssigned ... + ServiceManagedIdentityTypeSystemAssignedUserAssigned ServiceManagedIdentityType = "SystemAssigned,UserAssigned" + // ServiceManagedIdentityTypeUserAssigned ... + ServiceManagedIdentityTypeUserAssigned ServiceManagedIdentityType = "UserAssigned" +) + +// PossibleServiceManagedIdentityTypeValues returns an array of possible values for the ServiceManagedIdentityType const type. +func PossibleServiceManagedIdentityTypeValues() []ServiceManagedIdentityType { + return []ServiceManagedIdentityType{ServiceManagedIdentityTypeNone, ServiceManagedIdentityTypeSystemAssigned, ServiceManagedIdentityTypeSystemAssignedUserAssigned, ServiceManagedIdentityTypeUserAssigned} +} + +// ServiceNameUnavailabilityReason enumerates the values for service name unavailability reason. +type ServiceNameUnavailabilityReason string + +const ( + // ServiceNameUnavailabilityReasonAlreadyExists ... + ServiceNameUnavailabilityReasonAlreadyExists ServiceNameUnavailabilityReason = "AlreadyExists" + // ServiceNameUnavailabilityReasonInvalid ... + ServiceNameUnavailabilityReasonInvalid ServiceNameUnavailabilityReason = "Invalid" +) + +// PossibleServiceNameUnavailabilityReasonValues returns an array of possible values for the ServiceNameUnavailabilityReason const type. +func PossibleServiceNameUnavailabilityReasonValues() []ServiceNameUnavailabilityReason { + return []ServiceNameUnavailabilityReason{ServiceNameUnavailabilityReasonAlreadyExists, ServiceNameUnavailabilityReasonInvalid} +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/fhirdestinations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/fhirdestinations.go new file mode 100644 index 000000000000..af742b585dc7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/fhirdestinations.go @@ -0,0 +1,167 @@ +package healthcareapis + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +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" +) + +// FhirDestinationsClient is the azure Healthcare APIs Client +type FhirDestinationsClient struct { + BaseClient +} + +// NewFhirDestinationsClient creates an instance of the FhirDestinationsClient client. +func NewFhirDestinationsClient(subscriptionID string) FhirDestinationsClient { + return NewFhirDestinationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewFhirDestinationsClientWithBaseURI creates an instance of the FhirDestinationsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewFhirDestinationsClientWithBaseURI(baseURI string, subscriptionID string) FhirDestinationsClient { + return FhirDestinationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByIotConnector lists all FHIR destinations for the given IoT Connector +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +// iotConnectorName - the name of IoT Connector resource. +func (client FhirDestinationsClient) ListByIotConnector(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string) (result IotFhirDestinationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FhirDestinationsClient.ListByIotConnector") + defer func() { + sc := -1 + if result.ifdc.Response.Response != nil { + sc = result.ifdc.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: iotConnectorName, + Constraints: []validation.Constraint{{Target: "iotConnectorName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "iotConnectorName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.FhirDestinationsClient", "ListByIotConnector", err.Error()) + } + + result.fn = client.listByIotConnectorNextResults + req, err := client.ListByIotConnectorPreparer(ctx, resourceGroupName, workspaceName, iotConnectorName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirDestinationsClient", "ListByIotConnector", nil, "Failure preparing request") + return + } + + resp, err := client.ListByIotConnectorSender(req) + if err != nil { + result.ifdc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "healthcareapis.FhirDestinationsClient", "ListByIotConnector", resp, "Failure sending request") + return + } + + result.ifdc, err = client.ListByIotConnectorResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirDestinationsClient", "ListByIotConnector", resp, "Failure responding to request") + return + } + if result.ifdc.hasNextLink() && result.ifdc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByIotConnectorPreparer prepares the ListByIotConnector request. +func (client FhirDestinationsClient) ListByIotConnectorPreparer(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "iotConnectorName": autorest.Encode("path", iotConnectorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByIotConnectorSender sends the ListByIotConnector request. The method will close the +// http.Response Body if it receives an error. +func (client FhirDestinationsClient) ListByIotConnectorSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByIotConnectorResponder handles the response to the ListByIotConnector request. The method always +// closes the http.Response Body. +func (client FhirDestinationsClient) ListByIotConnectorResponder(resp *http.Response) (result IotFhirDestinationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByIotConnectorNextResults retrieves the next set of results, if any. +func (client FhirDestinationsClient) listByIotConnectorNextResults(ctx context.Context, lastResults IotFhirDestinationCollection) (result IotFhirDestinationCollection, err error) { + req, err := lastResults.iotFhirDestinationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "healthcareapis.FhirDestinationsClient", "listByIotConnectorNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByIotConnectorSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "healthcareapis.FhirDestinationsClient", "listByIotConnectorNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByIotConnectorResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirDestinationsClient", "listByIotConnectorNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByIotConnectorComplete enumerates all values, automatically crossing page boundaries as required. +func (client FhirDestinationsClient) ListByIotConnectorComplete(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string) (result IotFhirDestinationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FhirDestinationsClient.ListByIotConnector") + 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.ListByIotConnector(ctx, resourceGroupName, workspaceName, iotConnectorName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/fhirservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/fhirservices.go new file mode 100644 index 000000000000..ac6d54cb95f8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/fhirservices.go @@ -0,0 +1,552 @@ +package healthcareapis + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +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" +) + +// FhirServicesClient is the azure Healthcare APIs Client +type FhirServicesClient struct { + BaseClient +} + +// NewFhirServicesClient creates an instance of the FhirServicesClient client. +func NewFhirServicesClient(subscriptionID string) FhirServicesClient { + return NewFhirServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewFhirServicesClientWithBaseURI creates an instance of the FhirServicesClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewFhirServicesClientWithBaseURI(baseURI string, subscriptionID string) FhirServicesClient { + return FhirServicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a FHIR Service resource with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +// fhirServiceName - the name of FHIR Service resource. +// fhirservice - the parameters for creating or updating a Fhir Service resource. +func (client FhirServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, fhirServiceName string, fhirservice FhirService) (result FhirServicesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FhirServicesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: fhirServiceName, + Constraints: []validation.Constraint{{Target: "fhirServiceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "fhirServiceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: fhirservice, + Constraints: []validation.Constraint{{Target: "fhirservice.FhirServiceProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "fhirservice.FhirServiceProperties.CorsConfiguration", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "fhirservice.FhirServiceProperties.CorsConfiguration.MaxAge", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "fhirservice.FhirServiceProperties.CorsConfiguration.MaxAge", Name: validation.InclusiveMaximum, Rule: int64(99999), Chain: nil}, + {Target: "fhirservice.FhirServiceProperties.CorsConfiguration.MaxAge", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("healthcareapis.FhirServicesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, fhirServiceName, fhirservice) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client FhirServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, fhirServiceName string, fhirservice FhirService) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fhirServiceName": autorest.Encode("path", fhirServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", pathParameters), + autorest.WithJSON(fhirservice), + 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 FhirServicesClient) CreateOrUpdateSender(req *http.Request) (future FhirServicesCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client FhirServicesClient) CreateOrUpdateResponder(resp *http.Response) (result FhirService, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a FHIR Service. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// fhirServiceName - the name of FHIR Service resource. +// workspaceName - the name of workspace resource. +func (client FhirServicesClient) Delete(ctx context.Context, resourceGroupName string, fhirServiceName string, workspaceName string) (result FhirServicesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FhirServicesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.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: fhirServiceName, + Constraints: []validation.Constraint{{Target: "fhirServiceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "fhirServiceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.FhirServicesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, fhirServiceName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client FhirServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, fhirServiceName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fhirServiceName": autorest.Encode("path", fhirServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", 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 FhirServicesClient) DeleteSender(req *http.Request) (future FhirServicesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client FhirServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified FHIR Service. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +// fhirServiceName - the name of FHIR Service resource. +func (client FhirServicesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, fhirServiceName string) (result FhirService, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FhirServicesClient.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: fhirServiceName, + Constraints: []validation.Constraint{{Target: "fhirServiceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "fhirServiceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.FhirServicesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, fhirServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesClient", "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.FhirServicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client FhirServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, fhirServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fhirServiceName": autorest.Encode("path", fhirServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", 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 FhirServicesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client FhirServicesClient) GetResponder(resp *http.Response) (result FhirService, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace lists all FHIR Services for the given workspace +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +func (client FhirServicesClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result FhirServiceCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FhirServicesClient.ListByWorkspace") + defer func() { + sc := -1 + if result.fsc.Response.Response != nil { + sc = result.fsc.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.FhirServicesClient", "ListByWorkspace", err.Error()) + } + + result.fn = client.listByWorkspaceNextResults + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.fsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result.fsc, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesClient", "ListByWorkspace", resp, "Failure responding to request") + return + } + if result.fsc.hasNextLink() && result.fsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client FhirServicesClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/fhirservices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client FhirServicesClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client FhirServicesClient) ListByWorkspaceResponder(resp *http.Response) (result FhirServiceCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByWorkspaceNextResults retrieves the next set of results, if any. +func (client FhirServicesClient) listByWorkspaceNextResults(ctx context.Context, lastResults FhirServiceCollection) (result FhirServiceCollection, err error) { + req, err := lastResults.fhirServiceCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "healthcareapis.FhirServicesClient", "listByWorkspaceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "healthcareapis.FhirServicesClient", "listByWorkspaceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesClient", "listByWorkspaceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByWorkspaceComplete enumerates all values, automatically crossing page boundaries as required. +func (client FhirServicesClient) ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result FhirServiceCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FhirServicesClient.ListByWorkspace") + 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.ListByWorkspace(ctx, resourceGroupName, workspaceName) + return +} + +// Update patch FHIR Service details. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// fhirServiceName - the name of FHIR Service resource. +// workspaceName - the name of workspace resource. +// fhirservicePatchResource - the parameters for updating a Fhir Service. +func (client FhirServicesClient) Update(ctx context.Context, resourceGroupName string, fhirServiceName string, workspaceName string, fhirservicePatchResource FhirServicePatchResource) (result FhirServicesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FhirServicesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.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: fhirServiceName, + Constraints: []validation.Constraint{{Target: "fhirServiceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "fhirServiceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.FhirServicesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, fhirServiceName, workspaceName, fhirservicePatchResource) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client FhirServicesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, fhirServiceName string, workspaceName string, fhirservicePatchResource FhirServicePatchResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fhirServiceName": autorest.Encode("path", fhirServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/fhirservices/{fhirServiceName}", pathParameters), + autorest.WithJSON(fhirservicePatchResource), + 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 FhirServicesClient) UpdateSender(req *http.Request) (future FhirServicesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client FhirServicesClient) UpdateResponder(resp *http.Response) (result FhirService, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/iotconnectorfhirdestination.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/iotconnectorfhirdestination.go new file mode 100644 index 000000000000..691cd9fc48aa --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/iotconnectorfhirdestination.go @@ -0,0 +1,337 @@ +package healthcareapis + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +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" +) + +// IotConnectorFhirDestinationClient is the azure Healthcare APIs Client +type IotConnectorFhirDestinationClient struct { + BaseClient +} + +// NewIotConnectorFhirDestinationClient creates an instance of the IotConnectorFhirDestinationClient client. +func NewIotConnectorFhirDestinationClient(subscriptionID string) IotConnectorFhirDestinationClient { + return NewIotConnectorFhirDestinationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIotConnectorFhirDestinationClientWithBaseURI creates an instance of the IotConnectorFhirDestinationClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewIotConnectorFhirDestinationClientWithBaseURI(baseURI string, subscriptionID string) IotConnectorFhirDestinationClient { + return IotConnectorFhirDestinationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an IoT Connector FHIR destination resource with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +// iotConnectorName - the name of IoT Connector resource. +// fhirDestinationName - the name of IoT Connector FHIR destination resource. +// iotFhirDestination - the parameters for creating or updating an IoT Connector FHIR destination resource. +func (client IotConnectorFhirDestinationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string, fhirDestinationName string, iotFhirDestination IotFhirDestination) (result IotConnectorFhirDestinationCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotConnectorFhirDestinationClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: iotConnectorName, + Constraints: []validation.Constraint{{Target: "iotConnectorName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "iotConnectorName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: fhirDestinationName, + Constraints: []validation.Constraint{{Target: "fhirDestinationName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "fhirDestinationName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: iotFhirDestination, + Constraints: []validation.Constraint{{Target: "iotFhirDestination.IotFhirDestinationProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "iotFhirDestination.IotFhirDestinationProperties.FhirServiceResourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "iotFhirDestination.IotFhirDestinationProperties.FhirMapping", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("healthcareapis.IotConnectorFhirDestinationClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, iotFhirDestination) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorFhirDestinationClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorFhirDestinationClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client IotConnectorFhirDestinationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string, fhirDestinationName string, iotFhirDestination IotFhirDestination) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fhirDestinationName": autorest.Encode("path", fhirDestinationName), + "iotConnectorName": autorest.Encode("path", iotConnectorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", pathParameters), + autorest.WithJSON(iotFhirDestination), + 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 IotConnectorFhirDestinationClient) CreateOrUpdateSender(req *http.Request) (future IotConnectorFhirDestinationCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client IotConnectorFhirDestinationClient) CreateOrUpdateResponder(resp *http.Response) (result IotFhirDestination, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an IoT Connector FHIR destination. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +// iotConnectorName - the name of IoT Connector resource. +// fhirDestinationName - the name of IoT Connector FHIR destination resource. +func (client IotConnectorFhirDestinationClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string, fhirDestinationName string) (result IotConnectorFhirDestinationDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotConnectorFhirDestinationClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: iotConnectorName, + Constraints: []validation.Constraint{{Target: "iotConnectorName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "iotConnectorName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: fhirDestinationName, + Constraints: []validation.Constraint{{Target: "fhirDestinationName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "fhirDestinationName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.IotConnectorFhirDestinationClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorFhirDestinationClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorFhirDestinationClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IotConnectorFhirDestinationClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string, fhirDestinationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fhirDestinationName": autorest.Encode("path", fhirDestinationName), + "iotConnectorName": autorest.Encode("path", iotConnectorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", 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 IotConnectorFhirDestinationClient) DeleteSender(req *http.Request) (future IotConnectorFhirDestinationDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IotConnectorFhirDestinationClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified Iot Connector FHIR destination. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +// iotConnectorName - the name of IoT Connector resource. +// fhirDestinationName - the name of IoT Connector FHIR destination resource. +func (client IotConnectorFhirDestinationClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string, fhirDestinationName string) (result IotFhirDestination, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotConnectorFhirDestinationClient.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: iotConnectorName, + Constraints: []validation.Constraint{{Target: "iotConnectorName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "iotConnectorName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: fhirDestinationName, + Constraints: []validation.Constraint{{Target: "fhirDestinationName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "fhirDestinationName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.IotConnectorFhirDestinationClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorFhirDestinationClient", "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.IotConnectorFhirDestinationClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorFhirDestinationClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client IotConnectorFhirDestinationClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string, fhirDestinationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fhirDestinationName": autorest.Encode("path", fhirDestinationName), + "iotConnectorName": autorest.Encode("path", iotConnectorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations/{fhirDestinationName}", 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 IotConnectorFhirDestinationClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IotConnectorFhirDestinationClient) GetResponder(resp *http.Response) (result IotFhirDestination, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/iotconnectors.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/iotconnectors.go new file mode 100644 index 000000000000..600d75a96e4b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/iotconnectors.go @@ -0,0 +1,543 @@ +package healthcareapis + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +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" +) + +// IotConnectorsClient is the azure Healthcare APIs Client +type IotConnectorsClient struct { + BaseClient +} + +// NewIotConnectorsClient creates an instance of the IotConnectorsClient client. +func NewIotConnectorsClient(subscriptionID string) IotConnectorsClient { + return NewIotConnectorsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIotConnectorsClientWithBaseURI creates an instance of the IotConnectorsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewIotConnectorsClientWithBaseURI(baseURI string, subscriptionID string) IotConnectorsClient { + return IotConnectorsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an IoT Connector resource with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +// iotConnectorName - the name of IoT Connector resource. +// iotConnector - the parameters for creating or updating an IoT Connectors resource. +func (client IotConnectorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string, iotConnector IotConnector) (result IotConnectorsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotConnectorsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: iotConnectorName, + Constraints: []validation.Constraint{{Target: "iotConnectorName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "iotConnectorName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.IotConnectorsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, iotConnectorName, iotConnector) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client IotConnectorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string, iotConnector IotConnector) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "iotConnectorName": autorest.Encode("path", iotConnectorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", pathParameters), + autorest.WithJSON(iotConnector), + 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 IotConnectorsClient) CreateOrUpdateSender(req *http.Request) (future IotConnectorsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client IotConnectorsClient) CreateOrUpdateResponder(resp *http.Response) (result IotConnector, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an IoT Connector. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// iotConnectorName - the name of IoT Connector resource. +// workspaceName - the name of workspace resource. +func (client IotConnectorsClient) Delete(ctx context.Context, resourceGroupName string, iotConnectorName string, workspaceName string) (result IotConnectorsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotConnectorsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.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: iotConnectorName, + Constraints: []validation.Constraint{{Target: "iotConnectorName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "iotConnectorName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.IotConnectorsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, iotConnectorName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IotConnectorsClient) DeletePreparer(ctx context.Context, resourceGroupName string, iotConnectorName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "iotConnectorName": autorest.Encode("path", iotConnectorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", 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 IotConnectorsClient) DeleteSender(req *http.Request) (future IotConnectorsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IotConnectorsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified IoT Connector. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +// iotConnectorName - the name of IoT Connector resource. +func (client IotConnectorsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string) (result IotConnector, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotConnectorsClient.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: iotConnectorName, + Constraints: []validation.Constraint{{Target: "iotConnectorName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "iotConnectorName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.IotConnectorsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, iotConnectorName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsClient", "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.IotConnectorsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client IotConnectorsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "iotConnectorName": autorest.Encode("path", iotConnectorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", 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 IotConnectorsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IotConnectorsClient) GetResponder(resp *http.Response) (result IotConnector, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace lists all IoT Connectors for the given workspace +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +func (client IotConnectorsClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result IotConnectorCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotConnectorsClient.ListByWorkspace") + defer func() { + sc := -1 + if result.icc.Response.Response != nil { + sc = result.icc.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.IotConnectorsClient", "ListByWorkspace", err.Error()) + } + + result.fn = client.listByWorkspaceNextResults + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.icc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result.icc, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsClient", "ListByWorkspace", resp, "Failure responding to request") + return + } + if result.icc.hasNextLink() && result.icc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client IotConnectorsClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/iotconnectors", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client IotConnectorsClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client IotConnectorsClient) ListByWorkspaceResponder(resp *http.Response) (result IotConnectorCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByWorkspaceNextResults retrieves the next set of results, if any. +func (client IotConnectorsClient) listByWorkspaceNextResults(ctx context.Context, lastResults IotConnectorCollection) (result IotConnectorCollection, err error) { + req, err := lastResults.iotConnectorCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsClient", "listByWorkspaceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsClient", "listByWorkspaceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsClient", "listByWorkspaceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByWorkspaceComplete enumerates all values, automatically crossing page boundaries as required. +func (client IotConnectorsClient) ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result IotConnectorCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotConnectorsClient.ListByWorkspace") + 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.ListByWorkspace(ctx, resourceGroupName, workspaceName) + return +} + +// Update patch an IoT Connector. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// iotConnectorName - the name of IoT Connector resource. +// workspaceName - the name of workspace resource. +// iotConnectorPatchResource - the parameters for updating an IoT Connector. +func (client IotConnectorsClient) Update(ctx context.Context, resourceGroupName string, iotConnectorName string, workspaceName string, iotConnectorPatchResource IotConnectorPatchResource) (result IotConnectorsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotConnectorsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.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: iotConnectorName, + Constraints: []validation.Constraint{{Target: "iotConnectorName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "iotConnectorName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.IotConnectorsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, iotConnectorName, workspaceName, iotConnectorPatchResource) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client IotConnectorsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, iotConnectorName string, workspaceName string, iotConnectorPatchResource IotConnectorPatchResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "iotConnectorName": autorest.Encode("path", iotConnectorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}", pathParameters), + autorest.WithJSON(iotConnectorPatchResource), + 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 IotConnectorsClient) UpdateSender(req *http.Request) (future IotConnectorsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client IotConnectorsClient) UpdateResponder(resp *http.Response) (result IotConnector, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/models.go new file mode 100644 index 000000000000..2c4bd196969b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/models.go @@ -0,0 +1,3810 @@ +package healthcareapis + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "github.com/gofrs/uuid" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis" + +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureEntityResource. +func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// 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"` +} + +// DicomService the description of Dicom Service +type DicomService struct { + autorest.Response `json:"-"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The resource location. + Location *string `json:"location,omitempty"` + // Identity - Setting indicating whether the service has a managed identity associated with it. + Identity *ServiceManagedIdentityIdentity `json:"identity,omitempty"` + // DicomServiceProperties - Dicom Service configuration. + *DicomServiceProperties `json:"properties,omitempty"` + // SystemData - Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for DicomService. +func (ds DicomService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ds.Tags != nil { + objectMap["tags"] = ds.Tags + } + if ds.Location != nil { + objectMap["location"] = ds.Location + } + if ds.Identity != nil { + objectMap["identity"] = ds.Identity + } + if ds.DicomServiceProperties != nil { + objectMap["properties"] = ds.DicomServiceProperties + } + if ds.SystemData != nil { + objectMap["systemData"] = ds.SystemData + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DicomService struct. +func (ds *DicomService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ds.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ds.Location = &location + } + case "identity": + if v != nil { + var identity ServiceManagedIdentityIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + ds.Identity = &identity + } + case "properties": + if v != nil { + var dicomServiceProperties DicomServiceProperties + err = json.Unmarshal(*v, &dicomServiceProperties) + if err != nil { + return err + } + ds.DicomServiceProperties = &dicomServiceProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + ds.SystemData = &systemData + } + } + } + + return nil +} + +// DicomServiceAuthenticationConfiguration authentication configuration information +type DicomServiceAuthenticationConfiguration struct { + // Authority - READ-ONLY; The authority url for the service + Authority *string `json:"authority,omitempty"` + // Audiences - READ-ONLY; The audiences for the service + Audiences *[]string `json:"audiences,omitempty"` +} + +// MarshalJSON is the custom marshaler for DicomServiceAuthenticationConfiguration. +func (dsac DicomServiceAuthenticationConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DicomServiceCollection the collection of Dicom Services. +type DicomServiceCollection struct { + autorest.Response `json:"-"` + // NextLink - The link used to get the next page of Dicom Services. + NextLink *string `json:"nextLink,omitempty"` + // Value - The list of Dicom Services. + Value *[]DicomService `json:"value,omitempty"` +} + +// DicomServiceCollectionIterator provides access to a complete listing of DicomService values. +type DicomServiceCollectionIterator struct { + i int + page DicomServiceCollectionPage +} + +// 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 *DicomServiceCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DicomServiceCollectionIterator.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 *DicomServiceCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DicomServiceCollectionIterator) 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 DicomServiceCollectionIterator) Response() DicomServiceCollection { + 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 DicomServiceCollectionIterator) Value() DicomService { + if !iter.page.NotDone() { + return DicomService{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DicomServiceCollectionIterator type. +func NewDicomServiceCollectionIterator(page DicomServiceCollectionPage) DicomServiceCollectionIterator { + return DicomServiceCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dsc DicomServiceCollection) IsEmpty() bool { + return dsc.Value == nil || len(*dsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dsc DicomServiceCollection) hasNextLink() bool { + return dsc.NextLink != nil && len(*dsc.NextLink) != 0 +} + +// dicomServiceCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dsc DicomServiceCollection) dicomServiceCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !dsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dsc.NextLink))) +} + +// DicomServiceCollectionPage contains a page of DicomService values. +type DicomServiceCollectionPage struct { + fn func(context.Context, DicomServiceCollection) (DicomServiceCollection, error) + dsc DicomServiceCollection +} + +// 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 *DicomServiceCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DicomServiceCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dsc) + if err != nil { + return err + } + page.dsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *DicomServiceCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DicomServiceCollectionPage) NotDone() bool { + return !page.dsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DicomServiceCollectionPage) Response() DicomServiceCollection { + return page.dsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DicomServiceCollectionPage) Values() []DicomService { + if page.dsc.IsEmpty() { + return nil + } + return *page.dsc.Value +} + +// Creates a new instance of the DicomServiceCollectionPage type. +func NewDicomServiceCollectionPage(cur DicomServiceCollection, getNextPage func(context.Context, DicomServiceCollection) (DicomServiceCollection, error)) DicomServiceCollectionPage { + return DicomServiceCollectionPage{ + fn: getNextPage, + dsc: cur, + } +} + +// DicomServicePatchResource dicom Service patch properties +type DicomServicePatchResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Identity - Setting indicating whether the service has a managed identity associated with it. + Identity *ServiceManagedIdentityIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for DicomServicePatchResource. +func (dspr DicomServicePatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dspr.Tags != nil { + objectMap["tags"] = dspr.Tags + } + if dspr.Identity != nil { + objectMap["identity"] = dspr.Identity + } + return json.Marshal(objectMap) +} + +// DicomServiceProperties dicom Service properties. +type DicomServiceProperties struct { + // ProvisioningState - The provisioning state. Possible values include: 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateCreating', 'ProvisioningStateAccepted', 'ProvisioningStateVerifying', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateDeprovisioned', 'ProvisioningStateMoving', 'ProvisioningStateSuspended', 'ProvisioningStateWarned', 'ProvisioningStateSystemMaintenance' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // AuthenticationConfiguration - Dicom Service authentication configuration. + AuthenticationConfiguration *DicomServiceAuthenticationConfiguration `json:"authenticationConfiguration,omitempty"` + // ServiceURL - READ-ONLY; The url of the Dicom Services. + ServiceURL *string `json:"serviceUrl,omitempty"` + // PrivateEndpointConnections - READ-ONLY; The list of private endpoint connections that are set up for this resource. + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + // PublicNetworkAccess - Control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` +} + +// MarshalJSON is the custom marshaler for DicomServiceProperties. +func (dsp DicomServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dsp.ProvisioningState != "" { + objectMap["provisioningState"] = dsp.ProvisioningState + } + if dsp.AuthenticationConfiguration != nil { + objectMap["authenticationConfiguration"] = dsp.AuthenticationConfiguration + } + if dsp.PublicNetworkAccess != "" { + objectMap["publicNetworkAccess"] = dsp.PublicNetworkAccess + } + return json.Marshal(objectMap) +} + +// DicomServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DicomServicesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DicomServicesClient) (DicomService, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DicomServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DicomServicesCreateOrUpdateFuture.Result. +func (future *DicomServicesCreateOrUpdateFuture) result(client DicomServicesClient) (ds DicomService, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ds.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("healthcareapis.DicomServicesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ds.Response.Response, err = future.GetResult(sender); err == nil && ds.Response.Response.StatusCode != http.StatusNoContent { + ds, err = client.CreateOrUpdateResponder(ds.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesCreateOrUpdateFuture", "Result", ds.Response.Response, "Failure responding to request") + } + } + return +} + +// DicomServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DicomServicesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DicomServicesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DicomServicesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DicomServicesDeleteFuture.Result. +func (future *DicomServicesDeleteFuture) result(client DicomServicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("healthcareapis.DicomServicesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DicomServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DicomServicesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DicomServicesClient) (DicomService, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DicomServicesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DicomServicesUpdateFuture.Result. +func (future *DicomServicesUpdateFuture) result(client DicomServicesClient) (ds DicomService, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ds.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("healthcareapis.DicomServicesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ds.Response.Response, err = future.GetResult(sender); err == nil && ds.Response.Response.StatusCode != http.StatusNoContent { + ds, err = client.UpdateResponder(ds.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.DicomServicesUpdateFuture", "Result", ds.Response.Response, "Failure responding to request") + } + } + return +} + +// Error error details. +type Error struct { + // Error - Error details + Error *ErrorDetailsInternal `json:"error,omitempty"` +} + +// ErrorDetails error details. +type ErrorDetails struct { + // Error - 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"` +} + +// MarshalJSON is the custom marshaler for ErrorDetailsInternal. +func (edi ErrorDetailsInternal) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// FhirService the description of Fhir Service +type FhirService struct { + autorest.Response `json:"-"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The resource location. + Location *string `json:"location,omitempty"` + // Identity - Setting indicating whether the service has a managed identity associated with it. + Identity *ServiceManagedIdentityIdentity `json:"identity,omitempty"` + // Kind - The kind of the service. Possible values include: 'FhirServiceKindFhirStu3', 'FhirServiceKindFhirR4' + Kind FhirServiceKind `json:"kind,omitempty"` + // FhirServiceProperties - Fhir Service configuration. + *FhirServiceProperties `json:"properties,omitempty"` + // SystemData - Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for FhirService. +func (fs FhirService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fs.Tags != nil { + objectMap["tags"] = fs.Tags + } + if fs.Location != nil { + objectMap["location"] = fs.Location + } + if fs.Identity != nil { + objectMap["identity"] = fs.Identity + } + if fs.Kind != "" { + objectMap["kind"] = fs.Kind + } + if fs.FhirServiceProperties != nil { + objectMap["properties"] = fs.FhirServiceProperties + } + if fs.SystemData != nil { + objectMap["systemData"] = fs.SystemData + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for FhirService struct. +func (fs *FhirService) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + fs.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + fs.Location = &location + } + case "identity": + if v != nil { + var identity ServiceManagedIdentityIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + fs.Identity = &identity + } + case "kind": + if v != nil { + var kind FhirServiceKind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + fs.Kind = kind + } + case "properties": + if v != nil { + var fhirServiceProperties FhirServiceProperties + err = json.Unmarshal(*v, &fhirServiceProperties) + if err != nil { + return err + } + fs.FhirServiceProperties = &fhirServiceProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + fs.SystemData = &systemData + } + } + } + + return nil +} + +// FhirServiceAccessPolicyEntry an access policy entry. +type FhirServiceAccessPolicyEntry struct { + // ObjectID - An Azure AD object ID (User or Apps) that is allowed access to the FHIR service. + ObjectID *string `json:"objectId,omitempty"` +} + +// FhirServiceAcrConfiguration azure container registry configuration information +type FhirServiceAcrConfiguration struct { + // LoginServers - The list of the Azure container registry login servers. + LoginServers *[]string `json:"loginServers,omitempty"` + // OciArtifacts - The list of Open Container Initiative (OCI) artifacts. + OciArtifacts *[]ServiceOciArtifactEntry `json:"ociArtifacts,omitempty"` +} + +// FhirServiceAuthenticationConfiguration authentication configuration information +type FhirServiceAuthenticationConfiguration 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"` +} + +// FhirServiceCollection a collection of Fhir services. +type FhirServiceCollection struct { + autorest.Response `json:"-"` + // NextLink - The link used to get the next page of Fhir Services. + NextLink *string `json:"nextLink,omitempty"` + // Value - The list of Fhir Services. + Value *[]FhirService `json:"value,omitempty"` +} + +// FhirServiceCollectionIterator provides access to a complete listing of FhirService values. +type FhirServiceCollectionIterator struct { + i int + page FhirServiceCollectionPage +} + +// 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 *FhirServiceCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FhirServiceCollectionIterator.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 *FhirServiceCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter FhirServiceCollectionIterator) 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 FhirServiceCollectionIterator) Response() FhirServiceCollection { + 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 FhirServiceCollectionIterator) Value() FhirService { + if !iter.page.NotDone() { + return FhirService{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the FhirServiceCollectionIterator type. +func NewFhirServiceCollectionIterator(page FhirServiceCollectionPage) FhirServiceCollectionIterator { + return FhirServiceCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (fsc FhirServiceCollection) IsEmpty() bool { + return fsc.Value == nil || len(*fsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (fsc FhirServiceCollection) hasNextLink() bool { + return fsc.NextLink != nil && len(*fsc.NextLink) != 0 +} + +// fhirServiceCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (fsc FhirServiceCollection) fhirServiceCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !fsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(fsc.NextLink))) +} + +// FhirServiceCollectionPage contains a page of FhirService values. +type FhirServiceCollectionPage struct { + fn func(context.Context, FhirServiceCollection) (FhirServiceCollection, error) + fsc FhirServiceCollection +} + +// 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 *FhirServiceCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FhirServiceCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.fsc) + if err != nil { + return err + } + page.fsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *FhirServiceCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page FhirServiceCollectionPage) NotDone() bool { + return !page.fsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page FhirServiceCollectionPage) Response() FhirServiceCollection { + return page.fsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page FhirServiceCollectionPage) Values() []FhirService { + if page.fsc.IsEmpty() { + return nil + } + return *page.fsc.Value +} + +// Creates a new instance of the FhirServiceCollectionPage type. +func NewFhirServiceCollectionPage(cur FhirServiceCollection, getNextPage func(context.Context, FhirServiceCollection) (FhirServiceCollection, error)) FhirServiceCollectionPage { + return FhirServiceCollectionPage{ + fn: getNextPage, + fsc: cur, + } +} + +// FhirServiceCorsConfiguration the settings for the CORS configuration of the service instance. +type FhirServiceCorsConfiguration 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"` +} + +// FhirServiceExportConfiguration export operation configuration information +type FhirServiceExportConfiguration struct { + // StorageAccountName - The name of the default export storage account. + StorageAccountName *string `json:"storageAccountName,omitempty"` +} + +// FhirServicePatchResource fhirService patch properties +type FhirServicePatchResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Identity - Setting indicating whether the service has a managed identity associated with it. + Identity *ServiceManagedIdentityIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for FhirServicePatchResource. +func (fspr FhirServicePatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fspr.Tags != nil { + objectMap["tags"] = fspr.Tags + } + if fspr.Identity != nil { + objectMap["identity"] = fspr.Identity + } + return json.Marshal(objectMap) +} + +// FhirServiceProperties fhir Service properties. +type FhirServiceProperties struct { + // ProvisioningState - The provisioning state. Possible values include: 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateCreating', 'ProvisioningStateAccepted', 'ProvisioningStateVerifying', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateDeprovisioned', 'ProvisioningStateMoving', 'ProvisioningStateSuspended', 'ProvisioningStateWarned', 'ProvisioningStateSystemMaintenance' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // AccessPolicies - Fhir Service access policies. + AccessPolicies *[]FhirServiceAccessPolicyEntry `json:"accessPolicies,omitempty"` + // AcrConfiguration - Fhir Service Azure container registry configuration. + AcrConfiguration *FhirServiceAcrConfiguration `json:"acrConfiguration,omitempty"` + // AuthenticationConfiguration - Fhir Service authentication configuration. + AuthenticationConfiguration *FhirServiceAuthenticationConfiguration `json:"authenticationConfiguration,omitempty"` + // CorsConfiguration - Fhir Service Cors configuration. + CorsConfiguration *FhirServiceCorsConfiguration `json:"corsConfiguration,omitempty"` + // ExportConfiguration - Fhir Service export configuration. + ExportConfiguration *FhirServiceExportConfiguration `json:"exportConfiguration,omitempty"` + // PrivateEndpointConnections - READ-ONLY; The list of private endpoint connections that are set up for this resource. + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + // PublicNetworkAccess - Control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // EventState - Fhir Service event support status. Possible values include: 'ServiceEventStateDisabled', 'ServiceEventStateEnabled', 'ServiceEventStateUpdating' + EventState ServiceEventState `json:"eventState,omitempty"` + // ResourceVersionPolicyConfiguration - Determines tracking of history for resources. + ResourceVersionPolicyConfiguration *ResourceVersionPolicyConfiguration `json:"resourceVersionPolicyConfiguration,omitempty"` +} + +// MarshalJSON is the custom marshaler for FhirServiceProperties. +func (fsp FhirServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fsp.ProvisioningState != "" { + objectMap["provisioningState"] = fsp.ProvisioningState + } + if fsp.AccessPolicies != nil { + objectMap["accessPolicies"] = fsp.AccessPolicies + } + if fsp.AcrConfiguration != nil { + objectMap["acrConfiguration"] = fsp.AcrConfiguration + } + if fsp.AuthenticationConfiguration != nil { + objectMap["authenticationConfiguration"] = fsp.AuthenticationConfiguration + } + if fsp.CorsConfiguration != nil { + objectMap["corsConfiguration"] = fsp.CorsConfiguration + } + if fsp.ExportConfiguration != nil { + objectMap["exportConfiguration"] = fsp.ExportConfiguration + } + if fsp.PublicNetworkAccess != "" { + objectMap["publicNetworkAccess"] = fsp.PublicNetworkAccess + } + if fsp.EventState != "" { + objectMap["eventState"] = fsp.EventState + } + if fsp.ResourceVersionPolicyConfiguration != nil { + objectMap["resourceVersionPolicyConfiguration"] = fsp.ResourceVersionPolicyConfiguration + } + return json.Marshal(objectMap) +} + +// FhirServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type FhirServicesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(FhirServicesClient) (FhirService, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *FhirServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for FhirServicesCreateOrUpdateFuture.Result. +func (future *FhirServicesCreateOrUpdateFuture) result(client FhirServicesClient) (fs FhirService, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + fs.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("healthcareapis.FhirServicesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if fs.Response.Response, err = future.GetResult(sender); err == nil && fs.Response.Response.StatusCode != http.StatusNoContent { + fs, err = client.CreateOrUpdateResponder(fs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesCreateOrUpdateFuture", "Result", fs.Response.Response, "Failure responding to request") + } + } + return +} + +// FhirServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type FhirServicesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(FhirServicesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *FhirServicesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for FhirServicesDeleteFuture.Result. +func (future *FhirServicesDeleteFuture) result(client FhirServicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("healthcareapis.FhirServicesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// FhirServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type FhirServicesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(FhirServicesClient) (FhirService, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *FhirServicesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for FhirServicesUpdateFuture.Result. +func (future *FhirServicesUpdateFuture) result(client FhirServicesClient) (fs FhirService, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + fs.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("healthcareapis.FhirServicesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if fs.Response.Response, err = future.GetResult(sender); err == nil && fs.Response.Response.StatusCode != http.StatusNoContent { + fs, err = client.UpdateResponder(fs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.FhirServicesUpdateFuture", "Result", fs.Response.Response, "Failure responding to request") + } + } + return +} + +// IotConnector ioT Connector definition. +type IotConnector struct { + autorest.Response `json:"-"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The resource location. + Location *string `json:"location,omitempty"` + // Identity - Setting indicating whether the service has a managed identity associated with it. + Identity *ServiceManagedIdentityIdentity `json:"identity,omitempty"` + // IotConnectorProperties - IoT Connector configuration. + *IotConnectorProperties `json:"properties,omitempty"` + // SystemData - Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotConnector. +func (ic IotConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ic.Tags != nil { + objectMap["tags"] = ic.Tags + } + if ic.Location != nil { + objectMap["location"] = ic.Location + } + if ic.Identity != nil { + objectMap["identity"] = ic.Identity + } + if ic.IotConnectorProperties != nil { + objectMap["properties"] = ic.IotConnectorProperties + } + if ic.SystemData != nil { + objectMap["systemData"] = ic.SystemData + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IotConnector struct. +func (ic *IotConnector) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ic.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ic.Location = &location + } + case "identity": + if v != nil { + var identity ServiceManagedIdentityIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + ic.Identity = &identity + } + case "properties": + if v != nil { + var iotConnectorProperties IotConnectorProperties + err = json.Unmarshal(*v, &iotConnectorProperties) + if err != nil { + return err + } + ic.IotConnectorProperties = &iotConnectorProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + ic.SystemData = &systemData + } + } + } + + return nil +} + +// IotConnectorCollection a collection of IoT Connectors. +type IotConnectorCollection struct { + autorest.Response `json:"-"` + // NextLink - The link used to get the next page of IoT Connectors. + NextLink *string `json:"nextLink,omitempty"` + // Value - The list of IoT Connectors. + Value *[]IotConnector `json:"value,omitempty"` +} + +// IotConnectorCollectionIterator provides access to a complete listing of IotConnector values. +type IotConnectorCollectionIterator struct { + i int + page IotConnectorCollectionPage +} + +// 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 *IotConnectorCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotConnectorCollectionIterator.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 *IotConnectorCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IotConnectorCollectionIterator) 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 IotConnectorCollectionIterator) Response() IotConnectorCollection { + 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 IotConnectorCollectionIterator) Value() IotConnector { + if !iter.page.NotDone() { + return IotConnector{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IotConnectorCollectionIterator type. +func NewIotConnectorCollectionIterator(page IotConnectorCollectionPage) IotConnectorCollectionIterator { + return IotConnectorCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (icc IotConnectorCollection) IsEmpty() bool { + return icc.Value == nil || len(*icc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (icc IotConnectorCollection) hasNextLink() bool { + return icc.NextLink != nil && len(*icc.NextLink) != 0 +} + +// iotConnectorCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (icc IotConnectorCollection) iotConnectorCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !icc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(icc.NextLink))) +} + +// IotConnectorCollectionPage contains a page of IotConnector values. +type IotConnectorCollectionPage struct { + fn func(context.Context, IotConnectorCollection) (IotConnectorCollection, error) + icc IotConnectorCollection +} + +// 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 *IotConnectorCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotConnectorCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.icc) + if err != nil { + return err + } + page.icc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *IotConnectorCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IotConnectorCollectionPage) NotDone() bool { + return !page.icc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IotConnectorCollectionPage) Response() IotConnectorCollection { + return page.icc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IotConnectorCollectionPage) Values() []IotConnector { + if page.icc.IsEmpty() { + return nil + } + return *page.icc.Value +} + +// Creates a new instance of the IotConnectorCollectionPage type. +func NewIotConnectorCollectionPage(cur IotConnectorCollection, getNextPage func(context.Context, IotConnectorCollection) (IotConnectorCollection, error)) IotConnectorCollectionPage { + return IotConnectorCollectionPage{ + fn: getNextPage, + icc: cur, + } +} + +// IotConnectorFhirDestinationCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type IotConnectorFhirDestinationCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(IotConnectorFhirDestinationClient) (IotFhirDestination, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *IotConnectorFhirDestinationCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for IotConnectorFhirDestinationCreateOrUpdateFuture.Result. +func (future *IotConnectorFhirDestinationCreateOrUpdateFuture) result(client IotConnectorFhirDestinationClient) (ifd IotFhirDestination, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorFhirDestinationCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ifd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("healthcareapis.IotConnectorFhirDestinationCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ifd.Response.Response, err = future.GetResult(sender); err == nil && ifd.Response.Response.StatusCode != http.StatusNoContent { + ifd, err = client.CreateOrUpdateResponder(ifd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorFhirDestinationCreateOrUpdateFuture", "Result", ifd.Response.Response, "Failure responding to request") + } + } + return +} + +// IotConnectorFhirDestinationDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type IotConnectorFhirDestinationDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(IotConnectorFhirDestinationClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *IotConnectorFhirDestinationDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for IotConnectorFhirDestinationDeleteFuture.Result. +func (future *IotConnectorFhirDestinationDeleteFuture) result(client IotConnectorFhirDestinationClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorFhirDestinationDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("healthcareapis.IotConnectorFhirDestinationDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// IotConnectorPatchResource iot Connector patch properties +type IotConnectorPatchResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Identity - Setting indicating whether the service has a managed identity associated with it. + Identity *ServiceManagedIdentityIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotConnectorPatchResource. +func (icpr IotConnectorPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if icpr.Tags != nil { + objectMap["tags"] = icpr.Tags + } + if icpr.Identity != nil { + objectMap["identity"] = icpr.Identity + } + return json.Marshal(objectMap) +} + +// IotConnectorProperties ioT Connector properties. +type IotConnectorProperties struct { + // ProvisioningState - The provisioning state. Possible values include: 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateCreating', 'ProvisioningStateAccepted', 'ProvisioningStateVerifying', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateDeprovisioned', 'ProvisioningStateMoving', 'ProvisioningStateSuspended', 'ProvisioningStateWarned', 'ProvisioningStateSystemMaintenance' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // IngestionEndpointConfiguration - Source configuration. + IngestionEndpointConfiguration *IotEventHubIngestionEndpointConfiguration `json:"ingestionEndpointConfiguration,omitempty"` + // DeviceMapping - Device Mappings. + DeviceMapping *IotMappingProperties `json:"deviceMapping,omitempty"` +} + +// IotConnectorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type IotConnectorsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(IotConnectorsClient) (IotConnector, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *IotConnectorsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for IotConnectorsCreateOrUpdateFuture.Result. +func (future *IotConnectorsCreateOrUpdateFuture) result(client IotConnectorsClient) (ic IotConnector, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ic.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("healthcareapis.IotConnectorsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ic.Response.Response, err = future.GetResult(sender); err == nil && ic.Response.Response.StatusCode != http.StatusNoContent { + ic, err = client.CreateOrUpdateResponder(ic.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsCreateOrUpdateFuture", "Result", ic.Response.Response, "Failure responding to request") + } + } + return +} + +// IotConnectorsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type IotConnectorsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(IotConnectorsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *IotConnectorsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for IotConnectorsDeleteFuture.Result. +func (future *IotConnectorsDeleteFuture) result(client IotConnectorsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("healthcareapis.IotConnectorsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// IotConnectorsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type IotConnectorsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(IotConnectorsClient) (IotConnector, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *IotConnectorsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for IotConnectorsUpdateFuture.Result. +func (future *IotConnectorsUpdateFuture) result(client IotConnectorsClient) (ic IotConnector, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ic.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("healthcareapis.IotConnectorsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ic.Response.Response, err = future.GetResult(sender); err == nil && ic.Response.Response.StatusCode != http.StatusNoContent { + ic, err = client.UpdateResponder(ic.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.IotConnectorsUpdateFuture", "Result", ic.Response.Response, "Failure responding to request") + } + } + return +} + +// IotDestinationProperties common IoT Connector destination properties. +type IotDestinationProperties struct { + // ProvisioningState - The provisioning state. Possible values include: 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateCreating', 'ProvisioningStateAccepted', 'ProvisioningStateVerifying', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateDeprovisioned', 'ProvisioningStateMoving', 'ProvisioningStateSuspended', 'ProvisioningStateWarned', 'ProvisioningStateSystemMaintenance' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// IotEventHubIngestionEndpointConfiguration event Hub ingestion endpoint configuration +type IotEventHubIngestionEndpointConfiguration struct { + // EventHubName - Event Hub name to connect to. + EventHubName *string `json:"eventHubName,omitempty"` + // ConsumerGroup - Consumer group of the event hub to connected to. + ConsumerGroup *string `json:"consumerGroup,omitempty"` + // FullyQualifiedEventHubNamespace - Fully qualified namespace of the Event Hub to connect to. + FullyQualifiedEventHubNamespace *string `json:"fullyQualifiedEventHubNamespace,omitempty"` +} + +// IotFhirDestination ioT Connector FHIR destination definition. +type IotFhirDestination struct { + autorest.Response `json:"-"` + // IotFhirDestinationProperties - IoT FHIR Destination settings. + *IotFhirDestinationProperties `json:"properties,omitempty"` + // SystemData - Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` + // Location - The resource location. + Location *string `json:"location,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"` + // 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 IotFhirDestination. +func (ifd IotFhirDestination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ifd.IotFhirDestinationProperties != nil { + objectMap["properties"] = ifd.IotFhirDestinationProperties + } + if ifd.SystemData != nil { + objectMap["systemData"] = ifd.SystemData + } + if ifd.Location != nil { + objectMap["location"] = ifd.Location + } + if ifd.Etag != nil { + objectMap["etag"] = ifd.Etag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IotFhirDestination struct. +func (ifd *IotFhirDestination) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var iotFhirDestinationProperties IotFhirDestinationProperties + err = json.Unmarshal(*v, &iotFhirDestinationProperties) + if err != nil { + return err + } + ifd.IotFhirDestinationProperties = &iotFhirDestinationProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + ifd.SystemData = &systemData + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ifd.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ifd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ifd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ifd.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + ifd.Etag = &etag + } + } + } + + return nil +} + +// IotFhirDestinationCollection a collection of IoT Connector FHIR destinations. +type IotFhirDestinationCollection struct { + autorest.Response `json:"-"` + // NextLink - The link used to get the next page of IoT FHIR destinations. + NextLink *string `json:"nextLink,omitempty"` + // Value - The list of IoT Connector FHIR destinations. + Value *[]IotFhirDestination `json:"value,omitempty"` +} + +// IotFhirDestinationCollectionIterator provides access to a complete listing of IotFhirDestination values. +type IotFhirDestinationCollectionIterator struct { + i int + page IotFhirDestinationCollectionPage +} + +// 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 *IotFhirDestinationCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotFhirDestinationCollectionIterator.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 *IotFhirDestinationCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IotFhirDestinationCollectionIterator) 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 IotFhirDestinationCollectionIterator) Response() IotFhirDestinationCollection { + 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 IotFhirDestinationCollectionIterator) Value() IotFhirDestination { + if !iter.page.NotDone() { + return IotFhirDestination{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IotFhirDestinationCollectionIterator type. +func NewIotFhirDestinationCollectionIterator(page IotFhirDestinationCollectionPage) IotFhirDestinationCollectionIterator { + return IotFhirDestinationCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ifdc IotFhirDestinationCollection) IsEmpty() bool { + return ifdc.Value == nil || len(*ifdc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ifdc IotFhirDestinationCollection) hasNextLink() bool { + return ifdc.NextLink != nil && len(*ifdc.NextLink) != 0 +} + +// iotFhirDestinationCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ifdc IotFhirDestinationCollection) iotFhirDestinationCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ifdc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ifdc.NextLink))) +} + +// IotFhirDestinationCollectionPage contains a page of IotFhirDestination values. +type IotFhirDestinationCollectionPage struct { + fn func(context.Context, IotFhirDestinationCollection) (IotFhirDestinationCollection, error) + ifdc IotFhirDestinationCollection +} + +// 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 *IotFhirDestinationCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotFhirDestinationCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ifdc) + if err != nil { + return err + } + page.ifdc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *IotFhirDestinationCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IotFhirDestinationCollectionPage) NotDone() bool { + return !page.ifdc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IotFhirDestinationCollectionPage) Response() IotFhirDestinationCollection { + return page.ifdc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IotFhirDestinationCollectionPage) Values() []IotFhirDestination { + if page.ifdc.IsEmpty() { + return nil + } + return *page.ifdc.Value +} + +// Creates a new instance of the IotFhirDestinationCollectionPage type. +func NewIotFhirDestinationCollectionPage(cur IotFhirDestinationCollection, getNextPage func(context.Context, IotFhirDestinationCollection) (IotFhirDestinationCollection, error)) IotFhirDestinationCollectionPage { + return IotFhirDestinationCollectionPage{ + fn: getNextPage, + ifdc: cur, + } +} + +// IotFhirDestinationProperties ioT Connector destination properties for an Azure FHIR service. +type IotFhirDestinationProperties struct { + // ResourceIdentityResolutionType - Determines how resource identity is resolved on the destination. Possible values include: 'IotIdentityResolutionTypeCreate', 'IotIdentityResolutionTypeLookup' + ResourceIdentityResolutionType IotIdentityResolutionType `json:"resourceIdentityResolutionType,omitempty"` + // FhirServiceResourceID - Fully qualified resource id of the FHIR service to connect to. + FhirServiceResourceID *string `json:"fhirServiceResourceId,omitempty"` + // FhirMapping - FHIR Mappings + FhirMapping *IotMappingProperties `json:"fhirMapping,omitempty"` + // ProvisioningState - The provisioning state. Possible values include: 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateCreating', 'ProvisioningStateAccepted', 'ProvisioningStateVerifying', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateDeprovisioned', 'ProvisioningStateMoving', 'ProvisioningStateSuspended', 'ProvisioningStateWarned', 'ProvisioningStateSystemMaintenance' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// IotMappingProperties the mapping content. +type IotMappingProperties struct { + // Content - The mapping. + Content interface{} `json:"content,omitempty"` +} + +// ListOperations available operations of the service +type ListOperations struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Collection of available operation details + Value *[]OperationDetail `json:"value,omitempty"` + // NextLink - URL client should use to fetch the next page (per server side paging). + // It's null for now, added for future use. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ListOperations. +func (lo ListOperations) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lo.NextLink != nil { + objectMap["nextLink"] = lo.NextLink + } + return json.Marshal(objectMap) +} + +// ListOperationsIterator provides access to a complete listing of OperationDetail values. +type ListOperationsIterator struct { + i int + page ListOperationsPage +} + +// 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 *ListOperationsIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListOperationsIterator.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 *ListOperationsIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListOperationsIterator) 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 ListOperationsIterator) Response() ListOperations { + 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 ListOperationsIterator) Value() OperationDetail { + if !iter.page.NotDone() { + return OperationDetail{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListOperationsIterator type. +func NewListOperationsIterator(page ListOperationsPage) ListOperationsIterator { + return ListOperationsIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lo ListOperations) IsEmpty() bool { + return lo.Value == nil || len(*lo.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lo ListOperations) hasNextLink() bool { + return lo.NextLink != nil && len(*lo.NextLink) != 0 +} + +// listOperationsPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lo ListOperations) listOperationsPreparer(ctx context.Context) (*http.Request, error) { + if !lo.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lo.NextLink))) +} + +// ListOperationsPage contains a page of OperationDetail values. +type ListOperationsPage struct { + fn func(context.Context, ListOperations) (ListOperations, error) + lo ListOperations +} + +// 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 *ListOperationsPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListOperationsPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lo) + if err != nil { + return err + } + page.lo = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *ListOperationsPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListOperationsPage) NotDone() bool { + return !page.lo.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListOperationsPage) Response() ListOperations { + return page.lo +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListOperationsPage) Values() []OperationDetail { + if page.lo.IsEmpty() { + return nil + } + return *page.lo.Value +} + +// Creates a new instance of the ListOperationsPage type. +func NewListOperationsPage(cur ListOperations, getNextPage func(context.Context, ListOperations) (ListOperations, error)) ListOperationsPage { + return ListOperationsPage{ + fn: getNextPage, + lo: cur, + } +} + +// LocationBasedResource the common properties for any location based resource, tracked or proxy. +type LocationBasedResource struct { + // Location - The resource location. + Location *string `json:"location,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"` + // 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 LocationBasedResource. +func (lbr LocationBasedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lbr.Location != nil { + objectMap["location"] = lbr.Location + } + if lbr.Etag != nil { + objectMap["etag"] = lbr.Etag + } + return json.Marshal(objectMap) +} + +// LogSpecification specifications of the Log for Azure Monitoring +type LogSpecification struct { + // Name - Name of the log + Name *string `json:"name,omitempty"` + // DisplayName - Localized friendly display name of the log + DisplayName *string `json:"displayName,omitempty"` + // BlobDuration - Blob duration of the log + BlobDuration *string `json:"blobDuration,omitempty"` +} + +// MetricDimension specifications of the Dimension of metrics +type MetricDimension struct { + // Name - Name of the dimension + Name *string `json:"name,omitempty"` + // DisplayName - Localized friendly display name of the dimension + DisplayName *string `json:"displayName,omitempty"` + // ToBeExportedForShoebox - Whether this dimension should be included for the Shoebox export scenario + ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` +} + +// MetricSpecification specifications of the Metrics for Azure Monitoring +type MetricSpecification struct { + // Name - Name of the metric + Name *string `json:"name,omitempty"` + // DisplayName - Localized friendly display name of the metric + DisplayName *string `json:"displayName,omitempty"` + // DisplayDescription - Localized friendly description of the metric + DisplayDescription *string `json:"displayDescription,omitempty"` + // Unit - Unit that makes sense for the metric + Unit *string `json:"unit,omitempty"` + // Category - Name of the metric category that the metric belongs to. A metric can only belong to a single category. + Category *string `json:"category,omitempty"` + // AggregationType - Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. + AggregationType *string `json:"aggregationType,omitempty"` + // SupportedAggregationTypes - Supported aggregation types + SupportedAggregationTypes *[]string `json:"supportedAggregationTypes,omitempty"` + // SupportedTimeGrainTypes - Supported time grain types + SupportedTimeGrainTypes *[]string `json:"supportedTimeGrainTypes,omitempty"` + // FillGapWithZero - Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. + FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` + // Dimensions - Dimensions of the metric + Dimensions *[]MetricDimension `json:"dimensions,omitempty"` + // SourceMdmNamespace - Name of the MDM namespace. Optional. + SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"` +} + +// OperationDetail service REST API operation. +type OperationDetail struct { + // Name - READ-ONLY; Name of the operation + Name *string `json:"name,omitempty"` + // IsDataAction - READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + IsDataAction *bool `json:"isDataAction,omitempty"` + // Display - Display of the operation + Display *OperationDisplay `json:"display,omitempty"` + // Origin - READ-ONLY; Default value is 'user,system'. + Origin *string `json:"origin,omitempty"` + // ActionType - READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. Possible values include: 'ActionTypeInternal' + ActionType ActionType `json:"actionType,omitempty"` + // Properties - Properties of the operation + Properties *OperationProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationDetail. +func (od OperationDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if od.Display != nil { + objectMap["display"] = od.Display + } + if od.Properties != nil { + objectMap["properties"] = od.Properties + } + return json.Marshal(objectMap) +} + +// 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"` +} + +// MarshalJSON is the custom marshaler for OperationDisplay. +func (od OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OperationProperties extra Operation properties +type OperationProperties struct { + // ServiceSpecification - Service specifications of the operation + ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` +} + +// OperationResultsDescription the properties indicating the operation result of an operation on a service. +type OperationResultsDescription struct { + autorest.Response `json:"-"` + // 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: 'OperationResultStatusCanceled', 'OperationResultStatusSucceeded', 'OperationResultStatusFailed', 'OperationResultStatusRequested', 'OperationResultStatusRunning' + Status OperationResultStatus `json:"status,omitempty"` + // StartTime - READ-ONLY; The time that the operation was started. + StartTime *string `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The time that the operation finished. + EndTime *string `json:"endTime,omitempty"` + // Properties - Additional properties of the operation result. + Properties interface{} `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationResultsDescription. +func (ord OperationResultsDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ord.Properties != nil { + objectMap["properties"] = ord.Properties + } + return json.Marshal(objectMap) +} + +// PrivateEndpoint the Private Endpoint resource. +type PrivateEndpoint struct { + // ID - READ-ONLY; The ARM identifier for Private Endpoint + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpoint. +func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PrivateEndpointConnection the Private Endpoint Connection resource. +type PrivateEndpointConnection struct { + // PrivateEndpointConnectionProperties - Resource properties. + *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnection. +func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pec.PrivateEndpointConnectionProperties != nil { + objectMap["properties"] = pec.PrivateEndpointConnectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. +func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateEndpointConnectionProperties PrivateEndpointConnectionProperties + err = json.Unmarshal(*v, &privateEndpointConnectionProperties) + if err != nil { + return err + } + pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pec.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pec.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pec.Type = &typeVar + } + } + } + + return nil +} + +// PrivateEndpointConnectionDescription the Private Endpoint Connection resource. +type PrivateEndpointConnectionDescription struct { + autorest.Response `json:"-"` + // SystemData - Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` + // PrivateEndpointConnectionProperties - Resource properties. + *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnectionDescription. +func (pecd PrivateEndpointConnectionDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pecd.SystemData != nil { + objectMap["systemData"] = pecd.SystemData + } + if pecd.PrivateEndpointConnectionProperties != nil { + objectMap["properties"] = pecd.PrivateEndpointConnectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnectionDescription struct. +func (pecd *PrivateEndpointConnectionDescription) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + pecd.SystemData = &systemData + } + case "properties": + if v != nil { + var privateEndpointConnectionProperties PrivateEndpointConnectionProperties + err = json.Unmarshal(*v, &privateEndpointConnectionProperties) + if err != nil { + return err + } + pecd.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pecd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pecd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pecd.Type = &typeVar + } + } + } + + return nil +} + +// PrivateEndpointConnectionListResult list of private endpoint connection associated with the specified +// storage account +type PrivateEndpointConnectionListResult struct { + // Value - Array of private endpoint connections + Value *[]PrivateEndpointConnection `json:"value,omitempty"` +} + +// PrivateEndpointConnectionListResultDescription list of private endpoint connection associated with the +// specified storage account +type PrivateEndpointConnectionListResultDescription struct { + autorest.Response `json:"-"` + // Value - Array of private endpoint connections + Value *[]PrivateEndpointConnectionDescription `json:"value,omitempty"` +} + +// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties. +type PrivateEndpointConnectionProperties struct { + // PrivateEndpoint - The resource of private end point. + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + // ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'PrivateEndpointConnectionProvisioningStateSucceeded', 'PrivateEndpointConnectionProvisioningStateCreating', 'PrivateEndpointConnectionProvisioningStateDeleting', 'PrivateEndpointConnectionProvisioningStateFailed' + ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` +} + +// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type PrivateEndpointConnectionsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnectionDescription, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionsCreateOrUpdateFuture.Result. +func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pecd PrivateEndpointConnectionDescription, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pecd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("healthcareapis.PrivateEndpointConnectionsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pecd.Response.Response, err = future.GetResult(sender); err == nil && pecd.Response.Response.StatusCode != http.StatusNoContent { + pecd, err = client.CreateOrUpdateResponder(pecd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pecd.Response.Response, "Failure responding to request") + } + } + return +} + +// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result. +func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("healthcareapis.PrivateEndpointConnectionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PrivateLinkResource a private link resource +type PrivateLinkResource struct { + // PrivateLinkResourceProperties - Resource properties. + *PrivateLinkResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResource. +func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plr.PrivateLinkResourceProperties != nil { + objectMap["properties"] = plr.PrivateLinkResourceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. +func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateLinkResourceProperties PrivateLinkResourceProperties + err = json.Unmarshal(*v, &privateLinkResourceProperties) + if err != nil { + return err + } + plr.PrivateLinkResourceProperties = &privateLinkResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + plr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + plr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plr.Type = &typeVar + } + } + } + + return nil +} + +// PrivateLinkResourceDescription the Private Endpoint Connection resource. +type PrivateLinkResourceDescription struct { + autorest.Response `json:"-"` + // SystemData - Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` + // PrivateLinkResourceProperties - Resource properties. + *PrivateLinkResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResourceDescription. +func (plrd PrivateLinkResourceDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plrd.SystemData != nil { + objectMap["systemData"] = plrd.SystemData + } + if plrd.PrivateLinkResourceProperties != nil { + objectMap["properties"] = plrd.PrivateLinkResourceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateLinkResourceDescription struct. +func (plrd *PrivateLinkResourceDescription) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + plrd.SystemData = &systemData + } + case "properties": + if v != nil { + var privateLinkResourceProperties PrivateLinkResourceProperties + err = json.Unmarshal(*v, &privateLinkResourceProperties) + if err != nil { + return err + } + plrd.PrivateLinkResourceProperties = &privateLinkResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + plrd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + plrd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plrd.Type = &typeVar + } + } + } + + return nil +} + +// PrivateLinkResourceListResultDescription a list of private link resources +type PrivateLinkResourceListResultDescription struct { + autorest.Response `json:"-"` + // Value - Array of private link resources + Value *[]PrivateLinkResourceDescription `json:"value,omitempty"` +} + +// PrivateLinkResourceProperties properties of a private link resource. +type PrivateLinkResourceProperties struct { + // GroupID - READ-ONLY; The private link resource group id. + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - READ-ONLY; The private link resource required member names. + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // RequiredZoneNames - The private link resource Private link DNS zone name. + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. +func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plrp.RequiredZoneNames != nil { + objectMap["requiredZoneNames"] = plrp.RequiredZoneNames + } + return json.Marshal(objectMap) +} + +// PrivateLinkServiceConnectionState a collection of information about the state of the connection between +// service consumer and provider. +type PrivateLinkServiceConnectionState struct { + // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'PrivateEndpointServiceConnectionStatusPending', 'PrivateEndpointServiceConnectionStatusApproved', 'PrivateEndpointServiceConnectionStatusRejected' + Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` + // Description - The reason for approval/rejection of the connection. + Description *string `json:"description,omitempty"` + // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. + ActionsRequired *string `json:"actionsRequired,omitempty"` +} + +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Resource common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceCore the common properties for any resource, tracked or proxy. +type ResourceCore 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"` + // 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 ResourceCore. +func (rc ResourceCore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rc.Etag != nil { + objectMap["etag"] = rc.Etag + } + return json.Marshal(objectMap) +} + +// ResourceTags list of key value pairs that describe the resource. This will overwrite the existing tags. +type ResourceTags struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ResourceTags. +func (rt ResourceTags) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rt.Tags != nil { + objectMap["tags"] = rt.Tags + } + return json.Marshal(objectMap) +} + +// ResourceVersionPolicyConfiguration the settings for history tracking for FHIR resources. +type ResourceVersionPolicyConfiguration struct { + // Default - The default value for tracking history across all resources. Possible values include: 'FhirResourceVersionPolicyNoVersion', 'FhirResourceVersionPolicyVersioned', 'FhirResourceVersionPolicyVersionedUpdate' + Default FhirResourceVersionPolicy `json:"default,omitempty"` + // ResourceTypeOverrides - A list of FHIR Resources and their version policy overrides. + ResourceTypeOverrides map[string]*FhirResourceVersionPolicy `json:"resourceTypeOverrides"` +} + +// MarshalJSON is the custom marshaler for ResourceVersionPolicyConfiguration. +func (rvpc ResourceVersionPolicyConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rvpc.Default != "" { + objectMap["default"] = rvpc.Default + } + if rvpc.ResourceTypeOverrides != nil { + objectMap["resourceTypeOverrides"] = rvpc.ResourceTypeOverrides + } + 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"` +} + +// ServiceAcrConfigurationInfo azure container registry configuration information +type ServiceAcrConfigurationInfo struct { + // LoginServers - The list of the ACR login servers. + LoginServers *[]string `json:"loginServers,omitempty"` + // OciArtifacts - The list of Open Container Initiative (OCI) artifacts. + OciArtifacts *[]ServiceOciArtifactEntry `json:"ociArtifacts,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"` + // KeyVaultKeyURI - The URI of the customer-managed key for the backing database. + KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` +} + +// ServiceExportConfigurationInfo export operation configuration information +type ServiceExportConfigurationInfo struct { + // StorageAccountName - The name of the default export storage account. + StorageAccountName *string `json:"storageAccountName,omitempty"` +} + +// ServiceManagedIdentity managed service identity (system assigned and/or user assigned identities) +type ServiceManagedIdentity struct { + // Identity - Setting indicating whether the service has a managed identity associated with it. + Identity *ServiceManagedIdentityIdentity `json:"identity,omitempty"` +} + +// ServiceManagedIdentityIdentity setting indicating whether the service has a managed identity associated +// with it. +type ServiceManagedIdentityIdentity struct { + // Type - Type of identity being specified, currently SystemAssigned and None are allowed. Possible values include: 'ServiceManagedIdentityTypeNone', 'ServiceManagedIdentityTypeSystemAssigned', 'ServiceManagedIdentityTypeUserAssigned', 'ServiceManagedIdentityTypeSystemAssignedUserAssigned' + Type ServiceManagedIdentityType `json:"type,omitempty"` + // PrincipalID - READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + PrincipalID *uuid.UUID `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + TenantID *uuid.UUID `json:"tenantId,omitempty"` + UserAssignedIdentities map[string]*UserAssignedIdentity `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for ServiceManagedIdentityIdentity. +func (smi ServiceManagedIdentityIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if smi.Type != "" { + objectMap["type"] = smi.Type + } + if smi.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = smi.UserAssignedIdentities + } + return json.Marshal(objectMap) +} + +// ServiceOciArtifactEntry an Open Container Initiative (OCI) artifact. +type ServiceOciArtifactEntry struct { + // LoginServer - The Azure Container Registry login server. + LoginServer *string `json:"loginServer,omitempty"` + // ImageName - The artifact name. + ImageName *string `json:"imageName,omitempty"` + // Digest - The artifact digest. + Digest *string `json:"digest,omitempty"` +} + +// ServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServicesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServicesClient) (ServicesDescription, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ServicesCreateOrUpdateFuture.Result. +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 { + sd.Response.Response = future.Response() + 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.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServicesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServicesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ServicesDeleteFuture.Result. +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 { + ar.Response = future.Response() + 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"` + // SystemData - Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,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: 'KindFhir', 'KindFhirStu3', 'KindFhirR4' + 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"` + // Identity - Setting indicating whether the service has a managed identity associated with it. + Identity *ServicesResourceIdentity `json:"identity,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.SystemData != nil { + objectMap["systemData"] = sd.SystemData + } + 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 + } + if sd.Identity != nil { + objectMap["identity"] = sd.Identity + } + 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 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sdlr ServicesDescriptionListResult) hasNextLink() bool { + return sdlr.NextLink != nil && len(*sdlr.NextLink) != 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.hasNextLink() { + 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) + }() + } + for { + next, err := page.fn(ctx, page.sdlr) + if err != nil { + return err + } + page.sdlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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(cur ServicesDescriptionListResult, getNextPage func(context.Context, ServicesDescriptionListResult) (ServicesDescriptionListResult, error)) ServicesDescriptionListResultPage { + return ServicesDescriptionListResultPage{ + fn: getNextPage, + sdlr: cur, + } +} + +// 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: 'ServiceNameUnavailabilityReasonInvalid', 'ServiceNameUnavailabilityReasonAlreadyExists' + Reason ServiceNameUnavailabilityReason `json:"reason,omitempty"` + // Message - The detailed reason message. + Message *string `json:"message,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServicesNameAvailabilityInfo. +func (snai ServicesNameAvailabilityInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if snai.Message != nil { + objectMap["message"] = snai.Message + } + return json.Marshal(objectMap) +} + +// ServicesPatchDescription the description of the service. +type ServicesPatchDescription struct { + // Tags - Instance tags + Tags map[string]*string `json:"tags"` + // ServicesPropertiesUpdateParameters - The properties for updating a service instance. + *ServicesPropertiesUpdateParameters `json:"properties,omitempty"` +} + +// 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 + } + if spd.ServicesPropertiesUpdateParameters != nil { + objectMap["properties"] = spd.ServicesPropertiesUpdateParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServicesPatchDescription struct. +func (spd *ServicesPatchDescription) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + spd.Tags = tags + } + case "properties": + if v != nil { + var servicesPropertiesUpdateParameters ServicesPropertiesUpdateParameters + err = json.Unmarshal(*v, &servicesPropertiesUpdateParameters) + if err != nil { + return err + } + spd.ServicesPropertiesUpdateParameters = &servicesPropertiesUpdateParameters + } + } + } + + return nil +} + +// ServiceSpecification service specification payload +type ServiceSpecification struct { + // LogSpecifications - Specifications of the Log for Azure Monitoring + LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` + // MetricSpecifications - Specifications of the Metrics for Azure Monitoring + MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` +} + +// ServicesProperties the properties of a service instance. +type ServicesProperties struct { + // ProvisioningState - The provisioning state. Possible values include: 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateCreating', 'ProvisioningStateAccepted', 'ProvisioningStateVerifying', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateDeprovisioned', 'ProvisioningStateMoving', 'ProvisioningStateSuspended', 'ProvisioningStateWarned', 'ProvisioningStateSystemMaintenance' + 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"` + // ExportConfiguration - The settings for the export operation of the service instance. + ExportConfiguration *ServiceExportConfigurationInfo `json:"exportConfiguration,omitempty"` + // PrivateEndpointConnections - The list of private endpoint connections that are set up for this resource. + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + // PublicNetworkAccess - Control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // AcrConfiguration - The azure container registry settings used for convert data operation of the service instance. + AcrConfiguration *ServiceAcrConfigurationInfo `json:"acrConfiguration,omitempty"` +} + +// ServicesPropertiesUpdateParameters the properties for updating a service instance. +type ServicesPropertiesUpdateParameters struct { + // PublicNetworkAccess - Control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` +} + +// ServicesResource the common properties of a service. +type ServicesResource 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: 'KindFhir', 'KindFhirStu3', 'KindFhirR4' + 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"` + // Identity - Setting indicating whether the service has a managed identity associated with it. + Identity *ServicesResourceIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServicesResource. +func (sr ServicesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sr.Kind != "" { + objectMap["kind"] = sr.Kind + } + if sr.Location != nil { + objectMap["location"] = sr.Location + } + if sr.Tags != nil { + objectMap["tags"] = sr.Tags + } + if sr.Etag != nil { + objectMap["etag"] = sr.Etag + } + if sr.Identity != nil { + objectMap["identity"] = sr.Identity + } + return json.Marshal(objectMap) +} + +// ServicesResourceIdentity setting indicating whether the service has a managed identity associated with +// it. +type ServicesResourceIdentity struct { + // PrincipalID - READ-ONLY; The principal ID of the resource identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant ID of the resource. + TenantID *string `json:"tenantId,omitempty"` + // Type - Type of identity being specified, currently SystemAssigned and None are allowed. Possible values include: 'ManagedServiceIdentityTypeSystemAssigned', 'ManagedServiceIdentityTypeNone' + Type ManagedServiceIdentityType `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServicesResourceIdentity. +func (sr ServicesResourceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sr.Type != "" { + objectMap["type"] = sr.Type + } + return json.Marshal(objectMap) +} + +// ServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServicesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServicesClient) (ServicesDescription, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServicesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ServicesUpdateFuture.Result. +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 { + sd.Response.Response = future.Response() + 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 +} + +// SystemData metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // CreatedBy - The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' + CreatedByType CreatedByType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' + LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The timestamp of resource last modification (UTC) + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} + +// TaggedResource the common properties of tracked resources in the service. +type TaggedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The resource location. + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for TaggedResource. +func (tr TaggedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} + +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} + +// UserAssignedIdentity user assigned identity properties +type UserAssignedIdentity struct { + // PrincipalID - READ-ONLY; The principal ID of the assigned identity. + PrincipalID *uuid.UUID `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The client ID of the assigned identity. + ClientID *uuid.UUID `json:"clientId,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserAssignedIdentity. +func (uai UserAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Workspace workspace resource. +type Workspace struct { + autorest.Response `json:"-"` + // Properties - Workspaces resource specific properties. + Properties *WorkspaceProperties `json:"properties,omitempty"` + // SystemData - Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The resource location. + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for Workspace. +func (w Workspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.Properties != nil { + objectMap["properties"] = w.Properties + } + if w.SystemData != nil { + objectMap["systemData"] = w.SystemData + } + if w.Tags != nil { + objectMap["tags"] = w.Tags + } + if w.Location != nil { + objectMap["location"] = w.Location + } + return json.Marshal(objectMap) +} + +// WorkspaceList collection of workspace object with a next link +type WorkspaceList struct { + autorest.Response `json:"-"` + // NextLink - The link used to get the next page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of resources. + Value *[]Workspace `json:"value,omitempty"` +} + +// WorkspaceListIterator provides access to a complete listing of Workspace values. +type WorkspaceListIterator struct { + i int + page WorkspaceListPage +} + +// 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 *WorkspaceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListIterator.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 *WorkspaceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkspaceListIterator) 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 WorkspaceListIterator) Response() WorkspaceList { + 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 WorkspaceListIterator) Value() Workspace { + if !iter.page.NotDone() { + return Workspace{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WorkspaceListIterator type. +func NewWorkspaceListIterator(page WorkspaceListPage) WorkspaceListIterator { + return WorkspaceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wl WorkspaceList) IsEmpty() bool { + return wl.Value == nil || len(*wl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (wl WorkspaceList) hasNextLink() bool { + return wl.NextLink != nil && len(*wl.NextLink) != 0 +} + +// workspaceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wl WorkspaceList) workspaceListPreparer(ctx context.Context) (*http.Request, error) { + if !wl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wl.NextLink))) +} + +// WorkspaceListPage contains a page of Workspace values. +type WorkspaceListPage struct { + fn func(context.Context, WorkspaceList) (WorkspaceList, error) + wl WorkspaceList +} + +// 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 *WorkspaceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.wl) + if err != nil { + return err + } + page.wl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *WorkspaceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkspaceListPage) NotDone() bool { + return !page.wl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WorkspaceListPage) Response() WorkspaceList { + return page.wl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkspaceListPage) Values() []Workspace { + if page.wl.IsEmpty() { + return nil + } + return *page.wl.Value +} + +// Creates a new instance of the WorkspaceListPage type. +func NewWorkspaceListPage(cur WorkspaceList, getNextPage func(context.Context, WorkspaceList) (WorkspaceList, error)) WorkspaceListPage { + return WorkspaceListPage{ + fn: getNextPage, + wl: cur, + } +} + +// WorkspacePatchResource workspace patch properties +type WorkspacePatchResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for WorkspacePatchResource. +func (wpr WorkspacePatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wpr.Tags != nil { + objectMap["tags"] = wpr.Tags + } + return json.Marshal(objectMap) +} + +// WorkspacePrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type WorkspacePrivateEndpointConnectionsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WorkspacePrivateEndpointConnectionsClient) (PrivateEndpointConnectionDescription, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WorkspacePrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for WorkspacePrivateEndpointConnectionsCreateOrUpdateFuture.Result. +func (future *WorkspacePrivateEndpointConnectionsCreateOrUpdateFuture) result(client WorkspacePrivateEndpointConnectionsClient) (pecd PrivateEndpointConnectionDescription, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacePrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pecd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("healthcareapis.WorkspacePrivateEndpointConnectionsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pecd.Response.Response, err = future.GetResult(sender); err == nil && pecd.Response.Response.StatusCode != http.StatusNoContent { + pecd, err = client.CreateOrUpdateResponder(pecd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacePrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pecd.Response.Response, "Failure responding to request") + } + } + return +} + +// WorkspacePrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type WorkspacePrivateEndpointConnectionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WorkspacePrivateEndpointConnectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WorkspacePrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for WorkspacePrivateEndpointConnectionsDeleteFuture.Result. +func (future *WorkspacePrivateEndpointConnectionsDeleteFuture) result(client WorkspacePrivateEndpointConnectionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacePrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("healthcareapis.WorkspacePrivateEndpointConnectionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// WorkspaceProperties workspaces resource specific properties. +type WorkspaceProperties struct { + // ProvisioningState - The provisioning state. Possible values include: 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateCreating', 'ProvisioningStateAccepted', 'ProvisioningStateVerifying', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateDeprovisioned', 'ProvisioningStateMoving', 'ProvisioningStateSuspended', 'ProvisioningStateWarned', 'ProvisioningStateSystemMaintenance' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // PrivateEndpointConnections - READ-ONLY; The list of private endpoint connections that are set up for this resource. + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + // PublicNetworkAccess - Control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkspaceProperties. +func (w WorkspaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.ProvisioningState != "" { + objectMap["provisioningState"] = w.ProvisioningState + } + if w.PublicNetworkAccess != "" { + objectMap["publicNetworkAccess"] = w.PublicNetworkAccess + } + return json.Marshal(objectMap) +} + +// WorkspacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type WorkspacesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WorkspacesClient) (Workspace, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WorkspacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for WorkspacesCreateOrUpdateFuture.Result. +func (future *WorkspacesCreateOrUpdateFuture) result(client WorkspacesClient) (w Workspace, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + w.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("healthcareapis.WorkspacesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if w.Response.Response, err = future.GetResult(sender); err == nil && w.Response.Response.StatusCode != http.StatusNoContent { + w, err = client.CreateOrUpdateResponder(w.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesCreateOrUpdateFuture", "Result", w.Response.Response, "Failure responding to request") + } + } + return +} + +// WorkspacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type WorkspacesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WorkspacesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WorkspacesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for WorkspacesDeleteFuture.Result. +func (future *WorkspacesDeleteFuture) result(client WorkspacesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("healthcareapis.WorkspacesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// WorkspacesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type WorkspacesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WorkspacesClient) (Workspace, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WorkspacesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for WorkspacesUpdateFuture.Result. +func (future *WorkspacesUpdateFuture) result(client WorkspacesClient) (w Workspace, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + w.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("healthcareapis.WorkspacesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if w.Response.Response, err = future.GetResult(sender); err == nil && w.Response.Response.StatusCode != http.StatusNoContent { + w, err = client.UpdateResponder(w.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesUpdateFuture", "Result", w.Response.Response, "Failure responding to request") + } + } + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/operationresults.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/operationresults.go similarity index 93% rename from vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/operationresults.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/operationresults.go index a87baa561d57..28ade5c2b075 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/operationresults.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/operationresults.go @@ -35,7 +35,7 @@ func NewOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) // 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) { +func (client OperationResultsClient) Get(ctx context.Context, locationName string, operationResultID string) (result OperationResultsDescription, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationResultsClient.Get") defer func() { @@ -76,7 +76,7 @@ func (client OperationResultsClient) GetPreparer(ctx context.Context, locationNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-30" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -97,11 +97,11 @@ func (client OperationResultsClient) GetSender(req *http.Request) (*http.Respons // 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) { +func (client OperationResultsClient) GetResponder(resp *http.Response) (result OperationResultsDescription, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), - autorest.ByUnmarshallingJSON(&result.Value), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/operations.go similarity index 87% rename from vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/operations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/operations.go index ad4c1c1dd3ee..50a4c1d972f4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/operations.go @@ -30,14 +30,14 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera 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) { +// List lists all of the available operations supported by Microsoft Healthcare resource provider. +func (client OperationsClient) List(ctx context.Context) (result ListOperationsPage, 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 + if result.lo.Response.Response != nil { + sc = result.lo.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -51,17 +51,17 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe resp, err := client.ListSender(req) if err != nil { - result.olr.Response = autorest.Response{Response: resp} + result.lo.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "healthcareapis.OperationsClient", "List", resp, "Failure sending request") return } - result.olr, err = client.ListResponder(resp) + result.lo, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "healthcareapis.OperationsClient", "List", resp, "Failure responding to request") return } - if result.olr.hasNextLink() && result.olr.IsEmpty() { + if result.lo.hasNextLink() && result.lo.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -71,7 +71,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2020-03-30" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -92,7 +92,7 @@ func (client OperationsClient) ListSender(req *http.Request) (*http.Response, er // 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) { +func (client OperationsClient) ListResponder(resp *http.Response) (result ListOperations, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -103,8 +103,8 @@ func (client OperationsClient) ListResponder(resp *http.Response) (result Operat } // 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) +func (client OperationsClient) listNextResults(ctx context.Context, lastResults ListOperations) (result ListOperations, err error) { + req, err := lastResults.listOperationsPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "healthcareapis.OperationsClient", "listNextResults", nil, "Failure preparing next results request") } @@ -124,7 +124,7 @@ func (client OperationsClient) listNextResults(ctx context.Context, lastResults } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { +func (client OperationsClient) ListComplete(ctx context.Context) (result ListOperationsIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/privateendpointconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/privateendpointconnections.go similarity index 97% rename from vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/privateendpointconnections.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/privateendpointconnections.go index 6c3ccce0458b..f3a5894a99a1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/privateendpointconnections.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/privateendpointconnections.go @@ -88,7 +88,7 @@ func (client PrivateEndpointConnectionsClient) CreateOrUpdatePreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-30" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -121,7 +121,7 @@ func (client PrivateEndpointConnectionsClient) CreateOrUpdateSender(req *http.Re // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client PrivateEndpointConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { +func (client PrivateEndpointConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateEndpointConnectionDescription, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -183,7 +183,7 @@ func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-30" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -229,7 +229,7 @@ func (client PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Respon // resourceName - the name of the service instance. // privateEndpointConnectionName - the name of the private endpoint connection associated with the Azure // resource -func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { +func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionDescription, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Get") defer func() { @@ -282,7 +282,7 @@ func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-30" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -303,7 +303,7 @@ func (client PrivateEndpointConnectionsClient) GetSender(req *http.Request) (*ht // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { +func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnectionDescription, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -317,7 +317,7 @@ func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) // Parameters: // resourceGroupName - the name of the resource group that contains the service instance. // resourceName - the name of the service instance. -func (client PrivateEndpointConnectionsClient) ListByService(ctx context.Context, resourceGroupName string, resourceName string) (result PrivateEndpointConnectionListResult, err error) { +func (client PrivateEndpointConnectionsClient) ListByService(ctx context.Context, resourceGroupName string, resourceName string) (result PrivateEndpointConnectionListResultDescription, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.ListByService") defer func() { @@ -369,7 +369,7 @@ func (client PrivateEndpointConnectionsClient) ListByServicePreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-30" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -390,7 +390,7 @@ func (client PrivateEndpointConnectionsClient) ListByServiceSender(req *http.Req // ListByServiceResponder handles the response to the ListByService request. The method always // closes the http.Response Body. -func (client PrivateEndpointConnectionsClient) ListByServiceResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { +func (client PrivateEndpointConnectionsClient) ListByServiceResponder(resp *http.Response) (result PrivateEndpointConnectionListResultDescription, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/privatelinkresources.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/privatelinkresources.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/privatelinkresources.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/privatelinkresources.go index 55ef292953c9..3b80ba00c812 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/privatelinkresources.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/privatelinkresources.go @@ -37,7 +37,7 @@ func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID str // resourceGroupName - the name of the resource group that contains the service instance. // resourceName - the name of the service instance. // groupName - the name of the private link resource group. -func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, resourceName string, groupName string) (result PrivateLinkResource, err error) { +func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, resourceName string, groupName string) (result PrivateLinkResourceDescription, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.Get") defer func() { @@ -90,7 +90,7 @@ func (client PrivateLinkResourcesClient) GetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-30" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -111,7 +111,7 @@ func (client PrivateLinkResourcesClient) GetSender(req *http.Request) (*http.Res // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client PrivateLinkResourcesClient) GetResponder(resp *http.Response) (result PrivateLinkResource, err error) { +func (client PrivateLinkResourcesClient) GetResponder(resp *http.Response) (result PrivateLinkResourceDescription, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -125,7 +125,7 @@ func (client PrivateLinkResourcesClient) GetResponder(resp *http.Response) (resu // Parameters: // resourceGroupName - the name of the resource group that contains the service instance. // resourceName - the name of the service instance. -func (client PrivateLinkResourcesClient) ListByService(ctx context.Context, resourceGroupName string, resourceName string) (result PrivateLinkResourceListResult, err error) { +func (client PrivateLinkResourcesClient) ListByService(ctx context.Context, resourceGroupName string, resourceName string) (result PrivateLinkResourceListResultDescription, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.ListByService") defer func() { @@ -177,7 +177,7 @@ func (client PrivateLinkResourcesClient) ListByServicePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-30" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -198,7 +198,7 @@ func (client PrivateLinkResourcesClient) ListByServiceSender(req *http.Request) // ListByServiceResponder handles the response to the ListByService request. The method always // closes the http.Response Body. -func (client PrivateLinkResourcesClient) ListByServiceResponder(resp *http.Response) (result PrivateLinkResourceListResult, err error) { +func (client PrivateLinkResourcesClient) ListByServiceResponder(resp *http.Response) (result PrivateLinkResourceListResultDescription, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/services.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/services.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/services.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/services.go index 5529656193cd..736803fe6ed3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/services.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/services.go @@ -81,7 +81,7 @@ func (client ServicesClient) CheckNameAvailabilityPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-30" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -179,7 +179,7 @@ func (client ServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-30" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -271,7 +271,7 @@ func (client ServicesClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-30" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -367,7 +367,7 @@ func (client ServicesClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-30" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -443,7 +443,7 @@ func (client ServicesClient) ListPreparer(ctx context.Context) (*http.Request, e "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-30" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -567,7 +567,7 @@ func (client ServicesClient) ListByResourceGroupPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-30" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -685,7 +685,7 @@ func (client ServicesClient) UpdatePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-03-30" + const APIVersion = "2021-11-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/version.go similarity index 89% rename from vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/version.go index e98c968cd4cd..c4404f7463db 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/version.go @@ -10,7 +10,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " healthcareapis/2020-03-30" + return "Azure-SDK-For-Go/" + Version() + " healthcareapis/2021-11-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/workspaceprivateendpointconnections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/workspaceprivateendpointconnections.go new file mode 100644 index 000000000000..a5b9c58b60bd --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/workspaceprivateendpointconnections.go @@ -0,0 +1,399 @@ +package healthcareapis + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +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" +) + +// WorkspacePrivateEndpointConnectionsClient is the azure Healthcare APIs Client +type WorkspacePrivateEndpointConnectionsClient struct { + BaseClient +} + +// NewWorkspacePrivateEndpointConnectionsClient creates an instance of the WorkspacePrivateEndpointConnectionsClient +// client. +func NewWorkspacePrivateEndpointConnectionsClient(subscriptionID string) WorkspacePrivateEndpointConnectionsClient { + return NewWorkspacePrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspacePrivateEndpointConnectionsClientWithBaseURI creates an instance of the +// WorkspacePrivateEndpointConnectionsClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWorkspacePrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) WorkspacePrivateEndpointConnectionsClient { + return WorkspacePrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate update the state of the specified private endpoint connection associated with the workspace. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +// privateEndpointConnectionName - the name of the private endpoint connection associated with the Azure +// resource +// properties - the private endpoint connection properties. +func (client WorkspacePrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, properties PrivateEndpointConnectionDescription) (result WorkspacePrivateEndpointConnectionsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacePrivateEndpointConnectionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.WorkspacePrivateEndpointConnectionsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, properties) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacePrivateEndpointConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacePrivateEndpointConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WorkspacePrivateEndpointConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, properties PrivateEndpointConnectionDescription) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(properties), + 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 WorkspacePrivateEndpointConnectionsClient) CreateOrUpdateSender(req *http.Request) (future WorkspacePrivateEndpointConnectionsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client WorkspacePrivateEndpointConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateEndpointConnectionDescription, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a private endpoint connection. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +// privateEndpointConnectionName - the name of the private endpoint connection associated with the Azure +// resource +func (client WorkspacePrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result WorkspacePrivateEndpointConnectionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacePrivateEndpointConnectionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.WorkspacePrivateEndpointConnectionsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacePrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacePrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WorkspacePrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", 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 WorkspacePrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (future WorkspacePrivateEndpointConnectionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client WorkspacePrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the specified private endpoint connection associated with the workspace. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +// privateEndpointConnectionName - the name of the private endpoint connection associated with the Azure +// resource +func (client WorkspacePrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionDescription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacePrivateEndpointConnectionsClient.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.WorkspacePrivateEndpointConnectionsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacePrivateEndpointConnectionsClient", "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.WorkspacePrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacePrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkspacePrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", 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 WorkspacePrivateEndpointConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkspacePrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnectionDescription, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace lists all private endpoint connections for a workspace. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +func (client WorkspacePrivateEndpointConnectionsClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result PrivateEndpointConnectionListResultDescription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacePrivateEndpointConnectionsClient.ListByWorkspace") + 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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.WorkspacePrivateEndpointConnectionsClient", "ListByWorkspace", err.Error()) + } + + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacePrivateEndpointConnectionsClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacePrivateEndpointConnectionsClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacePrivateEndpointConnectionsClient", "ListByWorkspace", resp, "Failure responding to request") + return + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client WorkspacePrivateEndpointConnectionsClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/privateEndpointConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspacePrivateEndpointConnectionsClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client WorkspacePrivateEndpointConnectionsClient) ListByWorkspaceResponder(resp *http.Response) (result PrivateEndpointConnectionListResultDescription, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/workspaceprivatelinkresources.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/workspaceprivatelinkresources.go new file mode 100644 index 000000000000..56e9ae2eae9b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/workspaceprivatelinkresources.go @@ -0,0 +1,209 @@ +package healthcareapis + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +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" +) + +// WorkspacePrivateLinkResourcesClient is the azure Healthcare APIs Client +type WorkspacePrivateLinkResourcesClient struct { + BaseClient +} + +// NewWorkspacePrivateLinkResourcesClient creates an instance of the WorkspacePrivateLinkResourcesClient client. +func NewWorkspacePrivateLinkResourcesClient(subscriptionID string) WorkspacePrivateLinkResourcesClient { + return NewWorkspacePrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspacePrivateLinkResourcesClientWithBaseURI creates an instance of the WorkspacePrivateLinkResourcesClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewWorkspacePrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) WorkspacePrivateLinkResourcesClient { + return WorkspacePrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a private link resource that need to be created for a workspace. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +// groupName - the name of the private link resource group. +func (client WorkspacePrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, groupName string) (result PrivateLinkResourceDescription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacePrivateLinkResourcesClient.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.WorkspacePrivateLinkResourcesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, groupName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacePrivateLinkResourcesClient", "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.WorkspacePrivateLinkResourcesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacePrivateLinkResourcesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkspacePrivateLinkResourcesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, groupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupName": autorest.Encode("path", groupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/privateLinkResources/{groupName}", 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 WorkspacePrivateLinkResourcesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkspacePrivateLinkResourcesClient) GetResponder(resp *http.Response) (result PrivateLinkResourceDescription, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace gets the private link resources that need to be created for a workspace. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +func (client WorkspacePrivateLinkResourcesClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result PrivateLinkResourceListResultDescription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacePrivateLinkResourcesClient.ListByWorkspace") + 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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.WorkspacePrivateLinkResourcesClient", "ListByWorkspace", err.Error()) + } + + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacePrivateLinkResourcesClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacePrivateLinkResourcesClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacePrivateLinkResourcesClient", "ListByWorkspace", resp, "Failure responding to request") + return + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client WorkspacePrivateLinkResourcesClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}/privateLinkResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspacePrivateLinkResourcesClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client WorkspacePrivateLinkResourcesClient) ListByWorkspaceResponder(resp *http.Response) (result PrivateLinkResourceListResultDescription, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/workspaces.go b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/workspaces.go new file mode 100644 index 000000000000..3d48d1dcd5b3 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis/workspaces.go @@ -0,0 +1,631 @@ +package healthcareapis + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +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" +) + +// WorkspacesClient is the azure Healthcare APIs Client +type WorkspacesClient struct { + BaseClient +} + +// NewWorkspacesClient creates an instance of the WorkspacesClient client. +func NewWorkspacesClient(subscriptionID string) WorkspacesClient { + return NewWorkspacesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspacesClientWithBaseURI creates an instance of the WorkspacesClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) WorkspacesClient { + return WorkspacesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a workspace resource with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +// workspace - the parameters for creating or updating a healthcare workspace. +func (client WorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, workspace Workspace) (result WorkspacesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.WorkspacesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, workspace) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WorkspacesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, workspace Workspace) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}", pathParameters), + autorest.WithJSON(workspace), + 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 WorkspacesClient) CreateOrUpdateSender(req *http.Request) (future WorkspacesCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) CreateOrUpdateResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a specified workspace. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +func (client WorkspacesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result WorkspacesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.WorkspacesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WorkspacesClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}", 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 WorkspacesClient) DeleteSender(req *http.Request) (future WorkspacesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified workspace. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +func (client WorkspacesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string) (result Workspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.WorkspacesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "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.WorkspacesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkspacesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}", 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 WorkspacesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) GetResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup lists all the available workspaces under the specified resource group. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +func (client WorkspacesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result WorkspaceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.wl.Response.Response != nil { + sc = result.wl.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.WorkspacesClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.wl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.wl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.wl.hasNextLink() && result.wl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client WorkspacesClient) 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 = "2021-11-01" + 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/workspaces", 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 WorkspacesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) ListByResourceGroupResponder(resp *http.Response) (result WorkspaceList, err error) { + err = autorest.Respond( + resp, + 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 WorkspacesClient) listByResourceGroupNextResults(ctx context.Context, lastResults WorkspaceList) (result WorkspaceList, err error) { + req, err := lastResults.workspaceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "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.WorkspacesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspacesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result WorkspaceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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 +} + +// ListBySubscription lists all the available workspaces under the specified subscription. +func (client WorkspacesClient) ListBySubscription(ctx context.Context) (result WorkspaceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListBySubscription") + defer func() { + sc := -1 + if result.wl.Response.Response != nil { + sc = result.wl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.wl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.wl, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.wl.hasNextLink() && result.wl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client WorkspacesClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.HealthcareApis/workspaces", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspacesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) ListBySubscriptionResponder(resp *http.Response) (result WorkspaceList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client WorkspacesClient) listBySubscriptionNextResults(ctx context.Context, lastResults WorkspaceList) (result WorkspaceList, err error) { + req, err := lastResults.workspaceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspacesClient) ListBySubscriptionComplete(ctx context.Context) (result WorkspaceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListBySubscription") + 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.ListBySubscription(ctx) + return +} + +// Update patch workspace details. +// Parameters: +// resourceGroupName - the name of the resource group that contains the service instance. +// workspaceName - the name of workspace resource. +// workspacePatchResource - the parameters for updating a specified workspace. +func (client WorkspacesClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, workspacePatchResource WorkspacePatchResource) (result WorkspacesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("healthcareapis.WorkspacesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, workspaceName, workspacePatchResource) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "healthcareapis.WorkspacesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client WorkspacesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, workspacePatchResource WorkspacePatchResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2021-11-01" + 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/workspaces/{workspaceName}", pathParameters), + autorest.WithJSON(workspacePatchResource), + 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 WorkspacesClient) UpdateSender(req *http.Request) (future WorkspacesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) UpdateResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 049db55ff331..2545bb15973d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -35,7 +35,7 @@ github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac github.com/Azure/azure-sdk-for-go/services/guestconfiguration/mgmt/2020-06-25/guestconfiguration github.com/Azure/azure-sdk-for-go/services/hdinsight/mgmt/2018-06-01/hdinsight github.com/Azure/azure-sdk-for-go/services/healthbot/mgmt/2020-12-08/healthbot -github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2020-03-30/healthcareapis +github.com/Azure/azure-sdk-for-go/services/healthcareapis/mgmt/2021-11-01/healthcareapis github.com/Azure/azure-sdk-for-go/services/iotcentral/mgmt/2018-09-01/iotcentral github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2021-07-02/devices github.com/Azure/azure-sdk-for-go/services/keyvault/v7.1/keyvault diff --git a/website/docs/d/healthcare_workspace.html.markdown b/website/docs/d/healthcare_workspace.html.markdown new file mode 100644 index 000000000000..b0636488a5bd --- /dev/null +++ b/website/docs/d/healthcare_workspace.html.markdown @@ -0,0 +1,46 @@ +--- +subcategory: "Healthcare" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_healthcare_workspace" +description: |- + Get information about an existing Healthcare Workspace +--- + +# Data Source: azurerm_healthcare_workspace + +Use this data source to access information about an existing Healthcare Workspace + +## Example Usage + +```hcl +data "azurerm_healthcare_workspace" "example" { + name = "example-healthcare_service" + resource_group_name = "example-resources" +} + +output "healthcare_workspace_id" { + value = data.azurerm_healthcare_workspace.example.id +} +``` + +## Argument Reference + +* `name` - The name of the Healthcare Workspace. + +* `resource_group_name` - The name of the Resource Group in which the Healthcare Workspace exists. + +## Attributes Reference + +The following attributes are exported: + +* `id` - The ID of the Healthcare Workspace. + +* `location` - The Azure Region where the Healthcare Workspace is located. + +* `tags` - A map of tags assigned to the Healthcare Workspace. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: + +* `read` - (Defaults to 5 minutes) Used when retrieving the Healthcare Workspace. diff --git a/website/docs/r/healthcare_workspace.html.markdown b/website/docs/r/healthcare_workspace.html.markdown new file mode 100644 index 000000000000..02108b0cb507 --- /dev/null +++ b/website/docs/r/healthcare_workspace.html.markdown @@ -0,0 +1,53 @@ +--- +subcategory: "Healthcare" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_healthcare_workspace" +description: |- + Manages a Healthcare Workspace. +--- + +# azurerm_healthcare_workspace + +Manages a Healthcare workspace + +## Example Usage + +```hcl +resource "azurerm_healthcare_workspace" "test" { + name = "tfexworkspace" + resource_group_name = "tfex-resource_group" + location = "east us" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) Specifies the name of the Healthcare Workspace. Changing this forces a new Healthcare Workspace to be created. + +* `resource_group_name` - (Required) Specifies the name of the Resource Group where the Healthcare Workspace should exist. Changing this forces a new Healthcare Workspace to be created. + +* `location` - (Required) Specifies the Azure Region where the Healthcare Workspace should be created. Changing this forces a new Healthcare Workspace to be created. + +## Attributes Reference + +The following attributes are exported: + +* `id` - The ID of the Healthcare Workspace. + +## Timeouts +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: + +* `create` - (Defaults to 30 minutes) Used when creating the Healthcare Workspace. + * `update` - (Defaults to 30 minutes) Used when updating the Healthcare Workspace. + * `read` - (Defaults to 5 minutes) Used when retrieving the Healthcare Workspace. + * `delete` - (Defaults to 30 minutes) Used when deleting the Healthcare Workspace. + +## Import + +Healthcare Workspaces can be imported using the resource`id`, e.g. + +```shell +terraform import azurerm_healthcare_workspace.example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.HealthcareApis/workspaces/workspace1 +```