diff --git a/.github/labeler-issue-triage.yml b/.github/labeler-issue-triage.yml index 93aa7ae0a448..f76df833c317 100644 --- a/.github/labeler-issue-triage.yml +++ b/.github/labeler-issue-triage.yml @@ -25,7 +25,7 @@ service/app-configuration: - '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_app_configuration((.|\n)*)###' service/app-service: - - '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_(app_service_environment_v3\W+|app_service_environment_v3\W+|app_service_source_control\W+|app_service_source_control_slot\W+|function_app_active_slot\W+|function_app_function\W+|function_app_hybrid_connection\W+|linux_function_app\W+|linux_function_app\W+|linux_function_app_slot\W+|linux_web_app\W+|linux_web_app\W+|linux_web_app_slot\W+|service_plan|source_control_token|web_app_|windows_function_app\W+|windows_function_app\W+|windows_function_app_slot\W+|windows_web_app\W+|windows_web_app\W+|windows_web_app_slot\W+)((.|\n)*)###' + - '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_(app_service_environment_v3\W+|app_service_environment_v3\W+|app_service_source_control\W+|app_service_source_control_slot\W+|function_app_active_slot\W+|function_app_function\W+|function_app_hybrid_connection\W+|linux_function_app\W+|linux_function_app\W+|linux_function_app_slot\W+|linux_web_app\W+|linux_web_app\W+|linux_web_app_slot\W+|service_plan|source_control_token|static_web_app|web_app_|windows_function_app\W+|windows_function_app\W+|windows_function_app_slot\W+|windows_web_app\W+|windows_web_app\W+|windows_web_app_slot\W+)((.|\n)*)###' service/application-insights: - '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_application_insights((.|\n)*)###' diff --git a/internal/services/appservice/client/client.go b/internal/services/appservice/client/client.go index 655d4a0da987..1063269f2138 100644 --- a/internal/services/appservice/client/client.go +++ b/internal/services/appservice/client/client.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/appserviceenvironments" "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/appserviceplans" "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/resourceproviders" + "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites" "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/webapps" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) @@ -17,6 +18,7 @@ type Client struct { AppServiceEnvironmentClient *appserviceenvironments.AppServiceEnvironmentsClient ResourceProvidersClient *resourceproviders.ResourceProvidersClient ServicePlanClient *appserviceplans.AppServicePlansClient + StaticSitesClient *staticsites.StaticSitesClient WebAppsClient *webapps.WebAppsClient } @@ -39,6 +41,12 @@ func NewClient(o *common.ClientOptions) (*Client, error) { } o.Configure(resourceProvidersClient.Client, o.Authorizers.ResourceManager) + staticSitesClient, err := staticsites.NewStaticSitesClientWithBaseURI(o.Environment.ResourceManager) + if err != nil { + return nil, fmt.Errorf("building StaticSites client: %+v", err) + } + o.Configure(staticSitesClient.Client, o.Authorizers.ResourceManager) + servicePlanClient, err := appserviceplans.NewAppServicePlansClientWithBaseURI(o.Environment.ResourceManager) if err != nil { return nil, fmt.Errorf("building ServicePlan client: %+v", err) @@ -49,6 +57,7 @@ func NewClient(o *common.ClientOptions) (*Client, error) { AppServiceEnvironmentClient: appServiceEnvironmentClient, ResourceProvidersClient: resourceProvidersClient, ServicePlanClient: servicePlanClient, + StaticSitesClient: staticSitesClient, WebAppsClient: webAppServiceClient, }, nil } diff --git a/internal/services/appservice/helpers/enums.go b/internal/services/appservice/helpers/enums.go index 9dc4282f967d..3ed42b881c69 100644 --- a/internal/services/appservice/helpers/enums.go +++ b/internal/services/appservice/helpers/enums.go @@ -10,3 +10,8 @@ const ( PublicNetworkAccessEnabled string = "Enabled" PublicNetworkAccessDisabled string = "Disabled" ) + +const ( + ValidationTypeTXT = "dns-txt-token" + ValidationTypeCName = "cname-delegation" +) diff --git a/internal/services/appservice/helpers/static_web_app.go b/internal/services/appservice/helpers/static_web_app.go new file mode 100644 index 000000000000..783a3c9cb369 --- /dev/null +++ b/internal/services/appservice/helpers/static_web_app.go @@ -0,0 +1,67 @@ +package helpers + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" +) + +type BasicAuth struct { + Password string `tfschema:"password"` + Environments string `tfschema:"environments"` +} + +type BasicAuthComputed struct { + Environments string `tfschema:"environments"` +} + +const ( + EnvironmentsTypeAllEnvironments string = "AllEnvironments" + EnvironmentsTypeStagingEnvironments string = "StagingEnvironments" + EnvironmentsTypeSpecifiedEnvironments string = "SpecifiedEnvironments" +) + +func BasicAuthSchema() *pluginsdk.Schema { + return &pluginsdk.Schema{ + Type: pluginsdk.TypeList, + MaxItems: 1, + Optional: true, + Sensitive: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*schema.Schema{ + "password": { + Type: pluginsdk.TypeString, + Required: true, + Sensitive: true, + ValidateFunc: validate.StaticWebAppPassword, + }, + + "environments": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + EnvironmentsTypeAllEnvironments, + EnvironmentsTypeStagingEnvironments, + }, false), + }, + }, + }, + } +} + +func BasicAuthSchemaComputed() *pluginsdk.Schema { + return &pluginsdk.Schema{ + Type: pluginsdk.TypeList, + Computed: true, + Sensitive: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*schema.Schema{ + "environments": { + Type: pluginsdk.TypeString, + Computed: true, + }, + }, + }, + } +} diff --git a/internal/services/appservice/registration.go b/internal/services/appservice/registration.go index 332f36462711..27ea650960cf 100644 --- a/internal/services/appservice/registration.go +++ b/internal/services/appservice/registration.go @@ -30,6 +30,7 @@ func (r Registration) DataSources() []sdk.DataSource { LinuxFunctionAppDataSource{}, LinuxWebAppDataSource{}, ServicePlanDataSource{}, + StaticWebAppDataSource{}, WindowsFunctionAppDataSource{}, WindowsWebAppDataSource{}, } @@ -49,6 +50,8 @@ func (r Registration) Resources() []sdk.Resource { ServicePlanResource{}, SourceControlResource{}, SourceControlSlotResource{}, + StaticWebAppResource{}, + StaticWebAppCustomDomainResource{}, WebAppActiveSlotResource{}, WebAppHybridConnectionResource{}, WindowsFunctionAppResource{}, diff --git a/internal/services/appservice/sdkhacks/static_web_app_basic_auth.go b/internal/services/appservice/sdkhacks/static_web_app_basic_auth.go new file mode 100644 index 000000000000..dedd32d7caba --- /dev/null +++ b/internal/services/appservice/sdkhacks/static_web_app_basic_auth.go @@ -0,0 +1,89 @@ +package sdkhacks + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites" + "github.com/hashicorp/go-azure-sdk/sdk/client" +) + +type StaticSitesClient struct { + client *staticsites.StaticSitesClient +} + +func NewStaticWebAppClient(client *staticsites.StaticSitesClient) StaticSitesClient { + return StaticSitesClient{ + client: client, + } +} + +// CreateOrUpdateBasicAuth ... +func (c StaticSitesClient) CreateOrUpdateBasicAuth(ctx context.Context, id staticsites.StaticSiteId, input staticsites.StaticSiteBasicAuthPropertiesARMResource) (result staticsites.CreateOrUpdateBasicAuthOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/config/basicAuth", id.ID()), + } + + req, err := c.client.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} + +func (c StaticSitesClient) GetBasicAuth(ctx context.Context, id staticsites.StaticSiteId) (result staticsites.GetBasicAuthOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/basicAuth/default", id.ID()), + } + + req, err := c.client.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/internal/services/appservice/static_web_app_custom_domain.go b/internal/services/appservice/static_web_app_custom_domain.go new file mode 100644 index 000000000000..69cd5a4af125 --- /dev/null +++ b/internal/services/appservice/static_web_app_custom_domain.go @@ -0,0 +1,231 @@ +package appservice + +import ( + "context" + "fmt" + "strings" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" +) + +type StaticWebAppCustomDomainResource struct{} + +var _ sdk.Resource = StaticWebAppCustomDomainResource{} + +type StaticWebAppCustomDomainResourceModel struct { + DomainName string `tfschema:"domain_name"` + StaticSiteId string `tfschema:"static_web_app_id"` + ValidationType string `tfschema:"validation_type"` + ValidationToken string `tfschema:"validation_token"` +} + +func (r StaticWebAppCustomDomainResource) Arguments() map[string]*schema.Schema { + return map[string]*pluginsdk.Schema{ + "static_web_app_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: staticsites.ValidateStaticSiteID, + }, + + "domain_name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "validation_type": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + helpers.ValidationTypeTXT, + helpers.ValidationTypeCName, + }, false), + }, + } +} + +func (r StaticWebAppCustomDomainResource) Attributes() map[string]*schema.Schema { + return map[string]*pluginsdk.Schema{ + "validation_token": { + Type: pluginsdk.TypeString, + Sensitive: true, + Computed: true, + }, + } +} + +func (r StaticWebAppCustomDomainResource) ModelObject() interface{} { + return &StaticWebAppCustomDomainResource{} +} + +func (r StaticWebAppCustomDomainResource) ResourceType() string { + return "azurerm_static_web_app_custom_domain" +} + +func (r StaticWebAppCustomDomainResource) Create() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppService.StaticSitesClient + + model := StaticWebAppCustomDomainResourceModel{} + + if err := metadata.Decode(&model); err != nil { + return err + } + + siteId, err := staticsites.ParseStaticSiteID(model.StaticSiteId) + if err != nil { + return err + } + + id := staticsites.NewCustomDomainID(siteId.SubscriptionId, siteId.ResourceGroupName, siteId.StaticSiteName, model.DomainName) + + existing, err := client.GetStaticSiteCustomDomain(ctx, id) + if err != nil { + if !response.WasNotFound(existing.HttpResponse) { + return fmt.Errorf("checking for presence of existing %s: %+v", id, err) + } + } + if !response.WasNotFound(existing.HttpResponse) { + return metadata.ResourceRequiresImport(r.ResourceType(), id) + } + + customDomain := staticsites.StaticSiteCustomDomainRequestPropertiesARMResource{ + Properties: &staticsites.StaticSiteCustomDomainRequestPropertiesARMResourceProperties{ + ValidationMethod: pointer.To(model.ValidationType), + }, + } + + if strings.EqualFold(model.ValidationType, helpers.ValidationTypeCName) { + if err = client.CreateOrUpdateStaticSiteCustomDomainThenPoll(ctx, id, customDomain); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + } else { + if _, err := client.CreateOrUpdateStaticSiteCustomDomain(ctx, id, customDomain); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + deadline, ok := ctx.Deadline() + if !ok { + return fmt.Errorf("internal-error: context was missing a deadline") + } + stateConf := &pluginsdk.StateChangeConf{ + Pending: []string{ + string(staticsites.CustomDomainStatusRetrievingValidationToken), + }, + Target: []string{ + string(staticsites.CustomDomainStatusValidating), + }, + MinTimeout: 20 * time.Second, + Timeout: time.Until(deadline), + Refresh: func() (interface{}, string, error) { + domain, err := client.GetStaticSiteCustomDomain(ctx, id) + if err != nil { + return domain, "Error", fmt.Errorf("retrieving %s: %+v", id, err) + } + + if domain.Model == nil || domain.Model.Properties == nil { + return nil, "Failed", fmt.Errorf("`properties` was missing from the response") + } + return domain, string(pointer.From(domain.Model.Properties.Status)), nil + }, + } + + if _, err := stateConf.WaitForStateContext(ctx); err != nil { + return fmt.Errorf("waiting for DNS Validation after Creation of %s %+v", id, err) + } + } + + // Once validated the token value is zeroed, + domain, err := client.GetStaticSiteCustomDomain(ctx, id) + if err != nil { + return fmt.Errorf("reading validation token for %s: %+v", id, err) + } + if m := domain.Model; m != nil { + if m.Properties != nil { + if err = metadata.ResourceData.Set("validation_token", m.Properties.ValidationToken); err != nil { + return fmt.Errorf("setting validation_toekn value for %s: %+v", id, err) + } + } + } + + metadata.SetID(id) + + return nil + }, + } +} + +func (r StaticWebAppCustomDomainResource) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppService.StaticSitesClient + + id, err := staticsites.ParseCustomDomainID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + // Some values are not retrievable from the API so we try and load the config. + state := StaticWebAppCustomDomainResourceModel{} + if err := metadata.Decode(&state); err != nil { + return err + } + + existing, err := client.GetStaticSiteCustomDomain(ctx, *id) + if err != nil { + if response.WasNotFound(existing.HttpResponse) { + return metadata.MarkAsGone(*id) + } + return fmt.Errorf("retrieving %s: %+v", *id, err) + } + + state.DomainName = id.CustomDomainName + state.StaticSiteId = staticsites.NewStaticSiteID(id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName).ID() + + if model := existing.Model; model != nil { + if props := model.Properties; props != nil { + state.ValidationToken = pointer.From(props.ValidationToken) + } + } + + return metadata.Encode(&state) + }, + } +} + +func (r StaticWebAppCustomDomainResource) Delete() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppService.StaticSitesClient + + id, err := staticsites.ParseCustomDomainID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + if err = client.DeleteStaticSiteCustomDomainThenPoll(ctx, *id); err != nil { + return fmt.Errorf("deleting %s: %+v", *id, err) + } + + return nil + }, + } +} + +func (r StaticWebAppCustomDomainResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { + return staticsites.ValidateCustomDomainID +} diff --git a/internal/services/appservice/static_web_app_custom_domain_resource_test.go b/internal/services/appservice/static_web_app_custom_domain_resource_test.go new file mode 100644 index 000000000000..5402f7532637 --- /dev/null +++ b/internal/services/appservice/static_web_app_custom_domain_resource_test.go @@ -0,0 +1,168 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package appservice_test + +import ( + "context" + "fmt" + "os" + "testing" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites" + "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/tf/pluginsdk" +) + +type StaticWebAppCustomDomainResource struct{} + +func TestAccAzureStaticWebAppCustomDomain_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app_custom_domain", "test") + r := StaticWebAppCustomDomainResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("validation_token").Exists(), + ), + }, + data.ImportStep("validation_type", "validation_token"), + }) +} + +func TestAccAzureStaticWebAppCustomDomain_cnameValidation(t *testing.T) { + if os.Getenv("ARM_TEST_DNS_ZONE") == "" { + t.Skipf("Skipping Static Web App Test CNAME test as ARM_TEST_DNS_ZONE is not set.") + } + data := acceptance.BuildTestData(t, "azurerm_static_web_app_custom_domain", "test") + r := StaticWebAppCustomDomainResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.cnameValidation(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("validation_type", "validation_token"), + }) +} + +func TestAccAzureStaticWebAppCustomDomain_requiresImport(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app_custom_domain", "test") + r := StaticWebAppCustomDomainResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.RequiresImportErrorStep(r.requiresImport), + }) +} + +func (r StaticWebAppCustomDomainResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { + id, err := staticsites.ParseCustomDomainID(state.ID) + if err != nil { + return nil, err + } + + resp, err := clients.AppService.StaticSitesClient.GetStaticSiteCustomDomain(ctx, *id) + if err != nil { + if response.WasNotFound(resp.HttpResponse) { + return pointer.To(false), nil + } + return nil, fmt.Errorf("retrieving %q: %+v", id, err) + } + + return pointer.To(resp.Model != nil), nil +} + +func (r StaticWebAppCustomDomainResource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_static_web_app" "test" { + name = "acctestSS-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" +} + +resource "azurerm_static_web_app_custom_domain" "test" { + static_web_app_id = azurerm_static_web_app.test.id + domain_name = "acctestSS-%d.contoso.com" + validation_type = "dns-txt-token" +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) +} + +func (r StaticWebAppCustomDomainResource) cnameValidation(data acceptance.TestData) string { + dnsZone := os.Getenv("ARM_TEST_DNS_ZONE") + dnsZoneRG := os.Getenv("ARM_TEST_DATA_RESOURCE_GROUP") + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +data "azurerm_dns_zone" "test" { + name = "%[3]s" + resource_group_name = "%[4]s" +} + +resource "azurerm_dns_cname_record" "test" { + name = "swa%[1]d" + resource_group_name = data.azurerm_dns_zone.test.resource_group_name + zone_name = data.azurerm_dns_zone.test.name + ttl = 300 + record = azurerm_static_web_app.test.default_host_name +} + +resource "azurerm_static_web_app" "test" { + name = "acctestSS-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" +} + +resource "azurerm_static_web_app_custom_domain" "test" { + static_web_app_id = azurerm_static_web_app.test.id + domain_name = trimsuffix(azurerm_dns_cname_record.test.fqdn, ".") + validation_type = "cname-delegation" +} +`, data.RandomInteger, data.Locations.Primary, dnsZone, dnsZoneRG) +} + +func (r StaticWebAppCustomDomainResource) requiresImport(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_static_web_app_custom_domain" "import" { + static_web_app_id = azurerm_static_web_app_custom_domain.test.static_web_app_id + domain_name = azurerm_static_web_app_custom_domain.test.domain_name + validation_type = azurerm_static_web_app_custom_domain.test.validation_type +} +`, r.basic(data)) +} diff --git a/internal/services/appservice/static_web_app_data_source.go b/internal/services/appservice/static_web_app_data_source.go new file mode 100644 index 000000000000..d7c7f29142b0 --- /dev/null +++ b/internal/services/appservice/static_web_app_data_source.go @@ -0,0 +1,199 @@ +package appservice + +import ( + "context" + "fmt" + "strings" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/sdkhacks" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/tags" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" +) + +type StaticWebAppDataSource struct{} + +var _ sdk.DataSource = StaticWebAppDataSource{} + +type StaticWebAppDataSourceModel struct { + Name string `tfschema:"name"` + ResourceGroupName string `tfschema:"resource_group_name"` + Location string `tfschema:"location"` + ApiKey string `tfschema:"api_key"` + AppSettings map[string]string `tfschema:"app_settings"` + BasicAuth []helpers.BasicAuthComputed `tfschema:"basic_auth"` + ConfigFileChanges bool `tfschema:"configuration_file_changes_enabled"` + DefaultHostName string `tfschema:"default_host_name"` + Identity []identity.ModelSystemAssignedUserAssigned `tfschema:"identity"` + PreviewEnvironments bool `tfschema:"preview_environments_enabled"` + SkuTier string `tfschema:"sku_tier"` + SkuSize string `tfschema:"sku_size"` + Tags map[string]string `tfschema:"tags"` +} + +func (s StaticWebAppDataSource) Arguments() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.StaticWebAppName, + }, + + "resource_group_name": commonschema.ResourceGroupNameForDataSource(), + } +} + +func (s StaticWebAppDataSource) Attributes() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "location": commonschema.LocationComputed(), + + "configuration_file_changes_enabled": { + Type: pluginsdk.TypeBool, + Computed: true, + }, + + "preview_environments_enabled": { + Type: pluginsdk.TypeBool, + Computed: true, + }, + + "sku_tier": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "sku_size": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "app_settings": { + Type: pluginsdk.TypeMap, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "basic_auth": helpers.BasicAuthSchemaComputed(), + + "identity": commonschema.SystemAssignedUserAssignedIdentityComputed(), + + "api_key": { + Type: pluginsdk.TypeString, + Computed: true, + Sensitive: true, + }, + + "default_host_name": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "tags": tags.SchemaDataSource(), + } +} + +func (s StaticWebAppDataSource) ModelObject() interface{} { + return &StaticWebAppDataSourceModel{} +} + +func (s StaticWebAppDataSource) ResourceType() string { + return "azurerm_static_web_app" +} + +func (s StaticWebAppDataSource) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppService.StaticSitesClient + subscriptionId := metadata.Client.Account.SubscriptionId + + var state StaticWebAppDataSourceModel + if err := metadata.Decode(&state); err != nil { + return err + } + + id := staticsites.NewStaticSiteID(subscriptionId, state.ResourceGroupName, state.Name) + + staticSite, err := client.GetStaticSite(ctx, id) + if err != nil { + if response.WasNotFound(staticSite.HttpResponse) { + return fmt.Errorf("%s not found", id) + } + return fmt.Errorf("retrieving %s: %+v", id, err) + } + + if model := staticSite.Model; model != nil { + state.Location = location.Normalize(model.Location) + + ident, err := identity.FlattenSystemAndUserAssignedMapToModel(model.Identity) + if err != nil { + return fmt.Errorf("flattening identity for %s: %+v", id, err) + } + state.Identity = pointer.From(ident) + + state.Tags = pointer.From(model.Tags) + if props := model.Properties; props != nil { + state.ConfigFileChanges = pointer.From(props.AllowConfigFileUpdates) + state.DefaultHostName = pointer.From(props.DefaultHostname) + state.PreviewEnvironments = pointer.From(props.StagingEnvironmentPolicy) == staticsites.StagingEnvironmentPolicyEnabled + } + + if sku := model.Sku; sku != nil { + state.SkuSize = pointer.From(sku.Name) + state.SkuTier = pointer.From(sku.Tier) + } + + sec, err := client.ListStaticSiteSecrets(ctx, id) + if err != nil || sec.Model == nil { + return fmt.Errorf("retrieving secrets for %s: %+v", id, err) + } + + if secProps := sec.Model.Properties; secProps != nil { + propsMap := pointer.From(secProps) + apiKey := "" + apiKey = propsMap["apiKey"] + state.ApiKey = apiKey + } + } + + appSettings, err := client.ListStaticSiteAppSettings(ctx, id) + if err != nil { + return fmt.Errorf("retrieving app_settings for %s: %+v", id, err) + } + if appSettingsModel := appSettings.Model; appSettingsModel != nil { + state.AppSettings = pointer.From(appSettingsModel.Properties) + } + + sdkHackClient := sdkhacks.NewStaticWebAppClient(client) + auth, err := sdkHackClient.GetBasicAuth(ctx, id) + if err != nil && !response.WasNotFound(auth.HttpResponse) { // If basic auth is not configured then this 404's + return fmt.Errorf("retrieving auth config for %s: %+v", id, err) + } + if !response.WasNotFound(auth.HttpResponse) { + if authModel := auth.Model; authModel != nil && authModel.Properties != nil && !strings.EqualFold(authModel.Properties.ApplicableEnvironmentsMode, helpers.EnvironmentsTypeSpecifiedEnvironments) { + state.BasicAuth = []helpers.BasicAuthComputed{ + { + Environments: authModel.Properties.ApplicableEnvironmentsMode, + }, + } + } + } + + metadata.SetID(id) + + return metadata.Encode(&state) + }, + } +} diff --git a/internal/services/appservice/static_web_app_data_source_test.go b/internal/services/appservice/static_web_app_data_source_test.go new file mode 100644 index 000000000000..1558e0becadc --- /dev/null +++ b/internal/services/appservice/static_web_app_data_source_test.go @@ -0,0 +1,44 @@ +package appservice_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" +) + +type StaticWebAppDataSource struct{} + +func TestAccAzureStaticWebAppDataSource_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_static_web_app", "test") + r := StaticWebAppDataSource{} + + data.DataSourceTest(t, []acceptance.TestStep{ + { + Config: r.complete(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("default_host_name").Exists(), + check.That(data.ResourceName).Key("api_key").Exists(), + check.That(data.ResourceName).Key("tags.environment").HasValue("acceptance"), + check.That(data.ResourceName).Key("basic_auth.#").HasValue("1"), + check.That(data.ResourceName).Key("basic_auth.0.environments").HasValue("AllEnvironments"), + check.That(data.ResourceName).Key("identity.#").Exists(), + check.That(data.ResourceName).Key("identity.0.type").HasValue("SystemAssigned, UserAssigned"), + ), + }, + }) +} + +func (StaticWebAppDataSource) complete(data acceptance.TestData) string { + return fmt.Sprintf(` + + +%s + +data "azurerm_static_web_app" "test" { + name = azurerm_static_web_app.test.name + resource_group_name = azurerm_static_web_app.test.resource_group_name +} +`, StaticWebAppResource{}.complete(data)) +} diff --git a/internal/services/appservice/static_web_app_resource.go b/internal/services/appservice/static_web_app_resource.go new file mode 100644 index 000000000000..f3272efb290e --- /dev/null +++ b/internal/services/appservice/static_web_app_resource.go @@ -0,0 +1,464 @@ +package appservice + +import ( + "context" + "fmt" + "strings" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/resourceproviders" + "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/helpers" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/sdkhacks" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/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/tf/validation" +) + +type StaticWebAppResource struct{} + +var _ sdk.ResourceWithUpdate = StaticWebAppResource{} + +var _ sdk.ResourceWithCustomizeDiff = StaticWebAppResource{} + +type StaticWebAppResourceModel struct { + Name string `tfschema:"name"` + ResourceGroupName string `tfschema:"resource_group_name"` + Location string `tfschema:"location"` + AppSettings map[string]string `tfschema:"app_settings"` + BasicAuth []helpers.BasicAuth `tfschema:"basic_auth"` + ConfigFileChanges bool `tfschema:"configuration_file_changes_enabled"` + Identity []identity.ModelSystemAssignedUserAssigned `tfschema:"identity"` + PreviewEnvironments bool `tfschema:"preview_environments_enabled"` + SkuTier string `tfschema:"sku_tier"` + SkuSize string `tfschema:"sku_size"` + Tags map[string]string `tfschema:"tags"` + + ApiKey string `tfschema:"api_key"` + DefaultHostName string `tfschema:"default_host_name"` +} + +func (r StaticWebAppResource) Arguments() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.StaticWebAppName, + }, + + "resource_group_name": commonschema.ResourceGroupName(), + + "location": commonschema.Location(), + + "configuration_file_changes_enabled": { + Type: pluginsdk.TypeBool, + Optional: true, + Default: true, + }, + + "preview_environments_enabled": { + Type: pluginsdk.TypeBool, + Optional: true, + Default: true, + }, + + "sku_tier": { + Type: pluginsdk.TypeString, + Optional: true, + Default: string(resourceproviders.SkuNameFree), + ValidateFunc: validation.StringInSlice([]string{ + string(resourceproviders.SkuNameStandard), + string(resourceproviders.SkuNameFree), + }, false), + }, + + "sku_size": { + Type: pluginsdk.TypeString, + Optional: true, + Default: string(resourceproviders.SkuNameFree), + ValidateFunc: validation.StringInSlice([]string{ + string(resourceproviders.SkuNameStandard), + string(resourceproviders.SkuNameFree), + }, false), + }, + + "app_settings": { + Type: pluginsdk.TypeMap, + Optional: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "basic_auth": helpers.BasicAuthSchema(), + + "identity": commonschema.SystemAssignedUserAssignedIdentityOptional(), + + "tags": tags.Schema(), + } +} + +func (r StaticWebAppResource) Attributes() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "api_key": { + Type: pluginsdk.TypeString, + Computed: true, + Sensitive: true, + }, + + "default_host_name": { + Type: pluginsdk.TypeString, + Computed: true, + }, + } +} + +func (r StaticWebAppResource) ModelObject() interface{} { + return &StaticWebAppResourceModel{} +} + +func (r StaticWebAppResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { + return staticsites.ValidateStaticSiteID +} + +func (r StaticWebAppResource) ResourceType() string { + return "azurerm_static_web_app" +} + +func (r StaticWebAppResource) Create() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppService.StaticSitesClient + subscriptionId := metadata.Client.Account.SubscriptionId + + model := StaticWebAppResourceModel{} + + if err := metadata.Decode(&model); err != nil { + return err + } + + id := staticsites.NewStaticSiteID(subscriptionId, model.ResourceGroupName, model.Name) + + existing, err := client.GetStaticSite(ctx, id) + if err != nil { + if !response.WasNotFound(existing.HttpResponse) { + return fmt.Errorf("checking for presence of existing %s: %+v", id, err) + } + } + if !response.WasNotFound(existing.HttpResponse) { + return metadata.ResourceRequiresImport(r.ResourceType(), id) + } + + envelope := staticsites.StaticSiteARMResource{ + Location: location.Normalize(model.Location), + Properties: nil, + Sku: &staticsites.SkuDescription{ + Name: pointer.To(model.SkuSize), + Tier: pointer.To(model.SkuTier), + }, + Tags: pointer.To(model.Tags), + } + + ident, err := identity.ExpandSystemAndUserAssignedMapFromModel(model.Identity) + if err != nil { + return fmt.Errorf("expanding identity for %s: %+v", id, err) + } + if ident.Type != identity.TypeNone { + envelope.Identity = ident + } + + props := &staticsites.StaticSite{ + AllowConfigFileUpdates: pointer.To(model.ConfigFileChanges), + StagingEnvironmentPolicy: pointer.To(staticsites.StagingEnvironmentPolicyEnabled), + } + + if !model.PreviewEnvironments { + props.StagingEnvironmentPolicy = pointer.To(staticsites.StagingEnvironmentPolicyDisabled) + } + + envelope.Properties = props + + if err := client.CreateOrUpdateStaticSiteThenPoll(ctx, id, envelope); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + + metadata.SetID(id) + + if len(model.AppSettings) > 0 { + appSettings := staticsites.StringDictionary{ + Properties: pointer.To(model.AppSettings), + } + + if _, err = client.CreateOrUpdateStaticSiteAppSettings(ctx, id, appSettings); err != nil { + return fmt.Errorf("updating app settings for %s: %+v", id, err) + } + } + + if len(model.BasicAuth) > 0 { + sdkHackClient := sdkhacks.NewStaticWebAppClient(client) + + auth := model.BasicAuth[0] + + authProps := staticsites.StaticSiteBasicAuthPropertiesARMResource{ + Properties: &staticsites.StaticSiteBasicAuthPropertiesARMResourceProperties{ + ApplicableEnvironmentsMode: auth.Environments, + Password: pointer.To(auth.Password), + SecretState: pointer.To("Password"), + }, + } + + if _, err := sdkHackClient.CreateOrUpdateBasicAuth(ctx, id, authProps); err != nil { + return fmt.Errorf("setting basic auth on %s: %+v", id, err) + } + } + + return nil + }, + } +} + +func (r StaticWebAppResource) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppService.StaticSitesClient + + id, err := staticsites.ParseStaticSiteID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + staticSite, err := client.GetStaticSite(ctx, *id) + if err != nil { + if response.WasNotFound(staticSite.HttpResponse) { + return metadata.MarkAsGone(*id) + } + return fmt.Errorf("retrieving %s: %+v", *id, err) + } + + state := StaticWebAppResourceModel{ + Name: id.StaticSiteName, + ResourceGroupName: id.ResourceGroupName, + } + + if model := staticSite.Model; model != nil { + state.Location = location.Normalize(model.Location) + + ident, err := identity.FlattenSystemAndUserAssignedMapToModel(model.Identity) + if err != nil { + return fmt.Errorf("flattening identity for %s: %+v", *id, err) + } + state.Identity = pointer.From(ident) + + state.Tags = pointer.From(model.Tags) + if props := model.Properties; props != nil { + state.ConfigFileChanges = pointer.From(props.AllowConfigFileUpdates) + state.DefaultHostName = pointer.From(props.DefaultHostname) + state.PreviewEnvironments = pointer.From(props.StagingEnvironmentPolicy) == staticsites.StagingEnvironmentPolicyEnabled + } + + if sku := model.Sku; sku != nil { + state.SkuSize = pointer.From(sku.Name) + state.SkuTier = pointer.From(sku.Tier) + } + + sec, err := client.ListStaticSiteSecrets(ctx, *id) + if err != nil || sec.Model == nil { + return fmt.Errorf("retrieving secrets for %s: %+v", *id, err) + } + + if secProps := sec.Model.Properties; secProps != nil { + propsMap := pointer.From(secProps) + apiKey := "" + apiKey = propsMap["apiKey"] + state.ApiKey = apiKey + } + } + + appSettings, err := client.ListStaticSiteAppSettings(ctx, *id) + if err != nil { + return fmt.Errorf("retrieving app_settings for %s: %+v", *id, err) + } + if appSettingsModel := appSettings.Model; appSettingsModel != nil { + state.AppSettings = pointer.From(appSettingsModel.Properties) + } + + sdkHackClient := sdkhacks.NewStaticWebAppClient(client) + auth, err := sdkHackClient.GetBasicAuth(ctx, *id) + if err != nil && !response.WasNotFound(auth.HttpResponse) { // If basic auth is not configured then this 404's + return fmt.Errorf("retrieving auth config for %s: %+v", *id, err) + } + if !response.WasNotFound(auth.HttpResponse) { + if authModel := auth.Model; authModel != nil && authModel.Properties != nil && !strings.EqualFold(authModel.Properties.ApplicableEnvironmentsMode, helpers.EnvironmentsTypeSpecifiedEnvironments) { + state.BasicAuth = []helpers.BasicAuth{ + { + Password: metadata.ResourceData.Get("basic_auth.0.password").(string), // Grab this from the config, if we can. + Environments: authModel.Properties.ApplicableEnvironmentsMode, + }, + } + } + } + + return metadata.Encode(&state) + }, + } +} + +func (r StaticWebAppResource) Delete() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppService.StaticSitesClient + + id, err := staticsites.ParseStaticSiteID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + if err := client.DeleteStaticSiteThenPoll(ctx, *id); err != nil { + return fmt.Errorf("deleting %s: %+v", *id, err) + } + + return nil + }, + } +} + +func (r StaticWebAppResource) Update() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.AppService.StaticSitesClient + + config := StaticWebAppResourceModel{} + + if err := metadata.Decode(&config); err != nil { + return err + } + + id, err := staticsites.ParseStaticSiteID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + existing, err := client.GetStaticSite(ctx, *id) + if err != nil || existing.Model == nil { + return fmt.Errorf("retrieving %s for update: %+v", *id, err) + } + + model := *existing.Model + + if metadata.ResourceData.HasChange("identity") { + ident, err := identity.ExpandSystemAndUserAssignedMapFromModel(config.Identity) + if err != nil { + return err + } + model.Identity = ident + // If we're changing to `Free` we must remove the Identity first + if strings.EqualFold(string(resourceproviders.SkuNameFree), config.SkuTier) { + if err := client.CreateOrUpdateStaticSiteThenPoll(ctx, *id, model); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + // Once removed, the identity payload needs to be nilled or the API validation for `Free` will reject the request + model.Identity = nil + } + } + + if metadata.ResourceData.HasChanges("sku_tier", "sku_size") { + model.Sku = &staticsites.SkuDescription{ + Name: pointer.To(config.SkuSize), + Tier: pointer.To(config.SkuTier), + } + } + + if metadata.ResourceData.HasChange("configuration_file_changes_enabled") { + model.Properties.AllowConfigFileUpdates = pointer.To(config.ConfigFileChanges) + } + + if metadata.ResourceData.HasChange("preview_environments_enabled") { + if !config.PreviewEnvironments { + model.Properties.StagingEnvironmentPolicy = pointer.To(staticsites.StagingEnvironmentPolicyDisabled) + } else { + model.Properties.StagingEnvironmentPolicy = pointer.To(staticsites.StagingEnvironmentPolicyEnabled) + } + } + + if metadata.ResourceData.HasChange("tags") { + model.Tags = pointer.To(config.Tags) + } + + if err := client.CreateOrUpdateStaticSiteThenPoll(ctx, *id, model); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + + if metadata.ResourceData.HasChange("app_settings") { + appSettings := staticsites.StringDictionary{ + Properties: pointer.To(config.AppSettings), + } + + if _, err = client.CreateOrUpdateStaticSiteAppSettings(ctx, *id, appSettings); err != nil { + return fmt.Errorf("updating app settings for %s: %+v", id, err) + } + } + + if metadata.ResourceData.HasChange("basic_auth") { + sdkHackClient := sdkhacks.NewStaticWebAppClient(client) + authProps := staticsites.StaticSiteBasicAuthPropertiesARMResource{} + if len(config.BasicAuth) > 0 { + auth := config.BasicAuth[0] + authProps.Properties = &staticsites.StaticSiteBasicAuthPropertiesARMResourceProperties{ + ApplicableEnvironmentsMode: auth.Environments, + Password: pointer.To(auth.Password), + SecretState: pointer.To("Password"), + } + } else { + authProps.Properties = &staticsites.StaticSiteBasicAuthPropertiesARMResourceProperties{ + ApplicableEnvironmentsMode: "SpecifiedEnvironments", + Password: nil, + SecretState: nil, + } + } + + if _, err := sdkHackClient.CreateOrUpdateBasicAuth(ctx, *id, authProps); err != nil { + return fmt.Errorf("setting basic auth on %s: %+v", *id, err) + } + } + + return nil + }, + } +} + +func (r StaticWebAppResource) CustomizeDiff() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + rd := metadata.ResourceDiff + + skuTier := rd.Get("sku_tier").(string) + skuSize := rd.Get("sku_size").(string) + + if strings.EqualFold(skuTier, string(resourceproviders.SkuNameFree)) && strings.EqualFold(skuSize, string(resourceproviders.SkuNameFree)) { + basicAuth, authOk := rd.GetOk("basic_auth") + if authOk && len(basicAuth.([]interface{})) > 0 { + return fmt.Errorf("basic_auth cannot be used with the Free tier of Static Web Apps") + } + ident, identOk := rd.GetOk("identity") + if identOk && len(ident.([]interface{})) > 0 { + return fmt.Errorf("identities cannot be used with the Free tier of Static Web Apps") + } + } + + return nil + }, + } +} diff --git a/internal/services/appservice/static_web_app_resource_test.go b/internal/services/appservice/static_web_app_resource_test.go new file mode 100644 index 000000000000..479c4575ce51 --- /dev/null +++ b/internal/services/appservice/static_web_app_resource_test.go @@ -0,0 +1,645 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package appservice_test + +import ( + "context" + "fmt" + "regexp" + "testing" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites" + "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/tf/pluginsdk" +) + +type StaticWebAppResource struct{} + +func TestAccAzureStaticWebApp_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("default_host_name").Exists(), + check.That(data.ResourceName).Key("api_key").Exists(), + check.That(data.ResourceName).Key("tags.environment").HasValue("acceptance"), + ), + }, + data.ImportStep(), + }) +} + +func TestAccAzureStaticWebApp_complete(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.complete(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("default_host_name").Exists(), + check.That(data.ResourceName).Key("api_key").Exists(), + ), + }, + data.ImportStep("basic_auth.0.password"), + }) +} + +func TestAccAzureStaticWebApp_completeUpdate(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("default_host_name").Exists(), + check.That(data.ResourceName).Key("api_key").Exists(), + ), + }, + data.ImportStep(), + { + Config: r.complete(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("default_host_name").Exists(), + check.That(data.ResourceName).Key("api_key").Exists(), + ), + }, + data.ImportStep("basic_auth.0.password"), + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("default_host_name").Exists(), + check.That(data.ResourceName).Key("api_key").Exists(), + ), + }, + data.ImportStep(), + }) +} + +func TestAccAzureStaticWebApp_withSystemAssignedIdentity(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.withSystemAssignedIdentity(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("identity.#").HasValue("1"), + check.That(data.ResourceName).Key("identity.0.type").HasValue("SystemAssigned"), + check.That(data.ResourceName).Key("identity.0.principal_id").Exists(), + ), + }, + data.ImportStep(), + }) +} + +func TestAccAzureStaticWebApp_identity(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.withSystemAssignedIdentity(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.withSystemAssignedUserAssignedIdentity(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.withUserAssignedIdentity(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestAccAzureStaticWebApp_withSystemAssignedUserAssignedIdentity(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.withSystemAssignedUserAssignedIdentity(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("identity.#").HasValue("1"), + check.That(data.ResourceName).Key("identity.0.type").HasValue("SystemAssigned, UserAssigned"), + check.That(data.ResourceName).Key("identity.0.principal_id").Exists(), + ), + }, + data.ImportStep(), + }) +} + +func TestAccAzureStaticWebApp_withUserAssignedIdentity(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.withUserAssignedIdentity(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("identity.#").HasValue("1"), + check.That(data.ResourceName).Key("identity.0.type").HasValue("UserAssigned"), + ), + }, + data.ImportStep(), + }) +} + +func TestAccAzureStaticWebApp_basicUpdate(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("default_host_name").Exists(), + check.That(data.ResourceName).Key("api_key").Exists(), + check.That(data.ResourceName).Key("tags.environment").HasValue("acceptance"), + ), + }, + data.ImportStep(), + { + Config: r.basicUpdate(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("default_host_name").Exists(), + check.That(data.ResourceName).Key("api_key").Exists(), + check.That(data.ResourceName).Key("tags.environment").HasValue("acceptance"), + check.That(data.ResourceName).Key("tags.updated").HasValue("true"), + ), + }, + }) +} + +func TestAccAzureStaticWebApp_requiresImport(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.RequiresImportErrorStep(r.requiresImport), + }) +} + +func TestAccStaticWebApp_appSettings(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.appSettings(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("app_settings.foo").HasValue("bar"), + ), + }, + data.ImportStep(), + { + Config: r.appSettingsUpdate(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("app_settings.foo").HasValue("bar"), + ), + }, + data.ImportStep(), + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestAccStaticWebApp_basicAuth(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.withBasicAuth(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("basic_auth.0.password"), + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestAccAzureStaticWebApp_basicWithConfigShouldFail(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_static_web_app", "test") + r := StaticWebAppResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.freeWithAuth(data), + ExpectError: regexp.MustCompile("basic_auth cannot be used with the Free tier of Static Web Apps"), + }, + { + Config: r.freeWithIdentity(data), + ExpectError: regexp.MustCompile("identities cannot be used with the Free tier of Static Web Apps"), + }, + }) +} + +func (r StaticWebAppResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { + id, err := staticsites.ParseStaticSiteID(state.ID) + if err != nil { + return nil, err + } + + resp, err := clients.AppService.StaticSitesClient.GetStaticSite(ctx, *id) + if err != nil { + if response.WasNotFound(resp.HttpResponse) { + return pointer.To(false), nil + } + return nil, fmt.Errorf("retrieving %q: %+v", id, err) + } + + return pointer.To(resp.Model != nil), nil +} + +func (r StaticWebAppResource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_static_web_app" "test" { + name = "acctestSS-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + tags = { + environment = "acceptance" + } +} +`, data.RandomInteger, data.Locations.Primary) // TODO - Put back to primary when support ticket is resolved +} + +func (r StaticWebAppResource) withSystemAssignedIdentity(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_static_web_app" "test" { + name = "acctestSS-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" + + identity { + type = "SystemAssigned" + } +} +`, data.RandomInteger, data.Locations.Primary) +} + +func (r StaticWebAppResource) freeWithIdentity(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_static_web_app" "test" { + name = "acctestSS-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Free" + sku_tier = "Free" + + identity { + type = "SystemAssigned" + } +} +`, data.RandomInteger, data.Locations.Primary) +} + +func (r StaticWebAppResource) withSystemAssignedUserAssignedIdentity(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_user_assigned_identity" "test" { + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + + name = "acctest-%[1]d" +} + +resource "azurerm_static_web_app" "test" { + name = "acctestSS-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" + + identity { + type = "SystemAssigned, UserAssigned" + identity_ids = [azurerm_user_assigned_identity.test.id] + } +} +`, data.RandomInteger, data.Locations.Primary) // TODO - Put back to primary when support ticket is resolved +} + +func (r StaticWebAppResource) withUserAssignedIdentity(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_user_assigned_identity" "test" { + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + + name = "acctest-%[1]d" +} + +resource "azurerm_static_web_app" "test" { + name = "acctestSS-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" + + identity { + type = "UserAssigned" + identity_ids = [azurerm_user_assigned_identity.test.id] + } +} +`, data.RandomInteger, data.Locations.Primary) // TODO - Put back to primary when support ticket is resolved +} + +func (r StaticWebAppResource) basicUpdate(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_static_web_app" "test" { + name = "acctestSS-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" + + tags = { + environment = "acceptance" + updated = "true" + } +} +`, data.RandomInteger, data.Locations.Primary) // TODO - Put back to primary when support ticket is resolved +} + +func (r StaticWebAppResource) requiresImport(data acceptance.TestData) string { + template := r.basic(data) + return fmt.Sprintf(` +%s + +resource "azurerm_static_web_app" "import" { + name = azurerm_static_web_app.test.name + location = azurerm_static_web_app.test.location + resource_group_name = azurerm_static_web_app.test.resource_group_name + sku_size = azurerm_static_web_app.test.sku_size + sku_tier = azurerm_static_web_app.test.sku_tier +} +`, template) +} + +func (r StaticWebAppResource) appSettings(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_static_web_app" "test" { + name = "acctestSS-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" + + app_settings = { + "foo" = "bar" + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) +} + +func (r StaticWebAppResource) appSettingsUpdate(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_static_web_app" "test" { + name = "acctestSS-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + app_settings = { + "foo" = "bar" + "baz" = "foo" + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) +} + +func (r StaticWebAppResource) withBasicAuth(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_static_web_app" "test" { + name = "acctestSS-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" + + basic_auth { + password = "Super$3cretPassW0rd" + environments = "AllEnvironments" + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) +} + +func (r StaticWebAppResource) freeWithAuth(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_static_web_app" "test" { + name = "acctestSS-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Free" + sku_tier = "Free" + + basic_auth { + password = "Super$3cretPassW0rd" + environments = "AllEnvironments" + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) +} + +func (r StaticWebAppResource) complete(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_user_assigned_identity" "test" { + name = "acctest-%[1]d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location +} + +resource "azurerm_static_web_app" "test" { + name = "acctestSS-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku_size = "Standard" + sku_tier = "Standard" + + configuration_file_changes_enabled = false + preview_environments_enabled = false + + identity { + type = "SystemAssigned, UserAssigned" + identity_ids = [azurerm_user_assigned_identity.test.id] + } + + app_settings = { + "foo" = "bar" + } + + basic_auth { + password = "Super$3cretPassW0rd" + environments = "AllEnvironments" + } + + tags = { + environment = "acceptance" + } +} +`, data.RandomInteger, data.Locations.Primary) +} diff --git a/internal/services/appservice/validate/static_web_app.go b/internal/services/appservice/validate/static_web_app.go new file mode 100644 index 000000000000..9b1b831f8ef0 --- /dev/null +++ b/internal/services/appservice/validate/static_web_app.go @@ -0,0 +1,56 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package validate + +import ( + "fmt" + "regexp" +) + +func StaticWebAppName(v interface{}, k string) (warnings []string, errors []error) { + value, ok := v.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %s to be a string", k)) + } + + if matched := regexp.MustCompile(`^[0-9a-zA-Z-]{1,60}$`).Match([]byte(value)); !matched { + errors = append(errors, fmt.Errorf("%q may only contain alphanumeric characters and dashes and up to 60 characters in length", k)) + } + + return warnings, errors +} + +func StaticWebAppPassword(v interface{}, k string) (warnings []string, errors []error) { + value, ok := v.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %s to be a string", k)) + return + } + + if len(value) < 8 { + errors = append(errors, fmt.Errorf("the password should be at least eight characters long.")) + } + + if matched := regexp.MustCompile(`[!@#$%^&*(),.?":{}|<>]`).Match([]byte(value)); !matched { + errors = append(errors, fmt.Errorf("the password must contain at least one symbol")) + } + + if matched := regexp.MustCompile(`[a-z]`).Match([]byte(value)); !matched { + errors = append(errors, fmt.Errorf("the password must contain at least one lower case letter")) + } + + if matched := regexp.MustCompile(`[A-Z]`).Match([]byte(value)); !matched { + errors = append(errors, fmt.Errorf("the password must contain at least one upper case letter")) + } + + if matched := regexp.MustCompile(`[0-9]`).Match([]byte(value)); !matched { + errors = append(errors, fmt.Errorf("the password must contain at least one number")) + } + + if matched := regexp.MustCompile(`[!@#$%^&*(),.?":{}|<>]`).Match([]byte(value)); !matched { + errors = append(errors, fmt.Errorf("the password must contain at least one symbol")) + } + + return +} diff --git a/internal/services/appservice/validate/static_web_app_test.go b/internal/services/appservice/validate/static_web_app_test.go new file mode 100644 index 000000000000..937bad8033ef --- /dev/null +++ b/internal/services/appservice/validate/static_web_app_test.go @@ -0,0 +1,46 @@ +package validate + +import "testing" + +func TestStaticWebAppPassword(t *testing.T) { + cases := []struct { + Input string + Valid bool + }{ + { + Input: "", + }, + { + Input: "short", + }, + { + Input: "nocapitallettersornumbers", + }, + { + Input: "NOLOWERCASELETTERSNUMBERSORSYMBOLS", + }, + { + Input: "CapitalLettersButNoNumbersOrSymbols", + }, + { + Input: "CapitalLettersWith0123ButNoSymbols", + }, + { + Input: "SECUREPASSWORD&1", + }, + { + Input: "SecUrePa$$Word1", + Valid: true, + }, + } + + for _, tc := range cases { + t.Logf("[DEBUG] Testing Value %s", tc.Input) + _, errors := StaticWebAppPassword(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/web/static_site_custom_domain_resource.go b/internal/services/web/static_site_custom_domain_resource.go index 289349d3ef91..0fa9ec211618 100644 --- a/internal/services/web/static_site_custom_domain_resource.go +++ b/internal/services/web/static_site_custom_domain_resource.go @@ -27,9 +27,10 @@ const ( func resourceStaticSiteCustomDomain() *pluginsdk.Resource { return &pluginsdk.Resource{ - Create: resourceStaticSiteCustomDomainCreate, - Read: resourceStaticSiteCustomDomainRead, - Delete: resourceStaticSiteCustomDomainDelete, + DeprecationMessage: "This resource has been deprecated in favour of `azurerm_static_web_app_custom_domain` and will be removed in a future release.", + Create: resourceStaticSiteCustomDomainCreate, + Read: resourceStaticSiteCustomDomainRead, + Delete: resourceStaticSiteCustomDomainDelete, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { _, err := parse.StaticSiteCustomDomainID(id) return err diff --git a/internal/services/web/static_site_resource.go b/internal/services/web/static_site_resource.go index 752fe3195337..16ebba0a08e5 100644 --- a/internal/services/web/static_site_resource.go +++ b/internal/services/web/static_site_resource.go @@ -26,10 +26,11 @@ import ( func resourceStaticSite() *pluginsdk.Resource { return &pluginsdk.Resource{ - Create: resourceStaticSiteCreateOrUpdate, - Read: resourceStaticSiteRead, - Update: resourceStaticSiteCreateOrUpdate, - Delete: resourceStaticSiteDelete, + DeprecationMessage: "This resource has been deprecated in favour of `azurerm_static_web_app` and will be removed in a future release.", + Create: resourceStaticSiteCreateOrUpdate, + Read: resourceStaticSiteRead, + Update: resourceStaticSiteCreateOrUpdate, + Delete: resourceStaticSiteDelete, Importer: pluginsdk.ImporterValidatingResourceId(func(id string) error { _, err := parse.StaticSiteID(id) return err diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/README.md new file mode 100644 index 000000000000..5b573d21e919 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/README.md @@ -0,0 +1,1300 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites` Documentation + +The `staticsites` SDK allows for interaction with the Azure Resource Manager Service `web` (API Version `2023-01-01`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" +import "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites" +``` + + +### Client Initialization + +```go +client := staticsites.NewStaticSitesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `StaticSitesClient.ApproveOrRejectPrivateEndpointConnection` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "privateEndpointConnectionValue") + +payload := staticsites.RemotePrivateEndpointConnectionARMResource{ + // ... +} + + +if err := client.ApproveOrRejectPrivateEndpointConnectionThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.CreateOrUpdateBasicAuth` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +payload := staticsites.StaticSiteBasicAuthPropertiesARMResource{ + // ... +} + + +read, err := client.CreateOrUpdateBasicAuth(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.CreateOrUpdateBuildDatabaseConnection` + +```go +ctx := context.TODO() +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "databaseConnectionValue") + +payload := staticsites.DatabaseConnection{ + // ... +} + + +read, err := client.CreateOrUpdateBuildDatabaseConnection(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.CreateOrUpdateDatabaseConnection` + +```go +ctx := context.TODO() +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "databaseConnectionValue") + +payload := staticsites.DatabaseConnection{ + // ... +} + + +read, err := client.CreateOrUpdateDatabaseConnection(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.CreateOrUpdateStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +payload := staticsites.StaticSiteARMResource{ + // ... +} + + +if err := client.CreateOrUpdateStaticSiteThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.CreateOrUpdateStaticSiteAppSettings` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +payload := staticsites.StringDictionary{ + // ... +} + + +read, err := client.CreateOrUpdateStaticSiteAppSettings(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.CreateOrUpdateStaticSiteBuildAppSettings` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +payload := staticsites.StringDictionary{ + // ... +} + + +read, err := client.CreateOrUpdateStaticSiteBuildAppSettings(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.CreateOrUpdateStaticSiteBuildFunctionAppSettings` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +payload := staticsites.StringDictionary{ + // ... +} + + +read, err := client.CreateOrUpdateStaticSiteBuildFunctionAppSettings(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.CreateOrUpdateStaticSiteCustomDomain` + +```go +ctx := context.TODO() +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "customDomainValue") + +payload := staticsites.StaticSiteCustomDomainRequestPropertiesARMResource{ + // ... +} + + +if err := client.CreateOrUpdateStaticSiteCustomDomainThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.CreateOrUpdateStaticSiteFunctionAppSettings` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +payload := staticsites.StringDictionary{ + // ... +} + + +read, err := client.CreateOrUpdateStaticSiteFunctionAppSettings(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.CreateUserRolesInvitationLink` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +payload := staticsites.StaticSiteUserInvitationRequestResource{ + // ... +} + + +read, err := client.CreateUserRolesInvitationLink(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.CreateZipDeploymentForStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +payload := staticsites.StaticSiteZipDeploymentARMResource{ + // ... +} + + +if err := client.CreateZipDeploymentForStaticSiteThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.CreateZipDeploymentForStaticSiteBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +payload := staticsites.StaticSiteZipDeploymentARMResource{ + // ... +} + + +if err := client.CreateZipDeploymentForStaticSiteBuildThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.DeleteBuildDatabaseConnection` + +```go +ctx := context.TODO() +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "databaseConnectionValue") + +read, err := client.DeleteBuildDatabaseConnection(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.DeleteDatabaseConnection` + +```go +ctx := context.TODO() +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "databaseConnectionValue") + +read, err := client.DeleteDatabaseConnection(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.DeletePrivateEndpointConnection` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "privateEndpointConnectionValue") + +if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.DeleteStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +if err := client.DeleteStaticSiteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.DeleteStaticSiteBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +if err := client.DeleteStaticSiteBuildThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.DeleteStaticSiteCustomDomain` + +```go +ctx := context.TODO() +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "customDomainValue") + +if err := client.DeleteStaticSiteCustomDomainThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.DeleteStaticSiteUser` + +```go +ctx := context.TODO() +id := staticsites.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "authProviderValue", "userValue") + +read, err := client.DeleteStaticSiteUser(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.DetachStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +if err := client.DetachStaticSiteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.DetachUserProvidedFunctionAppFromStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "userProvidedFunctionAppValue") + +read, err := client.DetachUserProvidedFunctionAppFromStaticSite(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.DetachUserProvidedFunctionAppFromStaticSiteBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "userProvidedFunctionAppValue") + +read, err := client.DetachUserProvidedFunctionAppFromStaticSiteBuild(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetBasicAuth` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +read, err := client.GetBasicAuth(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetBuildDatabaseConnection` + +```go +ctx := context.TODO() +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "databaseConnectionValue") + +read, err := client.GetBuildDatabaseConnection(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetBuildDatabaseConnectionWithDetails` + +```go +ctx := context.TODO() +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "databaseConnectionValue") + +read, err := client.GetBuildDatabaseConnectionWithDetails(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetBuildDatabaseConnections` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +// alternatively `client.GetBuildDatabaseConnections(ctx, id)` can be used to do batched pagination +items, err := client.GetBuildDatabaseConnectionsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetBuildDatabaseConnectionsWithDetails` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +// alternatively `client.GetBuildDatabaseConnectionsWithDetails(ctx, id)` can be used to do batched pagination +items, err := client.GetBuildDatabaseConnectionsWithDetailsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetDatabaseConnection` + +```go +ctx := context.TODO() +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "databaseConnectionValue") + +read, err := client.GetDatabaseConnection(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetDatabaseConnectionWithDetails` + +```go +ctx := context.TODO() +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "databaseConnectionValue") + +read, err := client.GetDatabaseConnectionWithDetails(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetDatabaseConnections` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +// alternatively `client.GetDatabaseConnections(ctx, id)` can be used to do batched pagination +items, err := client.GetDatabaseConnectionsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetDatabaseConnectionsWithDetails` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +// alternatively `client.GetDatabaseConnectionsWithDetails(ctx, id)` can be used to do batched pagination +items, err := client.GetDatabaseConnectionsWithDetailsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetLinkedBackend` + +```go +ctx := context.TODO() +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "linkedBackendValue") + +read, err := client.GetLinkedBackend(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetLinkedBackendForBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "linkedBackendValue") + +read, err := client.GetLinkedBackendForBuild(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetLinkedBackends` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +// alternatively `client.GetLinkedBackends(ctx, id)` can be used to do batched pagination +items, err := client.GetLinkedBackendsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetLinkedBackendsForBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +// alternatively `client.GetLinkedBackendsForBuild(ctx, id)` can be used to do batched pagination +items, err := client.GetLinkedBackendsForBuildComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetPrivateEndpointConnection` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSitePrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "privateEndpointConnectionValue") + +read, err := client.GetPrivateEndpointConnection(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetPrivateEndpointConnectionList` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +// alternatively `client.GetPrivateEndpointConnectionList(ctx, id)` can be used to do batched pagination +items, err := client.GetPrivateEndpointConnectionListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetPrivateLinkResources` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +read, err := client.GetPrivateLinkResources(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +read, err := client.GetStaticSite(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetStaticSiteBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +read, err := client.GetStaticSiteBuild(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetStaticSiteBuilds` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +// alternatively `client.GetStaticSiteBuilds(ctx, id)` can be used to do batched pagination +items, err := client.GetStaticSiteBuildsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetStaticSiteCustomDomain` + +```go +ctx := context.TODO() +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "customDomainValue") + +read, err := client.GetStaticSiteCustomDomain(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetStaticSitesByResourceGroup` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.GetStaticSitesByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.GetStaticSitesByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetUserProvidedFunctionAppForStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "userProvidedFunctionAppValue") + +read, err := client.GetUserProvidedFunctionAppForStaticSite(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetUserProvidedFunctionAppForStaticSiteBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "userProvidedFunctionAppValue") + +read, err := client.GetUserProvidedFunctionAppForStaticSiteBuild(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.GetUserProvidedFunctionAppsForStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +// alternatively `client.GetUserProvidedFunctionAppsForStaticSite(ctx, id)` can be used to do batched pagination +items, err := client.GetUserProvidedFunctionAppsForStaticSiteComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.GetUserProvidedFunctionAppsForStaticSiteBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +// alternatively `client.GetUserProvidedFunctionAppsForStaticSiteBuild(ctx, id)` can be used to do batched pagination +items, err := client.GetUserProvidedFunctionAppsForStaticSiteBuildComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.LinkBackend` + +```go +ctx := context.TODO() +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "linkedBackendValue") + +payload := staticsites.StaticSiteLinkedBackendARMResource{ + // ... +} + + +if err := client.LinkBackendThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.LinkBackendToBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "linkedBackendValue") + +payload := staticsites.StaticSiteLinkedBackendARMResource{ + // ... +} + + +if err := client.LinkBackendToBuildThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.List` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.List(ctx, id)` can be used to do batched pagination +items, err := client.ListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.ListBasicAuth` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +// alternatively `client.ListBasicAuth(ctx, id)` can be used to do batched pagination +items, err := client.ListBasicAuthComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteAppSettings` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +read, err := client.ListStaticSiteAppSettings(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteBuildAppSettings` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +read, err := client.ListStaticSiteBuildAppSettings(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteBuildFunctionAppSettings` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +read, err := client.ListStaticSiteBuildFunctionAppSettings(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteBuildFunctions` + +```go +ctx := context.TODO() +id := staticsites.NewBuildID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue") + +// alternatively `client.ListStaticSiteBuildFunctions(ctx, id)` can be used to do batched pagination +items, err := client.ListStaticSiteBuildFunctionsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteConfiguredRoles` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +read, err := client.ListStaticSiteConfiguredRoles(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteCustomDomains` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +// alternatively `client.ListStaticSiteCustomDomains(ctx, id)` can be used to do batched pagination +items, err := client.ListStaticSiteCustomDomainsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteFunctionAppSettings` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +read, err := client.ListStaticSiteFunctionAppSettings(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteFunctions` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +// alternatively `client.ListStaticSiteFunctions(ctx, id)` can be used to do batched pagination +items, err := client.ListStaticSiteFunctionsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteSecrets` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +read, err := client.ListStaticSiteSecrets(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.ListStaticSiteUsers` + +```go +ctx := context.TODO() +id := staticsites.NewAuthProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "authProviderValue") + +// alternatively `client.ListStaticSiteUsers(ctx, id)` can be used to do batched pagination +items, err := client.ListStaticSiteUsersComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `StaticSitesClient.PreviewWorkflow` + +```go +ctx := context.TODO() +id := staticsites.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +payload := staticsites.StaticSitesWorkflowPreviewRequest{ + // ... +} + + +read, err := client.PreviewWorkflow(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.RegisterUserProvidedFunctionAppWithStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "userProvidedFunctionAppValue") + +payload := staticsites.StaticSiteUserProvidedFunctionAppARMResource{ + // ... +} + + +if err := client.RegisterUserProvidedFunctionAppWithStaticSiteThenPoll(ctx, id, payload, staticsites.DefaultRegisterUserProvidedFunctionAppWithStaticSiteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.RegisterUserProvidedFunctionAppWithStaticSiteBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildUserProvidedFunctionAppID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "userProvidedFunctionAppValue") + +payload := staticsites.StaticSiteUserProvidedFunctionAppARMResource{ + // ... +} + + +if err := client.RegisterUserProvidedFunctionAppWithStaticSiteBuildThenPoll(ctx, id, payload, staticsites.DefaultRegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.ResetStaticSiteApiKey` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +payload := staticsites.StaticSiteResetPropertiesARMResource{ + // ... +} + + +read, err := client.ResetStaticSiteApiKey(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.UnlinkBackend` + +```go +ctx := context.TODO() +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "linkedBackendValue") + +read, err := client.UnlinkBackend(ctx, id, staticsites.DefaultUnlinkBackendOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.UnlinkBackendFromBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "linkedBackendValue") + +read, err := client.UnlinkBackendFromBuild(ctx, id, staticsites.DefaultUnlinkBackendFromBuildOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.UpdateBuildDatabaseConnection` + +```go +ctx := context.TODO() +id := staticsites.NewBuildDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "databaseConnectionValue") + +payload := staticsites.DatabaseConnectionPatchRequest{ + // ... +} + + +read, err := client.UpdateBuildDatabaseConnection(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.UpdateDatabaseConnection` + +```go +ctx := context.TODO() +id := staticsites.NewDatabaseConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "databaseConnectionValue") + +payload := staticsites.DatabaseConnectionPatchRequest{ + // ... +} + + +read, err := client.UpdateDatabaseConnection(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.UpdateStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewStaticSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue") + +payload := staticsites.StaticSitePatchResource{ + // ... +} + + +read, err := client.UpdateStaticSite(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.UpdateStaticSiteUser` + +```go +ctx := context.TODO() +id := staticsites.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "authProviderValue", "userValue") + +payload := staticsites.StaticSiteUserARMResource{ + // ... +} + + +read, err := client.UpdateStaticSiteUser(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `StaticSitesClient.ValidateBackend` + +```go +ctx := context.TODO() +id := staticsites.NewLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "linkedBackendValue") + +payload := staticsites.StaticSiteLinkedBackendARMResource{ + // ... +} + + +if err := client.ValidateBackendThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.ValidateBackendForBuild` + +```go +ctx := context.TODO() +id := staticsites.NewBuildLinkedBackendID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "buildValue", "linkedBackendValue") + +payload := staticsites.StaticSiteLinkedBackendARMResource{ + // ... +} + + +if err := client.ValidateBackendForBuildThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `StaticSitesClient.ValidateCustomDomainCanBeAddedToStaticSite` + +```go +ctx := context.TODO() +id := staticsites.NewCustomDomainID("12345678-1234-9876-4563-123456789012", "example-resource-group", "staticSiteValue", "customDomainValue") + +payload := staticsites.StaticSiteCustomDomainRequestPropertiesARMResource{ + // ... +} + + +if err := client.ValidateCustomDomainCanBeAddedToStaticSiteThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/client.go new file mode 100644 index 000000000000..d725455a2d77 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/client.go @@ -0,0 +1,26 @@ +package staticsites + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSitesClient struct { + Client *resourcemanager.Client +} + +func NewStaticSitesClientWithBaseURI(sdkApi sdkEnv.Api) (*StaticSitesClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "staticsites", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating StaticSitesClient: %+v", err) + } + + return &StaticSitesClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/constants.go new file mode 100644 index 000000000000..dfdde9730155 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/constants.go @@ -0,0 +1,251 @@ +package staticsites + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BuildStatus string + +const ( + BuildStatusDeleting BuildStatus = "Deleting" + BuildStatusDeploying BuildStatus = "Deploying" + BuildStatusDetached BuildStatus = "Detached" + BuildStatusFailed BuildStatus = "Failed" + BuildStatusReady BuildStatus = "Ready" + BuildStatusUploading BuildStatus = "Uploading" + BuildStatusWaitingForDeployment BuildStatus = "WaitingForDeployment" +) + +func PossibleValuesForBuildStatus() []string { + return []string{ + string(BuildStatusDeleting), + string(BuildStatusDeploying), + string(BuildStatusDetached), + string(BuildStatusFailed), + string(BuildStatusReady), + string(BuildStatusUploading), + string(BuildStatusWaitingForDeployment), + } +} + +func (s *BuildStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBuildStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBuildStatus(input string) (*BuildStatus, error) { + vals := map[string]BuildStatus{ + "deleting": BuildStatusDeleting, + "deploying": BuildStatusDeploying, + "detached": BuildStatusDetached, + "failed": BuildStatusFailed, + "ready": BuildStatusReady, + "uploading": BuildStatusUploading, + "waitingfordeployment": BuildStatusWaitingForDeployment, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BuildStatus(input) + return &out, nil +} + +type CustomDomainStatus string + +const ( + CustomDomainStatusAdding CustomDomainStatus = "Adding" + CustomDomainStatusDeleting CustomDomainStatus = "Deleting" + CustomDomainStatusFailed CustomDomainStatus = "Failed" + CustomDomainStatusReady CustomDomainStatus = "Ready" + CustomDomainStatusRetrievingValidationToken CustomDomainStatus = "RetrievingValidationToken" + CustomDomainStatusUnhealthy CustomDomainStatus = "Unhealthy" + CustomDomainStatusValidating CustomDomainStatus = "Validating" +) + +func PossibleValuesForCustomDomainStatus() []string { + return []string{ + string(CustomDomainStatusAdding), + string(CustomDomainStatusDeleting), + string(CustomDomainStatusFailed), + string(CustomDomainStatusReady), + string(CustomDomainStatusRetrievingValidationToken), + string(CustomDomainStatusUnhealthy), + string(CustomDomainStatusValidating), + } +} + +func (s *CustomDomainStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCustomDomainStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCustomDomainStatus(input string) (*CustomDomainStatus, error) { + vals := map[string]CustomDomainStatus{ + "adding": CustomDomainStatusAdding, + "deleting": CustomDomainStatusDeleting, + "failed": CustomDomainStatusFailed, + "ready": CustomDomainStatusReady, + "retrievingvalidationtoken": CustomDomainStatusRetrievingValidationToken, + "unhealthy": CustomDomainStatusUnhealthy, + "validating": CustomDomainStatusValidating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CustomDomainStatus(input) + return &out, nil +} + +type EnterpriseGradeCdnStatus string + +const ( + EnterpriseGradeCdnStatusDisabled EnterpriseGradeCdnStatus = "Disabled" + EnterpriseGradeCdnStatusDisabling EnterpriseGradeCdnStatus = "Disabling" + EnterpriseGradeCdnStatusEnabled EnterpriseGradeCdnStatus = "Enabled" + EnterpriseGradeCdnStatusEnabling EnterpriseGradeCdnStatus = "Enabling" +) + +func PossibleValuesForEnterpriseGradeCdnStatus() []string { + return []string{ + string(EnterpriseGradeCdnStatusDisabled), + string(EnterpriseGradeCdnStatusDisabling), + string(EnterpriseGradeCdnStatusEnabled), + string(EnterpriseGradeCdnStatusEnabling), + } +} + +func (s *EnterpriseGradeCdnStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEnterpriseGradeCdnStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEnterpriseGradeCdnStatus(input string) (*EnterpriseGradeCdnStatus, error) { + vals := map[string]EnterpriseGradeCdnStatus{ + "disabled": EnterpriseGradeCdnStatusDisabled, + "disabling": EnterpriseGradeCdnStatusDisabling, + "enabled": EnterpriseGradeCdnStatusEnabled, + "enabling": EnterpriseGradeCdnStatusEnabling, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EnterpriseGradeCdnStatus(input) + return &out, nil +} + +type StagingEnvironmentPolicy string + +const ( + StagingEnvironmentPolicyDisabled StagingEnvironmentPolicy = "Disabled" + StagingEnvironmentPolicyEnabled StagingEnvironmentPolicy = "Enabled" +) + +func PossibleValuesForStagingEnvironmentPolicy() []string { + return []string{ + string(StagingEnvironmentPolicyDisabled), + string(StagingEnvironmentPolicyEnabled), + } +} + +func (s *StagingEnvironmentPolicy) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseStagingEnvironmentPolicy(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseStagingEnvironmentPolicy(input string) (*StagingEnvironmentPolicy, error) { + vals := map[string]StagingEnvironmentPolicy{ + "disabled": StagingEnvironmentPolicyDisabled, + "enabled": StagingEnvironmentPolicyEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := StagingEnvironmentPolicy(input) + return &out, nil +} + +type TriggerTypes string + +const ( + TriggerTypesHTTPTrigger TriggerTypes = "HttpTrigger" + TriggerTypesUnknown TriggerTypes = "Unknown" +) + +func PossibleValuesForTriggerTypes() []string { + return []string{ + string(TriggerTypesHTTPTrigger), + string(TriggerTypesUnknown), + } +} + +func (s *TriggerTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTriggerTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTriggerTypes(input string) (*TriggerTypes, error) { + vals := map[string]TriggerTypes{ + "httptrigger": TriggerTypesHTTPTrigger, + "unknown": TriggerTypesUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TriggerTypes(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_authprovider.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_authprovider.go new file mode 100644 index 000000000000..c5f6e54f94ff --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_authprovider.go @@ -0,0 +1,134 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &AuthProviderId{} + +// AuthProviderId is a struct representing the Resource ID for a Auth Provider +type AuthProviderId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + AuthProviderName string +} + +// NewAuthProviderID returns a new AuthProviderId struct +func NewAuthProviderID(subscriptionId string, resourceGroupName string, staticSiteName string, authProviderName string) AuthProviderId { + return AuthProviderId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + AuthProviderName: authProviderName, + } +} + +// ParseAuthProviderID parses 'input' into a AuthProviderId +func ParseAuthProviderID(input string) (*AuthProviderId, error) { + parser := resourceids.NewParserFromResourceIdType(&AuthProviderId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AuthProviderId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseAuthProviderIDInsensitively parses 'input' case-insensitively into a AuthProviderId +// note: this method should only be used for API response data and not user input +func ParseAuthProviderIDInsensitively(input string) (*AuthProviderId, error) { + parser := resourceids.NewParserFromResourceIdType(&AuthProviderId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AuthProviderId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *AuthProviderId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.AuthProviderName, ok = input.Parsed["authProviderName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "authProviderName", input) + } + + return nil +} + +// ValidateAuthProviderID checks that 'input' can be parsed as a Auth Provider ID +func ValidateAuthProviderID(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 := ParseAuthProviderID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Auth Provider ID +func (id AuthProviderId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/authProviders/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.AuthProviderName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Auth Provider ID +func (id AuthProviderId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticAuthProviders", "authProviders", "authProviders"), + resourceids.UserSpecifiedSegment("authProviderName", "authProviderValue"), + } +} + +// String returns a human-readable description of this Auth Provider ID +func (id AuthProviderId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Auth Provider Name: %q", id.AuthProviderName), + } + return fmt.Sprintf("Auth Provider (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_build.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_build.go new file mode 100644 index 000000000000..38ae98cc414d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_build.go @@ -0,0 +1,134 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &BuildId{} + +// BuildId is a struct representing the Resource ID for a Build +type BuildId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + BuildName string +} + +// NewBuildID returns a new BuildId struct +func NewBuildID(subscriptionId string, resourceGroupName string, staticSiteName string, buildName string) BuildId { + return BuildId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + BuildName: buildName, + } +} + +// ParseBuildID parses 'input' into a BuildId +func ParseBuildID(input string) (*BuildId, error) { + parser := resourceids.NewParserFromResourceIdType(&BuildId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BuildId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseBuildIDInsensitively parses 'input' case-insensitively into a BuildId +// note: this method should only be used for API response data and not user input +func ParseBuildIDInsensitively(input string) (*BuildId, error) { + parser := resourceids.NewParserFromResourceIdType(&BuildId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BuildId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *BuildId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.BuildName, ok = input.Parsed["buildName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "buildName", input) + } + + return nil +} + +// ValidateBuildID checks that 'input' can be parsed as a Build ID +func ValidateBuildID(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 := ParseBuildID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Build ID +func (id BuildId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/builds/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.BuildName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Build ID +func (id BuildId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticBuilds", "builds", "builds"), + resourceids.UserSpecifiedSegment("buildName", "buildValue"), + } +} + +// String returns a human-readable description of this Build ID +func (id BuildId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Build Name: %q", id.BuildName), + } + return fmt.Sprintf("Build (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_builddatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_builddatabaseconnection.go new file mode 100644 index 000000000000..2aaa0fda2292 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_builddatabaseconnection.go @@ -0,0 +1,143 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &BuildDatabaseConnectionId{} + +// BuildDatabaseConnectionId is a struct representing the Resource ID for a Build Database Connection +type BuildDatabaseConnectionId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + BuildName string + DatabaseConnectionName string +} + +// NewBuildDatabaseConnectionID returns a new BuildDatabaseConnectionId struct +func NewBuildDatabaseConnectionID(subscriptionId string, resourceGroupName string, staticSiteName string, buildName string, databaseConnectionName string) BuildDatabaseConnectionId { + return BuildDatabaseConnectionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + BuildName: buildName, + DatabaseConnectionName: databaseConnectionName, + } +} + +// ParseBuildDatabaseConnectionID parses 'input' into a BuildDatabaseConnectionId +func ParseBuildDatabaseConnectionID(input string) (*BuildDatabaseConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(&BuildDatabaseConnectionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BuildDatabaseConnectionId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseBuildDatabaseConnectionIDInsensitively parses 'input' case-insensitively into a BuildDatabaseConnectionId +// note: this method should only be used for API response data and not user input +func ParseBuildDatabaseConnectionIDInsensitively(input string) (*BuildDatabaseConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(&BuildDatabaseConnectionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BuildDatabaseConnectionId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *BuildDatabaseConnectionId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.BuildName, ok = input.Parsed["buildName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "buildName", input) + } + + if id.DatabaseConnectionName, ok = input.Parsed["databaseConnectionName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "databaseConnectionName", input) + } + + return nil +} + +// ValidateBuildDatabaseConnectionID checks that 'input' can be parsed as a Build Database Connection ID +func ValidateBuildDatabaseConnectionID(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 := ParseBuildDatabaseConnectionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Build Database Connection ID +func (id BuildDatabaseConnectionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/builds/%s/databaseConnections/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.BuildName, id.DatabaseConnectionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Build Database Connection ID +func (id BuildDatabaseConnectionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticBuilds", "builds", "builds"), + resourceids.UserSpecifiedSegment("buildName", "buildValue"), + resourceids.StaticSegment("staticDatabaseConnections", "databaseConnections", "databaseConnections"), + resourceids.UserSpecifiedSegment("databaseConnectionName", "databaseConnectionValue"), + } +} + +// String returns a human-readable description of this Build Database Connection ID +func (id BuildDatabaseConnectionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Build Name: %q", id.BuildName), + fmt.Sprintf("Database Connection Name: %q", id.DatabaseConnectionName), + } + return fmt.Sprintf("Build Database Connection (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_buildlinkedbackend.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_buildlinkedbackend.go new file mode 100644 index 000000000000..ff9e6a809f87 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_buildlinkedbackend.go @@ -0,0 +1,143 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &BuildLinkedBackendId{} + +// BuildLinkedBackendId is a struct representing the Resource ID for a Build Linked Backend +type BuildLinkedBackendId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + BuildName string + LinkedBackendName string +} + +// NewBuildLinkedBackendID returns a new BuildLinkedBackendId struct +func NewBuildLinkedBackendID(subscriptionId string, resourceGroupName string, staticSiteName string, buildName string, linkedBackendName string) BuildLinkedBackendId { + return BuildLinkedBackendId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + BuildName: buildName, + LinkedBackendName: linkedBackendName, + } +} + +// ParseBuildLinkedBackendID parses 'input' into a BuildLinkedBackendId +func ParseBuildLinkedBackendID(input string) (*BuildLinkedBackendId, error) { + parser := resourceids.NewParserFromResourceIdType(&BuildLinkedBackendId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BuildLinkedBackendId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseBuildLinkedBackendIDInsensitively parses 'input' case-insensitively into a BuildLinkedBackendId +// note: this method should only be used for API response data and not user input +func ParseBuildLinkedBackendIDInsensitively(input string) (*BuildLinkedBackendId, error) { + parser := resourceids.NewParserFromResourceIdType(&BuildLinkedBackendId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BuildLinkedBackendId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *BuildLinkedBackendId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.BuildName, ok = input.Parsed["buildName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "buildName", input) + } + + if id.LinkedBackendName, ok = input.Parsed["linkedBackendName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "linkedBackendName", input) + } + + return nil +} + +// ValidateBuildLinkedBackendID checks that 'input' can be parsed as a Build Linked Backend ID +func ValidateBuildLinkedBackendID(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 := ParseBuildLinkedBackendID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Build Linked Backend ID +func (id BuildLinkedBackendId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/builds/%s/linkedBackends/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.BuildName, id.LinkedBackendName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Build Linked Backend ID +func (id BuildLinkedBackendId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticBuilds", "builds", "builds"), + resourceids.UserSpecifiedSegment("buildName", "buildValue"), + resourceids.StaticSegment("staticLinkedBackends", "linkedBackends", "linkedBackends"), + resourceids.UserSpecifiedSegment("linkedBackendName", "linkedBackendValue"), + } +} + +// String returns a human-readable description of this Build Linked Backend ID +func (id BuildLinkedBackendId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Build Name: %q", id.BuildName), + fmt.Sprintf("Linked Backend Name: %q", id.LinkedBackendName), + } + return fmt.Sprintf("Build Linked Backend (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_builduserprovidedfunctionapp.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_builduserprovidedfunctionapp.go new file mode 100644 index 000000000000..e2479f779dfc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_builduserprovidedfunctionapp.go @@ -0,0 +1,143 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &BuildUserProvidedFunctionAppId{} + +// BuildUserProvidedFunctionAppId is a struct representing the Resource ID for a Build User Provided Function App +type BuildUserProvidedFunctionAppId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + BuildName string + UserProvidedFunctionAppName string +} + +// NewBuildUserProvidedFunctionAppID returns a new BuildUserProvidedFunctionAppId struct +func NewBuildUserProvidedFunctionAppID(subscriptionId string, resourceGroupName string, staticSiteName string, buildName string, userProvidedFunctionAppName string) BuildUserProvidedFunctionAppId { + return BuildUserProvidedFunctionAppId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + BuildName: buildName, + UserProvidedFunctionAppName: userProvidedFunctionAppName, + } +} + +// ParseBuildUserProvidedFunctionAppID parses 'input' into a BuildUserProvidedFunctionAppId +func ParseBuildUserProvidedFunctionAppID(input string) (*BuildUserProvidedFunctionAppId, error) { + parser := resourceids.NewParserFromResourceIdType(&BuildUserProvidedFunctionAppId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BuildUserProvidedFunctionAppId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseBuildUserProvidedFunctionAppIDInsensitively parses 'input' case-insensitively into a BuildUserProvidedFunctionAppId +// note: this method should only be used for API response data and not user input +func ParseBuildUserProvidedFunctionAppIDInsensitively(input string) (*BuildUserProvidedFunctionAppId, error) { + parser := resourceids.NewParserFromResourceIdType(&BuildUserProvidedFunctionAppId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BuildUserProvidedFunctionAppId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *BuildUserProvidedFunctionAppId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.BuildName, ok = input.Parsed["buildName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "buildName", input) + } + + if id.UserProvidedFunctionAppName, ok = input.Parsed["userProvidedFunctionAppName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "userProvidedFunctionAppName", input) + } + + return nil +} + +// ValidateBuildUserProvidedFunctionAppID checks that 'input' can be parsed as a Build User Provided Function App ID +func ValidateBuildUserProvidedFunctionAppID(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 := ParseBuildUserProvidedFunctionAppID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Build User Provided Function App ID +func (id BuildUserProvidedFunctionAppId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/builds/%s/userProvidedFunctionApps/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.BuildName, id.UserProvidedFunctionAppName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Build User Provided Function App ID +func (id BuildUserProvidedFunctionAppId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticBuilds", "builds", "builds"), + resourceids.UserSpecifiedSegment("buildName", "buildValue"), + resourceids.StaticSegment("staticUserProvidedFunctionApps", "userProvidedFunctionApps", "userProvidedFunctionApps"), + resourceids.UserSpecifiedSegment("userProvidedFunctionAppName", "userProvidedFunctionAppValue"), + } +} + +// String returns a human-readable description of this Build User Provided Function App ID +func (id BuildUserProvidedFunctionAppId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Build Name: %q", id.BuildName), + fmt.Sprintf("User Provided Function App Name: %q", id.UserProvidedFunctionAppName), + } + return fmt.Sprintf("Build User Provided Function App (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_customdomain.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_customdomain.go new file mode 100644 index 000000000000..991e4b4c4b6d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_customdomain.go @@ -0,0 +1,134 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &CustomDomainId{} + +// CustomDomainId is a struct representing the Resource ID for a Custom Domain +type CustomDomainId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + CustomDomainName string +} + +// NewCustomDomainID returns a new CustomDomainId struct +func NewCustomDomainID(subscriptionId string, resourceGroupName string, staticSiteName string, customDomainName string) CustomDomainId { + return CustomDomainId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + CustomDomainName: customDomainName, + } +} + +// ParseCustomDomainID parses 'input' into a CustomDomainId +func ParseCustomDomainID(input string) (*CustomDomainId, error) { + parser := resourceids.NewParserFromResourceIdType(&CustomDomainId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CustomDomainId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseCustomDomainIDInsensitively parses 'input' case-insensitively into a CustomDomainId +// note: this method should only be used for API response data and not user input +func ParseCustomDomainIDInsensitively(input string) (*CustomDomainId, error) { + parser := resourceids.NewParserFromResourceIdType(&CustomDomainId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CustomDomainId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *CustomDomainId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.CustomDomainName, ok = input.Parsed["customDomainName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "customDomainName", input) + } + + return nil +} + +// ValidateCustomDomainID checks that 'input' can be parsed as a Custom Domain ID +func ValidateCustomDomainID(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 := ParseCustomDomainID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Custom Domain ID +func (id CustomDomainId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/customDomains/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.CustomDomainName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Custom Domain ID +func (id CustomDomainId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticCustomDomains", "customDomains", "customDomains"), + resourceids.UserSpecifiedSegment("customDomainName", "customDomainValue"), + } +} + +// String returns a human-readable description of this Custom Domain ID +func (id CustomDomainId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Custom Domain Name: %q", id.CustomDomainName), + } + return fmt.Sprintf("Custom Domain (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_databaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_databaseconnection.go new file mode 100644 index 000000000000..a78341eccda0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_databaseconnection.go @@ -0,0 +1,134 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &DatabaseConnectionId{} + +// DatabaseConnectionId is a struct representing the Resource ID for a Database Connection +type DatabaseConnectionId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + DatabaseConnectionName string +} + +// NewDatabaseConnectionID returns a new DatabaseConnectionId struct +func NewDatabaseConnectionID(subscriptionId string, resourceGroupName string, staticSiteName string, databaseConnectionName string) DatabaseConnectionId { + return DatabaseConnectionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + DatabaseConnectionName: databaseConnectionName, + } +} + +// ParseDatabaseConnectionID parses 'input' into a DatabaseConnectionId +func ParseDatabaseConnectionID(input string) (*DatabaseConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(&DatabaseConnectionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DatabaseConnectionId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseDatabaseConnectionIDInsensitively parses 'input' case-insensitively into a DatabaseConnectionId +// note: this method should only be used for API response data and not user input +func ParseDatabaseConnectionIDInsensitively(input string) (*DatabaseConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(&DatabaseConnectionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DatabaseConnectionId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *DatabaseConnectionId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.DatabaseConnectionName, ok = input.Parsed["databaseConnectionName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "databaseConnectionName", input) + } + + return nil +} + +// ValidateDatabaseConnectionID checks that 'input' can be parsed as a Database Connection ID +func ValidateDatabaseConnectionID(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 := ParseDatabaseConnectionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Database Connection ID +func (id DatabaseConnectionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/databaseConnections/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.DatabaseConnectionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Database Connection ID +func (id DatabaseConnectionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticDatabaseConnections", "databaseConnections", "databaseConnections"), + resourceids.UserSpecifiedSegment("databaseConnectionName", "databaseConnectionValue"), + } +} + +// String returns a human-readable description of this Database Connection ID +func (id DatabaseConnectionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Database Connection Name: %q", id.DatabaseConnectionName), + } + return fmt.Sprintf("Database Connection (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_linkedbackend.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_linkedbackend.go new file mode 100644 index 000000000000..9ac8eda7b29d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_linkedbackend.go @@ -0,0 +1,134 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &LinkedBackendId{} + +// LinkedBackendId is a struct representing the Resource ID for a Linked Backend +type LinkedBackendId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + LinkedBackendName string +} + +// NewLinkedBackendID returns a new LinkedBackendId struct +func NewLinkedBackendID(subscriptionId string, resourceGroupName string, staticSiteName string, linkedBackendName string) LinkedBackendId { + return LinkedBackendId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + LinkedBackendName: linkedBackendName, + } +} + +// ParseLinkedBackendID parses 'input' into a LinkedBackendId +func ParseLinkedBackendID(input string) (*LinkedBackendId, error) { + parser := resourceids.NewParserFromResourceIdType(&LinkedBackendId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LinkedBackendId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseLinkedBackendIDInsensitively parses 'input' case-insensitively into a LinkedBackendId +// note: this method should only be used for API response data and not user input +func ParseLinkedBackendIDInsensitively(input string) (*LinkedBackendId, error) { + parser := resourceids.NewParserFromResourceIdType(&LinkedBackendId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LinkedBackendId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *LinkedBackendId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.LinkedBackendName, ok = input.Parsed["linkedBackendName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "linkedBackendName", input) + } + + return nil +} + +// ValidateLinkedBackendID checks that 'input' can be parsed as a Linked Backend ID +func ValidateLinkedBackendID(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 := ParseLinkedBackendID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Linked Backend ID +func (id LinkedBackendId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/linkedBackends/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.LinkedBackendName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Linked Backend ID +func (id LinkedBackendId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticLinkedBackends", "linkedBackends", "linkedBackends"), + resourceids.UserSpecifiedSegment("linkedBackendName", "linkedBackendValue"), + } +} + +// String returns a human-readable description of this Linked Backend ID +func (id LinkedBackendId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Linked Backend Name: %q", id.LinkedBackendName), + } + return fmt.Sprintf("Linked Backend (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_providerlocation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_providerlocation.go new file mode 100644 index 000000000000..417225dc0b2d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_providerlocation.go @@ -0,0 +1,116 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &ProviderLocationId{} + +// ProviderLocationId is a struct representing the Resource ID for a Provider Location +type ProviderLocationId struct { + SubscriptionId string + LocationName string +} + +// NewProviderLocationID returns a new ProviderLocationId struct +func NewProviderLocationID(subscriptionId string, locationName string) ProviderLocationId { + return ProviderLocationId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + } +} + +// ParseProviderLocationID parses 'input' into a ProviderLocationId +func ParseProviderLocationID(input string) (*ProviderLocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := ProviderLocationId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseProviderLocationIDInsensitively parses 'input' case-insensitively into a ProviderLocationId +// note: this method should only be used for API response data and not user input +func ParseProviderLocationIDInsensitively(input string) (*ProviderLocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := ProviderLocationId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *ProviderLocationId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.LocationName, ok = input.Parsed["locationName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) + } + + return nil +} + +// ValidateProviderLocationID checks that 'input' can be parsed as a Provider Location ID +func ValidateProviderLocationID(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 := ParseProviderLocationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Provider Location ID +func (id ProviderLocationId) ID() string { + fmtString := "/subscriptions/%s/providers/Microsoft.Web/locations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Provider Location ID +func (id ProviderLocationId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationValue"), + } +} + +// String returns a human-readable description of this Provider Location ID +func (id ProviderLocationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + } + return fmt.Sprintf("Provider Location (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_staticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_staticsite.go new file mode 100644 index 000000000000..5b9ba4d32bef --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_staticsite.go @@ -0,0 +1,125 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &StaticSiteId{} + +// StaticSiteId is a struct representing the Resource ID for a Static Site +type StaticSiteId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string +} + +// NewStaticSiteID returns a new StaticSiteId struct +func NewStaticSiteID(subscriptionId string, resourceGroupName string, staticSiteName string) StaticSiteId { + return StaticSiteId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + } +} + +// ParseStaticSiteID parses 'input' into a StaticSiteId +func ParseStaticSiteID(input string) (*StaticSiteId, error) { + parser := resourceids.NewParserFromResourceIdType(&StaticSiteId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := StaticSiteId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseStaticSiteIDInsensitively parses 'input' case-insensitively into a StaticSiteId +// note: this method should only be used for API response data and not user input +func ParseStaticSiteIDInsensitively(input string) (*StaticSiteId, error) { + parser := resourceids.NewParserFromResourceIdType(&StaticSiteId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := StaticSiteId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *StaticSiteId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + return nil +} + +// ValidateStaticSiteID checks that 'input' can be parsed as a Static Site ID +func ValidateStaticSiteID(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 := ParseStaticSiteID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Static Site ID +func (id StaticSiteId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Static Site ID +func (id StaticSiteId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + } +} + +// String returns a human-readable description of this Static Site ID +func (id StaticSiteId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + } + return fmt.Sprintf("Static Site (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_staticsiteprivateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_staticsiteprivateendpointconnection.go new file mode 100644 index 000000000000..eec1e309f1ef --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_staticsiteprivateendpointconnection.go @@ -0,0 +1,134 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &StaticSitePrivateEndpointConnectionId{} + +// StaticSitePrivateEndpointConnectionId is a struct representing the Resource ID for a Static Site Private Endpoint Connection +type StaticSitePrivateEndpointConnectionId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + PrivateEndpointConnectionName string +} + +// NewStaticSitePrivateEndpointConnectionID returns a new StaticSitePrivateEndpointConnectionId struct +func NewStaticSitePrivateEndpointConnectionID(subscriptionId string, resourceGroupName string, staticSiteName string, privateEndpointConnectionName string) StaticSitePrivateEndpointConnectionId { + return StaticSitePrivateEndpointConnectionId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + PrivateEndpointConnectionName: privateEndpointConnectionName, + } +} + +// ParseStaticSitePrivateEndpointConnectionID parses 'input' into a StaticSitePrivateEndpointConnectionId +func ParseStaticSitePrivateEndpointConnectionID(input string) (*StaticSitePrivateEndpointConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(&StaticSitePrivateEndpointConnectionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := StaticSitePrivateEndpointConnectionId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseStaticSitePrivateEndpointConnectionIDInsensitively parses 'input' case-insensitively into a StaticSitePrivateEndpointConnectionId +// note: this method should only be used for API response data and not user input +func ParseStaticSitePrivateEndpointConnectionIDInsensitively(input string) (*StaticSitePrivateEndpointConnectionId, error) { + parser := resourceids.NewParserFromResourceIdType(&StaticSitePrivateEndpointConnectionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := StaticSitePrivateEndpointConnectionId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *StaticSitePrivateEndpointConnectionId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.PrivateEndpointConnectionName, ok = input.Parsed["privateEndpointConnectionName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "privateEndpointConnectionName", input) + } + + return nil +} + +// ValidateStaticSitePrivateEndpointConnectionID checks that 'input' can be parsed as a Static Site Private Endpoint Connection ID +func ValidateStaticSitePrivateEndpointConnectionID(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 := ParseStaticSitePrivateEndpointConnectionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Static Site Private Endpoint Connection ID +func (id StaticSitePrivateEndpointConnectionId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/privateEndpointConnections/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.PrivateEndpointConnectionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Static Site Private Endpoint Connection ID +func (id StaticSitePrivateEndpointConnectionId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), + resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionValue"), + } +} + +// String returns a human-readable description of this Static Site Private Endpoint Connection ID +func (id StaticSitePrivateEndpointConnectionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Private Endpoint Connection Name: %q", id.PrivateEndpointConnectionName), + } + return fmt.Sprintf("Static Site Private Endpoint Connection (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_user.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_user.go new file mode 100644 index 000000000000..255d5817128e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_user.go @@ -0,0 +1,143 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &UserId{} + +// UserId is a struct representing the Resource ID for a User +type UserId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + AuthProviderName string + UserName string +} + +// NewUserID returns a new UserId struct +func NewUserID(subscriptionId string, resourceGroupName string, staticSiteName string, authProviderName string, userName string) UserId { + return UserId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + AuthProviderName: authProviderName, + UserName: userName, + } +} + +// ParseUserID parses 'input' into a UserId +func ParseUserID(input string) (*UserId, error) { + parser := resourceids.NewParserFromResourceIdType(&UserId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := UserId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseUserIDInsensitively parses 'input' case-insensitively into a UserId +// note: this method should only be used for API response data and not user input +func ParseUserIDInsensitively(input string) (*UserId, error) { + parser := resourceids.NewParserFromResourceIdType(&UserId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := UserId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *UserId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.AuthProviderName, ok = input.Parsed["authProviderName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "authProviderName", input) + } + + if id.UserName, ok = input.Parsed["userName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "userName", input) + } + + return nil +} + +// ValidateUserID checks that 'input' can be parsed as a User ID +func ValidateUserID(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 := ParseUserID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted User ID +func (id UserId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/authProviders/%s/users/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.AuthProviderName, id.UserName) +} + +// Segments returns a slice of Resource ID Segments which comprise this User ID +func (id UserId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticAuthProviders", "authProviders", "authProviders"), + resourceids.UserSpecifiedSegment("authProviderName", "authProviderValue"), + resourceids.StaticSegment("staticUsers", "users", "users"), + resourceids.UserSpecifiedSegment("userName", "userValue"), + } +} + +// String returns a human-readable description of this User ID +func (id UserId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("Auth Provider Name: %q", id.AuthProviderName), + fmt.Sprintf("User Name: %q", id.UserName), + } + return fmt.Sprintf("User (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_userprovidedfunctionapp.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_userprovidedfunctionapp.go new file mode 100644 index 000000000000..76926f756530 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/id_userprovidedfunctionapp.go @@ -0,0 +1,134 @@ +package staticsites + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &UserProvidedFunctionAppId{} + +// UserProvidedFunctionAppId is a struct representing the Resource ID for a User Provided Function App +type UserProvidedFunctionAppId struct { + SubscriptionId string + ResourceGroupName string + StaticSiteName string + UserProvidedFunctionAppName string +} + +// NewUserProvidedFunctionAppID returns a new UserProvidedFunctionAppId struct +func NewUserProvidedFunctionAppID(subscriptionId string, resourceGroupName string, staticSiteName string, userProvidedFunctionAppName string) UserProvidedFunctionAppId { + return UserProvidedFunctionAppId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + StaticSiteName: staticSiteName, + UserProvidedFunctionAppName: userProvidedFunctionAppName, + } +} + +// ParseUserProvidedFunctionAppID parses 'input' into a UserProvidedFunctionAppId +func ParseUserProvidedFunctionAppID(input string) (*UserProvidedFunctionAppId, error) { + parser := resourceids.NewParserFromResourceIdType(&UserProvidedFunctionAppId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := UserProvidedFunctionAppId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseUserProvidedFunctionAppIDInsensitively parses 'input' case-insensitively into a UserProvidedFunctionAppId +// note: this method should only be used for API response data and not user input +func ParseUserProvidedFunctionAppIDInsensitively(input string) (*UserProvidedFunctionAppId, error) { + parser := resourceids.NewParserFromResourceIdType(&UserProvidedFunctionAppId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := UserProvidedFunctionAppId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *UserProvidedFunctionAppId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.ResourceGroupName, ok = input.Parsed["resourceGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", input) + } + + if id.StaticSiteName, ok = input.Parsed["staticSiteName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "staticSiteName", input) + } + + if id.UserProvidedFunctionAppName, ok = input.Parsed["userProvidedFunctionAppName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "userProvidedFunctionAppName", input) + } + + return nil +} + +// ValidateUserProvidedFunctionAppID checks that 'input' can be parsed as a User Provided Function App ID +func ValidateUserProvidedFunctionAppID(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 := ParseUserProvidedFunctionAppID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted User Provided Function App ID +func (id UserProvidedFunctionAppId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Web/staticSites/%s/userProvidedFunctionApps/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StaticSiteName, id.UserProvidedFunctionAppName) +} + +// Segments returns a slice of Resource ID Segments which comprise this User Provided Function App ID +func (id UserProvidedFunctionAppId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftWeb", "Microsoft.Web", "Microsoft.Web"), + resourceids.StaticSegment("staticStaticSites", "staticSites", "staticSites"), + resourceids.UserSpecifiedSegment("staticSiteName", "staticSiteValue"), + resourceids.StaticSegment("staticUserProvidedFunctionApps", "userProvidedFunctionApps", "userProvidedFunctionApps"), + resourceids.UserSpecifiedSegment("userProvidedFunctionAppName", "userProvidedFunctionAppValue"), + } +} + +// String returns a human-readable description of this User Provided Function App ID +func (id UserProvidedFunctionAppId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Static Site Name: %q", id.StaticSiteName), + fmt.Sprintf("User Provided Function App Name: %q", id.UserProvidedFunctionAppName), + } + return fmt.Sprintf("User Provided Function App (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_approveorrejectprivateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_approveorrejectprivateendpointconnection.go new file mode 100644 index 000000000000..b07e76844115 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_approveorrejectprivateendpointconnection.go @@ -0,0 +1,75 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApproveOrRejectPrivateEndpointConnectionOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *RemotePrivateEndpointConnectionARMResource +} + +// ApproveOrRejectPrivateEndpointConnection ... +func (c StaticSitesClient) ApproveOrRejectPrivateEndpointConnection(ctx context.Context, id StaticSitePrivateEndpointConnectionId, input RemotePrivateEndpointConnectionARMResource) (result ApproveOrRejectPrivateEndpointConnectionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// ApproveOrRejectPrivateEndpointConnectionThenPoll performs ApproveOrRejectPrivateEndpointConnection then polls until it's completed +func (c StaticSitesClient) ApproveOrRejectPrivateEndpointConnectionThenPoll(ctx context.Context, id StaticSitePrivateEndpointConnectionId, input RemotePrivateEndpointConnectionARMResource) error { + result, err := c.ApproveOrRejectPrivateEndpointConnection(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ApproveOrRejectPrivateEndpointConnection: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ApproveOrRejectPrivateEndpointConnection: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebasicauth.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebasicauth.go new file mode 100644 index 000000000000..34051d7923f9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebasicauth.go @@ -0,0 +1,59 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateBasicAuthOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteBasicAuthPropertiesARMResource +} + +// CreateOrUpdateBasicAuth ... +func (c StaticSitesClient) CreateOrUpdateBasicAuth(ctx context.Context, id StaticSiteId, input StaticSiteBasicAuthPropertiesARMResource) (result CreateOrUpdateBasicAuthOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/basicAuth/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StaticSiteBasicAuthPropertiesARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebuilddatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebuilddatabaseconnection.go new file mode 100644 index 000000000000..9fa486417cb6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatebuilddatabaseconnection.go @@ -0,0 +1,58 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateBuildDatabaseConnectionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DatabaseConnection +} + +// CreateOrUpdateBuildDatabaseConnection ... +func (c StaticSitesClient) CreateOrUpdateBuildDatabaseConnection(ctx context.Context, id BuildDatabaseConnectionId, input DatabaseConnection) (result CreateOrUpdateBuildDatabaseConnectionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model DatabaseConnection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatedatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatedatabaseconnection.go new file mode 100644 index 000000000000..718dd346c56a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatedatabaseconnection.go @@ -0,0 +1,58 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateDatabaseConnectionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DatabaseConnection +} + +// CreateOrUpdateDatabaseConnection ... +func (c StaticSitesClient) CreateOrUpdateDatabaseConnection(ctx context.Context, id DatabaseConnectionId, input DatabaseConnection) (result CreateOrUpdateDatabaseConnectionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model DatabaseConnection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsite.go new file mode 100644 index 000000000000..15bec3068239 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsite.go @@ -0,0 +1,75 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateStaticSiteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteARMResource +} + +// CreateOrUpdateStaticSite ... +func (c StaticSitesClient) CreateOrUpdateStaticSite(ctx context.Context, id StaticSiteId, input StaticSiteARMResource) (result CreateOrUpdateStaticSiteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateStaticSiteThenPoll performs CreateOrUpdateStaticSite then polls until it's completed +func (c StaticSitesClient) CreateOrUpdateStaticSiteThenPoll(ctx context.Context, id StaticSiteId, input StaticSiteARMResource) error { + result, err := c.CreateOrUpdateStaticSite(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdateStaticSite: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdateStaticSite: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsiteappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsiteappsettings.go new file mode 100644 index 000000000000..19e3b9c2d9d6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsiteappsettings.go @@ -0,0 +1,59 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateStaticSiteAppSettingsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringDictionary +} + +// CreateOrUpdateStaticSiteAppSettings ... +func (c StaticSitesClient) CreateOrUpdateStaticSiteAppSettings(ctx context.Context, id StaticSiteId, input StringDictionary) (result CreateOrUpdateStaticSiteAppSettingsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/config/appSettings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StringDictionary + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildappsettings.go new file mode 100644 index 000000000000..bcded5df29e4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildappsettings.go @@ -0,0 +1,59 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateStaticSiteBuildAppSettingsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringDictionary +} + +// CreateOrUpdateStaticSiteBuildAppSettings ... +func (c StaticSitesClient) CreateOrUpdateStaticSiteBuildAppSettings(ctx context.Context, id BuildId, input StringDictionary) (result CreateOrUpdateStaticSiteBuildAppSettingsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/config/appSettings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StringDictionary + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildfunctionappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildfunctionappsettings.go new file mode 100644 index 000000000000..4a99a9e6b1da --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitebuildfunctionappsettings.go @@ -0,0 +1,59 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateStaticSiteBuildFunctionAppSettingsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringDictionary +} + +// CreateOrUpdateStaticSiteBuildFunctionAppSettings ... +func (c StaticSitesClient) CreateOrUpdateStaticSiteBuildFunctionAppSettings(ctx context.Context, id BuildId, input StringDictionary) (result CreateOrUpdateStaticSiteBuildFunctionAppSettingsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/config/functionAppSettings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StringDictionary + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitecustomdomain.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitecustomdomain.go new file mode 100644 index 000000000000..77c06560af1f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitecustomdomain.go @@ -0,0 +1,75 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateStaticSiteCustomDomainOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteCustomDomainOverviewARMResource +} + +// CreateOrUpdateStaticSiteCustomDomain ... +func (c StaticSitesClient) CreateOrUpdateStaticSiteCustomDomain(ctx context.Context, id CustomDomainId, input StaticSiteCustomDomainRequestPropertiesARMResource) (result CreateOrUpdateStaticSiteCustomDomainOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateStaticSiteCustomDomainThenPoll performs CreateOrUpdateStaticSiteCustomDomain then polls until it's completed +func (c StaticSitesClient) CreateOrUpdateStaticSiteCustomDomainThenPoll(ctx context.Context, id CustomDomainId, input StaticSiteCustomDomainRequestPropertiesARMResource) error { + result, err := c.CreateOrUpdateStaticSiteCustomDomain(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdateStaticSiteCustomDomain: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdateStaticSiteCustomDomain: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitefunctionappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitefunctionappsettings.go new file mode 100644 index 000000000000..b4181e79c23c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createorupdatestaticsitefunctionappsettings.go @@ -0,0 +1,59 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateStaticSiteFunctionAppSettingsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringDictionary +} + +// CreateOrUpdateStaticSiteFunctionAppSettings ... +func (c StaticSitesClient) CreateOrUpdateStaticSiteFunctionAppSettings(ctx context.Context, id StaticSiteId, input StringDictionary) (result CreateOrUpdateStaticSiteFunctionAppSettingsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/config/functionAppSettings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StringDictionary + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createuserrolesinvitationlink.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createuserrolesinvitationlink.go new file mode 100644 index 000000000000..2c3ce3709a23 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createuserrolesinvitationlink.go @@ -0,0 +1,59 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateUserRolesInvitationLinkOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteUserInvitationResponseResource +} + +// CreateUserRolesInvitationLink ... +func (c StaticSitesClient) CreateUserRolesInvitationLink(ctx context.Context, id StaticSiteId, input StaticSiteUserInvitationRequestResource) (result CreateUserRolesInvitationLinkOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/createUserInvitation", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StaticSiteUserInvitationResponseResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createzipdeploymentforstaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createzipdeploymentforstaticsite.go new file mode 100644 index 000000000000..6dddfe32eadc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createzipdeploymentforstaticsite.go @@ -0,0 +1,74 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateZipDeploymentForStaticSiteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// CreateZipDeploymentForStaticSite ... +func (c StaticSitesClient) CreateZipDeploymentForStaticSite(ctx context.Context, id StaticSiteId, input StaticSiteZipDeploymentARMResource) (result CreateZipDeploymentForStaticSiteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/zipdeploy", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateZipDeploymentForStaticSiteThenPoll performs CreateZipDeploymentForStaticSite then polls until it's completed +func (c StaticSitesClient) CreateZipDeploymentForStaticSiteThenPoll(ctx context.Context, id StaticSiteId, input StaticSiteZipDeploymentARMResource) error { + result, err := c.CreateZipDeploymentForStaticSite(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateZipDeploymentForStaticSite: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateZipDeploymentForStaticSite: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createzipdeploymentforstaticsitebuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createzipdeploymentforstaticsitebuild.go new file mode 100644 index 000000000000..4b1ac38f9e91 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_createzipdeploymentforstaticsitebuild.go @@ -0,0 +1,74 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateZipDeploymentForStaticSiteBuildOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// CreateZipDeploymentForStaticSiteBuild ... +func (c StaticSitesClient) CreateZipDeploymentForStaticSiteBuild(ctx context.Context, id BuildId, input StaticSiteZipDeploymentARMResource) (result CreateZipDeploymentForStaticSiteBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/zipdeploy", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateZipDeploymentForStaticSiteBuildThenPoll performs CreateZipDeploymentForStaticSiteBuild then polls until it's completed +func (c StaticSitesClient) CreateZipDeploymentForStaticSiteBuildThenPoll(ctx context.Context, id BuildId, input StaticSiteZipDeploymentARMResource) error { + result, err := c.CreateZipDeploymentForStaticSiteBuild(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateZipDeploymentForStaticSiteBuild: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateZipDeploymentForStaticSiteBuild: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletebuilddatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletebuilddatabaseconnection.go new file mode 100644 index 000000000000..5a80028d137a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletebuilddatabaseconnection.go @@ -0,0 +1,47 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteBuildDatabaseConnectionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// DeleteBuildDatabaseConnection ... +func (c StaticSitesClient) DeleteBuildDatabaseConnection(ctx context.Context, id BuildDatabaseConnectionId) (result DeleteBuildDatabaseConnectionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletedatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletedatabaseconnection.go new file mode 100644 index 000000000000..7f0d6cc94aa9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletedatabaseconnection.go @@ -0,0 +1,47 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteDatabaseConnectionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// DeleteDatabaseConnection ... +func (c StaticSitesClient) DeleteDatabaseConnection(ctx context.Context, id DatabaseConnectionId) (result DeleteDatabaseConnectionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deleteprivateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deleteprivateendpointconnection.go new file mode 100644 index 000000000000..d632f3899b4b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deleteprivateendpointconnection.go @@ -0,0 +1,72 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeletePrivateEndpointConnectionOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *interface{} +} + +// DeletePrivateEndpointConnection ... +func (c StaticSitesClient) DeletePrivateEndpointConnection(ctx context.Context, id StaticSitePrivateEndpointConnectionId) (result DeletePrivateEndpointConnectionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeletePrivateEndpointConnectionThenPoll performs DeletePrivateEndpointConnection then polls until it's completed +func (c StaticSitesClient) DeletePrivateEndpointConnectionThenPoll(ctx context.Context, id StaticSitePrivateEndpointConnectionId) error { + result, err := c.DeletePrivateEndpointConnection(ctx, id) + if err != nil { + return fmt.Errorf("performing DeletePrivateEndpointConnection: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after DeletePrivateEndpointConnection: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsite.go new file mode 100644 index 000000000000..78d3bd0abf4e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsite.go @@ -0,0 +1,70 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteStaticSiteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// DeleteStaticSite ... +func (c StaticSitesClient) DeleteStaticSite(ctx context.Context, id StaticSiteId) (result DeleteStaticSiteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteStaticSiteThenPoll performs DeleteStaticSite then polls until it's completed +func (c StaticSitesClient) DeleteStaticSiteThenPoll(ctx context.Context, id StaticSiteId) error { + result, err := c.DeleteStaticSite(ctx, id) + if err != nil { + return fmt.Errorf("performing DeleteStaticSite: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after DeleteStaticSite: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsitebuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsitebuild.go new file mode 100644 index 000000000000..a3fdbf849005 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsitebuild.go @@ -0,0 +1,71 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteStaticSiteBuildOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// DeleteStaticSiteBuild ... +func (c StaticSitesClient) DeleteStaticSiteBuild(ctx context.Context, id BuildId) (result DeleteStaticSiteBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteStaticSiteBuildThenPoll performs DeleteStaticSiteBuild then polls until it's completed +func (c StaticSitesClient) DeleteStaticSiteBuildThenPoll(ctx context.Context, id BuildId) error { + result, err := c.DeleteStaticSiteBuild(ctx, id) + if err != nil { + return fmt.Errorf("performing DeleteStaticSiteBuild: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after DeleteStaticSiteBuild: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsitecustomdomain.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsitecustomdomain.go new file mode 100644 index 000000000000..471bf713f5df --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsitecustomdomain.go @@ -0,0 +1,70 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteStaticSiteCustomDomainOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// DeleteStaticSiteCustomDomain ... +func (c StaticSitesClient) DeleteStaticSiteCustomDomain(ctx context.Context, id CustomDomainId) (result DeleteStaticSiteCustomDomainOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteStaticSiteCustomDomainThenPoll performs DeleteStaticSiteCustomDomain then polls until it's completed +func (c StaticSitesClient) DeleteStaticSiteCustomDomainThenPoll(ctx context.Context, id CustomDomainId) error { + result, err := c.DeleteStaticSiteCustomDomain(ctx, id) + if err != nil { + return fmt.Errorf("performing DeleteStaticSiteCustomDomain: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after DeleteStaticSiteCustomDomain: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsiteuser.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsiteuser.go new file mode 100644 index 000000000000..e4799c87ddbe --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_deletestaticsiteuser.go @@ -0,0 +1,46 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteStaticSiteUserOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// DeleteStaticSiteUser ... +func (c StaticSitesClient) DeleteStaticSiteUser(ctx context.Context, id UserId) (result DeleteStaticSiteUserOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachstaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachstaticsite.go new file mode 100644 index 000000000000..00fa4ac9dd0c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachstaticsite.go @@ -0,0 +1,70 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DetachStaticSiteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// DetachStaticSite ... +func (c StaticSitesClient) DetachStaticSite(ctx context.Context, id StaticSiteId) (result DetachStaticSiteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/detach", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DetachStaticSiteThenPoll performs DetachStaticSite then polls until it's completed +func (c StaticSitesClient) DetachStaticSiteThenPoll(ctx context.Context, id StaticSiteId) error { + result, err := c.DetachStaticSite(ctx, id) + if err != nil { + return fmt.Errorf("performing DetachStaticSite: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after DetachStaticSite: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachuserprovidedfunctionappfromstaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachuserprovidedfunctionappfromstaticsite.go new file mode 100644 index 000000000000..b9a68ba826dc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachuserprovidedfunctionappfromstaticsite.go @@ -0,0 +1,47 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DetachUserProvidedFunctionAppFromStaticSiteOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// DetachUserProvidedFunctionAppFromStaticSite ... +func (c StaticSitesClient) DetachUserProvidedFunctionAppFromStaticSite(ctx context.Context, id UserProvidedFunctionAppId) (result DetachUserProvidedFunctionAppFromStaticSiteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachuserprovidedfunctionappfromstaticsitebuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachuserprovidedfunctionappfromstaticsitebuild.go new file mode 100644 index 000000000000..305f4802b1d1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_detachuserprovidedfunctionappfromstaticsitebuild.go @@ -0,0 +1,47 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DetachUserProvidedFunctionAppFromStaticSiteBuildOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// DetachUserProvidedFunctionAppFromStaticSiteBuild ... +func (c StaticSitesClient) DetachUserProvidedFunctionAppFromStaticSiteBuild(ctx context.Context, id BuildUserProvidedFunctionAppId) (result DetachUserProvidedFunctionAppFromStaticSiteBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbasicauth.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbasicauth.go new file mode 100644 index 000000000000..93aca3f09be0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbasicauth.go @@ -0,0 +1,55 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetBasicAuthOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteBasicAuthPropertiesARMResource +} + +// GetBasicAuth ... +func (c StaticSitesClient) GetBasicAuth(ctx context.Context, id StaticSiteId) (result GetBasicAuthOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/basicAuth/default", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StaticSiteBasicAuthPropertiesARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnection.go new file mode 100644 index 000000000000..64d51db24b6f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnection.go @@ -0,0 +1,54 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetBuildDatabaseConnectionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DatabaseConnection +} + +// GetBuildDatabaseConnection ... +func (c StaticSitesClient) GetBuildDatabaseConnection(ctx context.Context, id BuildDatabaseConnectionId) (result GetBuildDatabaseConnectionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model DatabaseConnection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnections.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnections.go new file mode 100644 index 000000000000..044bfd57fbcd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnections.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetBuildDatabaseConnectionsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]DatabaseConnection +} + +type GetBuildDatabaseConnectionsCompleteResult struct { + LatestHttpResponse *http.Response + Items []DatabaseConnection +} + +// GetBuildDatabaseConnections ... +func (c StaticSitesClient) GetBuildDatabaseConnections(ctx context.Context, id BuildId) (result GetBuildDatabaseConnectionsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/databaseConnections", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]DatabaseConnection `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetBuildDatabaseConnectionsComplete retrieves all the results into a single object +func (c StaticSitesClient) GetBuildDatabaseConnectionsComplete(ctx context.Context, id BuildId) (GetBuildDatabaseConnectionsCompleteResult, error) { + return c.GetBuildDatabaseConnectionsCompleteMatchingPredicate(ctx, id, DatabaseConnectionOperationPredicate{}) +} + +// GetBuildDatabaseConnectionsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetBuildDatabaseConnectionsCompleteMatchingPredicate(ctx context.Context, id BuildId, predicate DatabaseConnectionOperationPredicate) (result GetBuildDatabaseConnectionsCompleteResult, err error) { + items := make([]DatabaseConnection, 0) + + resp, err := c.GetBuildDatabaseConnections(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetBuildDatabaseConnectionsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnectionswithdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnectionswithdetails.go new file mode 100644 index 000000000000..a32b0d4ac41f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnectionswithdetails.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetBuildDatabaseConnectionsWithDetailsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]DatabaseConnection +} + +type GetBuildDatabaseConnectionsWithDetailsCompleteResult struct { + LatestHttpResponse *http.Response + Items []DatabaseConnection +} + +// GetBuildDatabaseConnectionsWithDetails ... +func (c StaticSitesClient) GetBuildDatabaseConnectionsWithDetails(ctx context.Context, id BuildId) (result GetBuildDatabaseConnectionsWithDetailsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/showDatabaseConnections", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]DatabaseConnection `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetBuildDatabaseConnectionsWithDetailsComplete retrieves all the results into a single object +func (c StaticSitesClient) GetBuildDatabaseConnectionsWithDetailsComplete(ctx context.Context, id BuildId) (GetBuildDatabaseConnectionsWithDetailsCompleteResult, error) { + return c.GetBuildDatabaseConnectionsWithDetailsCompleteMatchingPredicate(ctx, id, DatabaseConnectionOperationPredicate{}) +} + +// GetBuildDatabaseConnectionsWithDetailsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetBuildDatabaseConnectionsWithDetailsCompleteMatchingPredicate(ctx context.Context, id BuildId, predicate DatabaseConnectionOperationPredicate) (result GetBuildDatabaseConnectionsWithDetailsCompleteResult, err error) { + items := make([]DatabaseConnection, 0) + + resp, err := c.GetBuildDatabaseConnectionsWithDetails(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetBuildDatabaseConnectionsWithDetailsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnectionwithdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnectionwithdetails.go new file mode 100644 index 000000000000..39323af4c15a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getbuilddatabaseconnectionwithdetails.go @@ -0,0 +1,55 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetBuildDatabaseConnectionWithDetailsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DatabaseConnection +} + +// GetBuildDatabaseConnectionWithDetails ... +func (c StaticSitesClient) GetBuildDatabaseConnectionWithDetails(ctx context.Context, id BuildDatabaseConnectionId) (result GetBuildDatabaseConnectionWithDetailsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/show", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model DatabaseConnection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnection.go new file mode 100644 index 000000000000..118dabea2507 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnection.go @@ -0,0 +1,54 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetDatabaseConnectionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DatabaseConnection +} + +// GetDatabaseConnection ... +func (c StaticSitesClient) GetDatabaseConnection(ctx context.Context, id DatabaseConnectionId) (result GetDatabaseConnectionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model DatabaseConnection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnections.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnections.go new file mode 100644 index 000000000000..3f413b9475b8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnections.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetDatabaseConnectionsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]DatabaseConnection +} + +type GetDatabaseConnectionsCompleteResult struct { + LatestHttpResponse *http.Response + Items []DatabaseConnection +} + +// GetDatabaseConnections ... +func (c StaticSitesClient) GetDatabaseConnections(ctx context.Context, id StaticSiteId) (result GetDatabaseConnectionsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/databaseConnections", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]DatabaseConnection `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetDatabaseConnectionsComplete retrieves all the results into a single object +func (c StaticSitesClient) GetDatabaseConnectionsComplete(ctx context.Context, id StaticSiteId) (GetDatabaseConnectionsCompleteResult, error) { + return c.GetDatabaseConnectionsCompleteMatchingPredicate(ctx, id, DatabaseConnectionOperationPredicate{}) +} + +// GetDatabaseConnectionsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetDatabaseConnectionsCompleteMatchingPredicate(ctx context.Context, id StaticSiteId, predicate DatabaseConnectionOperationPredicate) (result GetDatabaseConnectionsCompleteResult, err error) { + items := make([]DatabaseConnection, 0) + + resp, err := c.GetDatabaseConnections(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetDatabaseConnectionsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnectionswithdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnectionswithdetails.go new file mode 100644 index 000000000000..4c1fb498cae0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnectionswithdetails.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetDatabaseConnectionsWithDetailsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]DatabaseConnection +} + +type GetDatabaseConnectionsWithDetailsCompleteResult struct { + LatestHttpResponse *http.Response + Items []DatabaseConnection +} + +// GetDatabaseConnectionsWithDetails ... +func (c StaticSitesClient) GetDatabaseConnectionsWithDetails(ctx context.Context, id StaticSiteId) (result GetDatabaseConnectionsWithDetailsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/showDatabaseConnections", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]DatabaseConnection `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetDatabaseConnectionsWithDetailsComplete retrieves all the results into a single object +func (c StaticSitesClient) GetDatabaseConnectionsWithDetailsComplete(ctx context.Context, id StaticSiteId) (GetDatabaseConnectionsWithDetailsCompleteResult, error) { + return c.GetDatabaseConnectionsWithDetailsCompleteMatchingPredicate(ctx, id, DatabaseConnectionOperationPredicate{}) +} + +// GetDatabaseConnectionsWithDetailsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetDatabaseConnectionsWithDetailsCompleteMatchingPredicate(ctx context.Context, id StaticSiteId, predicate DatabaseConnectionOperationPredicate) (result GetDatabaseConnectionsWithDetailsCompleteResult, err error) { + items := make([]DatabaseConnection, 0) + + resp, err := c.GetDatabaseConnectionsWithDetails(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetDatabaseConnectionsWithDetailsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnectionwithdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnectionwithdetails.go new file mode 100644 index 000000000000..7ff319615bd5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getdatabaseconnectionwithdetails.go @@ -0,0 +1,55 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetDatabaseConnectionWithDetailsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DatabaseConnection +} + +// GetDatabaseConnectionWithDetails ... +func (c StaticSitesClient) GetDatabaseConnectionWithDetails(ctx context.Context, id DatabaseConnectionId) (result GetDatabaseConnectionWithDetailsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/show", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model DatabaseConnection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackend.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackend.go new file mode 100644 index 000000000000..b572c2a28567 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackend.go @@ -0,0 +1,54 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetLinkedBackendOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteLinkedBackendARMResource +} + +// GetLinkedBackend ... +func (c StaticSitesClient) GetLinkedBackend(ctx context.Context, id LinkedBackendId) (result GetLinkedBackendOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StaticSiteLinkedBackendARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackendforbuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackendforbuild.go new file mode 100644 index 000000000000..9bc02ed8de7f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackendforbuild.go @@ -0,0 +1,54 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetLinkedBackendForBuildOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteLinkedBackendARMResource +} + +// GetLinkedBackendForBuild ... +func (c StaticSitesClient) GetLinkedBackendForBuild(ctx context.Context, id BuildLinkedBackendId) (result GetLinkedBackendForBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StaticSiteLinkedBackendARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackends.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackends.go new file mode 100644 index 000000000000..a9117d962ae8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackends.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetLinkedBackendsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteLinkedBackendARMResource +} + +type GetLinkedBackendsCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteLinkedBackendARMResource +} + +// GetLinkedBackends ... +func (c StaticSitesClient) GetLinkedBackends(ctx context.Context, id StaticSiteId) (result GetLinkedBackendsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/linkedBackends", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteLinkedBackendARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetLinkedBackendsComplete retrieves all the results into a single object +func (c StaticSitesClient) GetLinkedBackendsComplete(ctx context.Context, id StaticSiteId) (GetLinkedBackendsCompleteResult, error) { + return c.GetLinkedBackendsCompleteMatchingPredicate(ctx, id, StaticSiteLinkedBackendARMResourceOperationPredicate{}) +} + +// GetLinkedBackendsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetLinkedBackendsCompleteMatchingPredicate(ctx context.Context, id StaticSiteId, predicate StaticSiteLinkedBackendARMResourceOperationPredicate) (result GetLinkedBackendsCompleteResult, err error) { + items := make([]StaticSiteLinkedBackendARMResource, 0) + + resp, err := c.GetLinkedBackends(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetLinkedBackendsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackendsforbuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackendsforbuild.go new file mode 100644 index 000000000000..a9c90637d14a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getlinkedbackendsforbuild.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetLinkedBackendsForBuildOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteLinkedBackendARMResource +} + +type GetLinkedBackendsForBuildCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteLinkedBackendARMResource +} + +// GetLinkedBackendsForBuild ... +func (c StaticSitesClient) GetLinkedBackendsForBuild(ctx context.Context, id BuildId) (result GetLinkedBackendsForBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/linkedBackends", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteLinkedBackendARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetLinkedBackendsForBuildComplete retrieves all the results into a single object +func (c StaticSitesClient) GetLinkedBackendsForBuildComplete(ctx context.Context, id BuildId) (GetLinkedBackendsForBuildCompleteResult, error) { + return c.GetLinkedBackendsForBuildCompleteMatchingPredicate(ctx, id, StaticSiteLinkedBackendARMResourceOperationPredicate{}) +} + +// GetLinkedBackendsForBuildCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetLinkedBackendsForBuildCompleteMatchingPredicate(ctx context.Context, id BuildId, predicate StaticSiteLinkedBackendARMResourceOperationPredicate) (result GetLinkedBackendsForBuildCompleteResult, err error) { + items := make([]StaticSiteLinkedBackendARMResource, 0) + + resp, err := c.GetLinkedBackendsForBuild(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetLinkedBackendsForBuildCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivateendpointconnection.go new file mode 100644 index 000000000000..7342343fa2a3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivateendpointconnection.go @@ -0,0 +1,54 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetPrivateEndpointConnectionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *RemotePrivateEndpointConnectionARMResource +} + +// GetPrivateEndpointConnection ... +func (c StaticSitesClient) GetPrivateEndpointConnection(ctx context.Context, id StaticSitePrivateEndpointConnectionId) (result GetPrivateEndpointConnectionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model RemotePrivateEndpointConnectionARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivateendpointconnectionlist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivateendpointconnectionlist.go new file mode 100644 index 000000000000..b5a681796cd4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivateendpointconnectionlist.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetPrivateEndpointConnectionListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]RemotePrivateEndpointConnectionARMResource +} + +type GetPrivateEndpointConnectionListCompleteResult struct { + LatestHttpResponse *http.Response + Items []RemotePrivateEndpointConnectionARMResource +} + +// GetPrivateEndpointConnectionList ... +func (c StaticSitesClient) GetPrivateEndpointConnectionList(ctx context.Context, id StaticSiteId) (result GetPrivateEndpointConnectionListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/privateEndpointConnections", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]RemotePrivateEndpointConnectionARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetPrivateEndpointConnectionListComplete retrieves all the results into a single object +func (c StaticSitesClient) GetPrivateEndpointConnectionListComplete(ctx context.Context, id StaticSiteId) (GetPrivateEndpointConnectionListCompleteResult, error) { + return c.GetPrivateEndpointConnectionListCompleteMatchingPredicate(ctx, id, RemotePrivateEndpointConnectionARMResourceOperationPredicate{}) +} + +// GetPrivateEndpointConnectionListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetPrivateEndpointConnectionListCompleteMatchingPredicate(ctx context.Context, id StaticSiteId, predicate RemotePrivateEndpointConnectionARMResourceOperationPredicate) (result GetPrivateEndpointConnectionListCompleteResult, err error) { + items := make([]RemotePrivateEndpointConnectionARMResource, 0) + + resp, err := c.GetPrivateEndpointConnectionList(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetPrivateEndpointConnectionListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivatelinkresources.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivatelinkresources.go new file mode 100644 index 000000000000..d95909433957 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getprivatelinkresources.go @@ -0,0 +1,55 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetPrivateLinkResourcesOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *PrivateLinkResourcesWrapper +} + +// GetPrivateLinkResources ... +func (c StaticSitesClient) GetPrivateLinkResources(ctx context.Context, id StaticSiteId) (result GetPrivateLinkResourcesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/privateLinkResources", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model PrivateLinkResourcesWrapper + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsite.go new file mode 100644 index 000000000000..6096f2cb35e8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsite.go @@ -0,0 +1,54 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetStaticSiteOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteARMResource +} + +// GetStaticSite ... +func (c StaticSitesClient) GetStaticSite(ctx context.Context, id StaticSiteId) (result GetStaticSiteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StaticSiteARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitebuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitebuild.go new file mode 100644 index 000000000000..0794f8c9a408 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitebuild.go @@ -0,0 +1,54 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetStaticSiteBuildOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteBuildARMResource +} + +// GetStaticSiteBuild ... +func (c StaticSitesClient) GetStaticSiteBuild(ctx context.Context, id BuildId) (result GetStaticSiteBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StaticSiteBuildARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitebuilds.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitebuilds.go new file mode 100644 index 000000000000..35a0a1c37e05 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitebuilds.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetStaticSiteBuildsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteBuildARMResource +} + +type GetStaticSiteBuildsCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteBuildARMResource +} + +// GetStaticSiteBuilds ... +func (c StaticSitesClient) GetStaticSiteBuilds(ctx context.Context, id StaticSiteId) (result GetStaticSiteBuildsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/builds", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteBuildARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetStaticSiteBuildsComplete retrieves all the results into a single object +func (c StaticSitesClient) GetStaticSiteBuildsComplete(ctx context.Context, id StaticSiteId) (GetStaticSiteBuildsCompleteResult, error) { + return c.GetStaticSiteBuildsCompleteMatchingPredicate(ctx, id, StaticSiteBuildARMResourceOperationPredicate{}) +} + +// GetStaticSiteBuildsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetStaticSiteBuildsCompleteMatchingPredicate(ctx context.Context, id StaticSiteId, predicate StaticSiteBuildARMResourceOperationPredicate) (result GetStaticSiteBuildsCompleteResult, err error) { + items := make([]StaticSiteBuildARMResource, 0) + + resp, err := c.GetStaticSiteBuilds(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetStaticSiteBuildsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitecustomdomain.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitecustomdomain.go new file mode 100644 index 000000000000..482be40cd047 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitecustomdomain.go @@ -0,0 +1,54 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetStaticSiteCustomDomainOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteCustomDomainOverviewARMResource +} + +// GetStaticSiteCustomDomain ... +func (c StaticSitesClient) GetStaticSiteCustomDomain(ctx context.Context, id CustomDomainId) (result GetStaticSiteCustomDomainOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StaticSiteCustomDomainOverviewARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitesbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitesbyresourcegroup.go new file mode 100644 index 000000000000..f5a6e73a93a2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getstaticsitesbyresourcegroup.go @@ -0,0 +1,92 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetStaticSitesByResourceGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteARMResource +} + +type GetStaticSitesByResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteARMResource +} + +// GetStaticSitesByResourceGroup ... +func (c StaticSitesClient) GetStaticSitesByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result GetStaticSitesByResourceGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.Web/staticSites", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetStaticSitesByResourceGroupComplete retrieves all the results into a single object +func (c StaticSitesClient) GetStaticSitesByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (GetStaticSitesByResourceGroupCompleteResult, error) { + return c.GetStaticSitesByResourceGroupCompleteMatchingPredicate(ctx, id, StaticSiteARMResourceOperationPredicate{}) +} + +// GetStaticSitesByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetStaticSitesByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate StaticSiteARMResourceOperationPredicate) (result GetStaticSitesByResourceGroupCompleteResult, err error) { + items := make([]StaticSiteARMResource, 0) + + resp, err := c.GetStaticSitesByResourceGroup(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetStaticSitesByResourceGroupCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsite.go new file mode 100644 index 000000000000..8b09371d9c2c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsite.go @@ -0,0 +1,54 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserProvidedFunctionAppForStaticSiteOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteUserProvidedFunctionAppARMResource +} + +// GetUserProvidedFunctionAppForStaticSite ... +func (c StaticSitesClient) GetUserProvidedFunctionAppForStaticSite(ctx context.Context, id UserProvidedFunctionAppId) (result GetUserProvidedFunctionAppForStaticSiteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StaticSiteUserProvidedFunctionAppARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsitebuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsitebuild.go new file mode 100644 index 000000000000..9419b0ecc937 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappforstaticsitebuild.go @@ -0,0 +1,54 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserProvidedFunctionAppForStaticSiteBuildOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteUserProvidedFunctionAppARMResource +} + +// GetUserProvidedFunctionAppForStaticSiteBuild ... +func (c StaticSitesClient) GetUserProvidedFunctionAppForStaticSiteBuild(ctx context.Context, id BuildUserProvidedFunctionAppId) (result GetUserProvidedFunctionAppForStaticSiteBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StaticSiteUserProvidedFunctionAppARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappsforstaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappsforstaticsite.go new file mode 100644 index 000000000000..23d1ee2ba485 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappsforstaticsite.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserProvidedFunctionAppsForStaticSiteOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteUserProvidedFunctionAppARMResource +} + +type GetUserProvidedFunctionAppsForStaticSiteCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteUserProvidedFunctionAppARMResource +} + +// GetUserProvidedFunctionAppsForStaticSite ... +func (c StaticSitesClient) GetUserProvidedFunctionAppsForStaticSite(ctx context.Context, id StaticSiteId) (result GetUserProvidedFunctionAppsForStaticSiteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/userProvidedFunctionApps", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteUserProvidedFunctionAppARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetUserProvidedFunctionAppsForStaticSiteComplete retrieves all the results into a single object +func (c StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteComplete(ctx context.Context, id StaticSiteId) (GetUserProvidedFunctionAppsForStaticSiteCompleteResult, error) { + return c.GetUserProvidedFunctionAppsForStaticSiteCompleteMatchingPredicate(ctx, id, StaticSiteUserProvidedFunctionAppARMResourceOperationPredicate{}) +} + +// GetUserProvidedFunctionAppsForStaticSiteCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteCompleteMatchingPredicate(ctx context.Context, id StaticSiteId, predicate StaticSiteUserProvidedFunctionAppARMResourceOperationPredicate) (result GetUserProvidedFunctionAppsForStaticSiteCompleteResult, err error) { + items := make([]StaticSiteUserProvidedFunctionAppARMResource, 0) + + resp, err := c.GetUserProvidedFunctionAppsForStaticSite(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetUserProvidedFunctionAppsForStaticSiteCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappsforstaticsitebuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappsforstaticsitebuild.go new file mode 100644 index 000000000000..2e45fd82f95b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_getuserprovidedfunctionappsforstaticsitebuild.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUserProvidedFunctionAppsForStaticSiteBuildOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteUserProvidedFunctionAppARMResource +} + +type GetUserProvidedFunctionAppsForStaticSiteBuildCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteUserProvidedFunctionAppARMResource +} + +// GetUserProvidedFunctionAppsForStaticSiteBuild ... +func (c StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteBuild(ctx context.Context, id BuildId) (result GetUserProvidedFunctionAppsForStaticSiteBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/userProvidedFunctionApps", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteUserProvidedFunctionAppARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// GetUserProvidedFunctionAppsForStaticSiteBuildComplete retrieves all the results into a single object +func (c StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteBuildComplete(ctx context.Context, id BuildId) (GetUserProvidedFunctionAppsForStaticSiteBuildCompleteResult, error) { + return c.GetUserProvidedFunctionAppsForStaticSiteBuildCompleteMatchingPredicate(ctx, id, StaticSiteUserProvidedFunctionAppARMResourceOperationPredicate{}) +} + +// GetUserProvidedFunctionAppsForStaticSiteBuildCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteBuildCompleteMatchingPredicate(ctx context.Context, id BuildId, predicate StaticSiteUserProvidedFunctionAppARMResourceOperationPredicate) (result GetUserProvidedFunctionAppsForStaticSiteBuildCompleteResult, err error) { + items := make([]StaticSiteUserProvidedFunctionAppARMResource, 0) + + resp, err := c.GetUserProvidedFunctionAppsForStaticSiteBuild(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = GetUserProvidedFunctionAppsForStaticSiteBuildCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_linkbackend.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_linkbackend.go new file mode 100644 index 000000000000..a36f96d86fad --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_linkbackend.go @@ -0,0 +1,74 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinkBackendOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteLinkedBackendARMResource +} + +// LinkBackend ... +func (c StaticSitesClient) LinkBackend(ctx context.Context, id LinkedBackendId, input StaticSiteLinkedBackendARMResource) (result LinkBackendOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// LinkBackendThenPoll performs LinkBackend then polls until it's completed +func (c StaticSitesClient) LinkBackendThenPoll(ctx context.Context, id LinkedBackendId, input StaticSiteLinkedBackendARMResource) error { + result, err := c.LinkBackend(ctx, id, input) + if err != nil { + return fmt.Errorf("performing LinkBackend: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after LinkBackend: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_linkbackendtobuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_linkbackendtobuild.go new file mode 100644 index 000000000000..5e1875714932 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_linkbackendtobuild.go @@ -0,0 +1,74 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LinkBackendToBuildOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteLinkedBackendARMResource +} + +// LinkBackendToBuild ... +func (c StaticSitesClient) LinkBackendToBuild(ctx context.Context, id BuildLinkedBackendId, input StaticSiteLinkedBackendARMResource) (result LinkBackendToBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// LinkBackendToBuildThenPoll performs LinkBackendToBuild then polls until it's completed +func (c StaticSitesClient) LinkBackendToBuildThenPoll(ctx context.Context, id BuildLinkedBackendId, input StaticSiteLinkedBackendARMResource) error { + result, err := c.LinkBackendToBuild(ctx, id, input) + if err != nil { + return fmt.Errorf("performing LinkBackendToBuild: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after LinkBackendToBuild: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_list.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_list.go new file mode 100644 index 000000000000..827e0cf38556 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_list.go @@ -0,0 +1,92 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteARMResource +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteARMResource +} + +// List ... +func (c StaticSitesClient) List(ctx context.Context, id commonids.SubscriptionId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.Web/staticSites", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListComplete retrieves all the results into a single object +func (c StaticSitesClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, StaticSiteARMResourceOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate StaticSiteARMResourceOperationPredicate) (result ListCompleteResult, err error) { + items := make([]StaticSiteARMResource, 0) + + resp, err := c.List(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_listbasicauth.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_listbasicauth.go new file mode 100644 index 000000000000..5a3da7684ede --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_listbasicauth.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListBasicAuthOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteBasicAuthPropertiesARMResource +} + +type ListBasicAuthCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteBasicAuthPropertiesARMResource +} + +// ListBasicAuth ... +func (c StaticSitesClient) ListBasicAuth(ctx context.Context, id StaticSiteId) (result ListBasicAuthOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/basicAuth", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteBasicAuthPropertiesARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListBasicAuthComplete retrieves all the results into a single object +func (c StaticSitesClient) ListBasicAuthComplete(ctx context.Context, id StaticSiteId) (ListBasicAuthCompleteResult, error) { + return c.ListBasicAuthCompleteMatchingPredicate(ctx, id, StaticSiteBasicAuthPropertiesARMResourceOperationPredicate{}) +} + +// ListBasicAuthCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) ListBasicAuthCompleteMatchingPredicate(ctx context.Context, id StaticSiteId, predicate StaticSiteBasicAuthPropertiesARMResourceOperationPredicate) (result ListBasicAuthCompleteResult, err error) { + items := make([]StaticSiteBasicAuthPropertiesARMResource, 0) + + resp, err := c.ListBasicAuth(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListBasicAuthCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteappsettings.go new file mode 100644 index 000000000000..5ecb3eee84b1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteappsettings.go @@ -0,0 +1,55 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteAppSettingsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringDictionary +} + +// ListStaticSiteAppSettings ... +func (c StaticSitesClient) ListStaticSiteAppSettings(ctx context.Context, id StaticSiteId) (result ListStaticSiteAppSettingsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listAppSettings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StringDictionary + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildappsettings.go new file mode 100644 index 000000000000..deb7ce043eca --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildappsettings.go @@ -0,0 +1,55 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteBuildAppSettingsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringDictionary +} + +// ListStaticSiteBuildAppSettings ... +func (c StaticSitesClient) ListStaticSiteBuildAppSettings(ctx context.Context, id BuildId) (result ListStaticSiteBuildAppSettingsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listAppSettings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StringDictionary + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildfunctionappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildfunctionappsettings.go new file mode 100644 index 000000000000..14b452b8d2ad --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildfunctionappsettings.go @@ -0,0 +1,55 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteBuildFunctionAppSettingsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringDictionary +} + +// ListStaticSiteBuildFunctionAppSettings ... +func (c StaticSitesClient) ListStaticSiteBuildFunctionAppSettings(ctx context.Context, id BuildId) (result ListStaticSiteBuildFunctionAppSettingsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listFunctionAppSettings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StringDictionary + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildfunctions.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildfunctions.go new file mode 100644 index 000000000000..ac7570b97c57 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitebuildfunctions.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteBuildFunctionsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteFunctionOverviewARMResource +} + +type ListStaticSiteBuildFunctionsCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteFunctionOverviewARMResource +} + +// ListStaticSiteBuildFunctions ... +func (c StaticSitesClient) ListStaticSiteBuildFunctions(ctx context.Context, id BuildId) (result ListStaticSiteBuildFunctionsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/functions", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteFunctionOverviewARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListStaticSiteBuildFunctionsComplete retrieves all the results into a single object +func (c StaticSitesClient) ListStaticSiteBuildFunctionsComplete(ctx context.Context, id BuildId) (ListStaticSiteBuildFunctionsCompleteResult, error) { + return c.ListStaticSiteBuildFunctionsCompleteMatchingPredicate(ctx, id, StaticSiteFunctionOverviewARMResourceOperationPredicate{}) +} + +// ListStaticSiteBuildFunctionsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) ListStaticSiteBuildFunctionsCompleteMatchingPredicate(ctx context.Context, id BuildId, predicate StaticSiteFunctionOverviewARMResourceOperationPredicate) (result ListStaticSiteBuildFunctionsCompleteResult, err error) { + items := make([]StaticSiteFunctionOverviewARMResource, 0) + + resp, err := c.ListStaticSiteBuildFunctions(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListStaticSiteBuildFunctionsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteconfiguredroles.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteconfiguredroles.go new file mode 100644 index 000000000000..1a015925a7f8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteconfiguredroles.go @@ -0,0 +1,55 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteConfiguredRolesOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringList +} + +// ListStaticSiteConfiguredRoles ... +func (c StaticSitesClient) ListStaticSiteConfiguredRoles(ctx context.Context, id StaticSiteId) (result ListStaticSiteConfiguredRolesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listConfiguredRoles", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StringList + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitecustomdomains.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitecustomdomains.go new file mode 100644 index 000000000000..570facccce53 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitecustomdomains.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteCustomDomainsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteCustomDomainOverviewARMResource +} + +type ListStaticSiteCustomDomainsCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteCustomDomainOverviewARMResource +} + +// ListStaticSiteCustomDomains ... +func (c StaticSitesClient) ListStaticSiteCustomDomains(ctx context.Context, id StaticSiteId) (result ListStaticSiteCustomDomainsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/customDomains", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteCustomDomainOverviewARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListStaticSiteCustomDomainsComplete retrieves all the results into a single object +func (c StaticSitesClient) ListStaticSiteCustomDomainsComplete(ctx context.Context, id StaticSiteId) (ListStaticSiteCustomDomainsCompleteResult, error) { + return c.ListStaticSiteCustomDomainsCompleteMatchingPredicate(ctx, id, StaticSiteCustomDomainOverviewARMResourceOperationPredicate{}) +} + +// ListStaticSiteCustomDomainsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) ListStaticSiteCustomDomainsCompleteMatchingPredicate(ctx context.Context, id StaticSiteId, predicate StaticSiteCustomDomainOverviewARMResourceOperationPredicate) (result ListStaticSiteCustomDomainsCompleteResult, err error) { + items := make([]StaticSiteCustomDomainOverviewARMResource, 0) + + resp, err := c.ListStaticSiteCustomDomains(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListStaticSiteCustomDomainsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitefunctionappsettings.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitefunctionappsettings.go new file mode 100644 index 000000000000..32f56586d7e8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitefunctionappsettings.go @@ -0,0 +1,55 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteFunctionAppSettingsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringDictionary +} + +// ListStaticSiteFunctionAppSettings ... +func (c StaticSitesClient) ListStaticSiteFunctionAppSettings(ctx context.Context, id StaticSiteId) (result ListStaticSiteFunctionAppSettingsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listFunctionAppSettings", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StringDictionary + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitefunctions.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitefunctions.go new file mode 100644 index 000000000000..374b80280e2c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitefunctions.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteFunctionsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteFunctionOverviewARMResource +} + +type ListStaticSiteFunctionsCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteFunctionOverviewARMResource +} + +// ListStaticSiteFunctions ... +func (c StaticSitesClient) ListStaticSiteFunctions(ctx context.Context, id StaticSiteId) (result ListStaticSiteFunctionsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/functions", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteFunctionOverviewARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListStaticSiteFunctionsComplete retrieves all the results into a single object +func (c StaticSitesClient) ListStaticSiteFunctionsComplete(ctx context.Context, id StaticSiteId) (ListStaticSiteFunctionsCompleteResult, error) { + return c.ListStaticSiteFunctionsCompleteMatchingPredicate(ctx, id, StaticSiteFunctionOverviewARMResourceOperationPredicate{}) +} + +// ListStaticSiteFunctionsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) ListStaticSiteFunctionsCompleteMatchingPredicate(ctx context.Context, id StaticSiteId, predicate StaticSiteFunctionOverviewARMResourceOperationPredicate) (result ListStaticSiteFunctionsCompleteResult, err error) { + items := make([]StaticSiteFunctionOverviewARMResource, 0) + + resp, err := c.ListStaticSiteFunctions(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListStaticSiteFunctionsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitesecrets.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitesecrets.go new file mode 100644 index 000000000000..cc35a7c06546 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsitesecrets.go @@ -0,0 +1,55 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteSecretsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StringDictionary +} + +// ListStaticSiteSecrets ... +func (c StaticSitesClient) ListStaticSiteSecrets(ctx context.Context, id StaticSiteId) (result ListStaticSiteSecretsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listSecrets", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StringDictionary + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteusers.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteusers.go new file mode 100644 index 000000000000..1c6904d7ecc2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_liststaticsiteusers.go @@ -0,0 +1,91 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListStaticSiteUsersOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]StaticSiteUserARMResource +} + +type ListStaticSiteUsersCompleteResult struct { + LatestHttpResponse *http.Response + Items []StaticSiteUserARMResource +} + +// ListStaticSiteUsers ... +func (c StaticSitesClient) ListStaticSiteUsers(ctx context.Context, id AuthProviderId) (result ListStaticSiteUsersOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listUsers", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]StaticSiteUserARMResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListStaticSiteUsersComplete retrieves all the results into a single object +func (c StaticSitesClient) ListStaticSiteUsersComplete(ctx context.Context, id AuthProviderId) (ListStaticSiteUsersCompleteResult, error) { + return c.ListStaticSiteUsersCompleteMatchingPredicate(ctx, id, StaticSiteUserARMResourceOperationPredicate{}) +} + +// ListStaticSiteUsersCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c StaticSitesClient) ListStaticSiteUsersCompleteMatchingPredicate(ctx context.Context, id AuthProviderId, predicate StaticSiteUserARMResourceOperationPredicate) (result ListStaticSiteUsersCompleteResult, err error) { + items := make([]StaticSiteUserARMResource, 0) + + resp, err := c.ListStaticSiteUsers(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListStaticSiteUsersCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_previewworkflow.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_previewworkflow.go new file mode 100644 index 000000000000..f867a88a25e0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_previewworkflow.go @@ -0,0 +1,59 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PreviewWorkflowOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSitesWorkflowPreview +} + +// PreviewWorkflow ... +func (c StaticSitesClient) PreviewWorkflow(ctx context.Context, id ProviderLocationId, input StaticSitesWorkflowPreviewRequest) (result PreviewWorkflowOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/previewStaticSiteWorkflowFile", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StaticSitesWorkflowPreview + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_registeruserprovidedfunctionappwithstaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_registeruserprovidedfunctionappwithstaticsite.go new file mode 100644 index 000000000000..cda8ba615de2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_registeruserprovidedfunctionappwithstaticsite.go @@ -0,0 +1,103 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegisterUserProvidedFunctionAppWithStaticSiteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteUserProvidedFunctionAppARMResource +} + +type RegisterUserProvidedFunctionAppWithStaticSiteOperationOptions struct { + IsForced *bool +} + +func DefaultRegisterUserProvidedFunctionAppWithStaticSiteOperationOptions() RegisterUserProvidedFunctionAppWithStaticSiteOperationOptions { + return RegisterUserProvidedFunctionAppWithStaticSiteOperationOptions{} +} + +func (o RegisterUserProvidedFunctionAppWithStaticSiteOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o RegisterUserProvidedFunctionAppWithStaticSiteOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o RegisterUserProvidedFunctionAppWithStaticSiteOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.IsForced != nil { + out.Append("isForced", fmt.Sprintf("%v", *o.IsForced)) + } + return &out +} + +// RegisterUserProvidedFunctionAppWithStaticSite ... +func (c StaticSitesClient) RegisterUserProvidedFunctionAppWithStaticSite(ctx context.Context, id UserProvidedFunctionAppId, input StaticSiteUserProvidedFunctionAppARMResource, options RegisterUserProvidedFunctionAppWithStaticSiteOperationOptions) (result RegisterUserProvidedFunctionAppWithStaticSiteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// RegisterUserProvidedFunctionAppWithStaticSiteThenPoll performs RegisterUserProvidedFunctionAppWithStaticSite then polls until it's completed +func (c StaticSitesClient) RegisterUserProvidedFunctionAppWithStaticSiteThenPoll(ctx context.Context, id UserProvidedFunctionAppId, input StaticSiteUserProvidedFunctionAppARMResource, options RegisterUserProvidedFunctionAppWithStaticSiteOperationOptions) error { + result, err := c.RegisterUserProvidedFunctionAppWithStaticSite(ctx, id, input, options) + if err != nil { + return fmt.Errorf("performing RegisterUserProvidedFunctionAppWithStaticSite: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after RegisterUserProvidedFunctionAppWithStaticSite: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_registeruserprovidedfunctionappwithstaticsitebuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_registeruserprovidedfunctionappwithstaticsitebuild.go new file mode 100644 index 000000000000..a3f67cbfd6e9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_registeruserprovidedfunctionappwithstaticsitebuild.go @@ -0,0 +1,103 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteUserProvidedFunctionAppARMResource +} + +type RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions struct { + IsForced *bool +} + +func DefaultRegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions() RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions { + return RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions{} +} + +func (o RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.IsForced != nil { + out.Append("isForced", fmt.Sprintf("%v", *o.IsForced)) + } + return &out +} + +// RegisterUserProvidedFunctionAppWithStaticSiteBuild ... +func (c StaticSitesClient) RegisterUserProvidedFunctionAppWithStaticSiteBuild(ctx context.Context, id BuildUserProvidedFunctionAppId, input StaticSiteUserProvidedFunctionAppARMResource, options RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions) (result RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// RegisterUserProvidedFunctionAppWithStaticSiteBuildThenPoll performs RegisterUserProvidedFunctionAppWithStaticSiteBuild then polls until it's completed +func (c StaticSitesClient) RegisterUserProvidedFunctionAppWithStaticSiteBuildThenPoll(ctx context.Context, id BuildUserProvidedFunctionAppId, input StaticSiteUserProvidedFunctionAppARMResource, options RegisterUserProvidedFunctionAppWithStaticSiteBuildOperationOptions) error { + result, err := c.RegisterUserProvidedFunctionAppWithStaticSiteBuild(ctx, id, input, options) + if err != nil { + return fmt.Errorf("performing RegisterUserProvidedFunctionAppWithStaticSiteBuild: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after RegisterUserProvidedFunctionAppWithStaticSiteBuild: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_resetstaticsiteapikey.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_resetstaticsiteapikey.go new file mode 100644 index 000000000000..722e36f78c67 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_resetstaticsiteapikey.go @@ -0,0 +1,51 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResetStaticSiteApiKeyOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +// ResetStaticSiteApiKey ... +func (c StaticSitesClient) ResetStaticSiteApiKey(ctx context.Context, id StaticSiteId, input StaticSiteResetPropertiesARMResource) (result ResetStaticSiteApiKeyOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/resetapikey", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_unlinkbackend.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_unlinkbackend.go new file mode 100644 index 000000000000..980662409691 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_unlinkbackend.go @@ -0,0 +1,76 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UnlinkBackendOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +type UnlinkBackendOperationOptions struct { + IsCleaningAuthConfig *bool +} + +func DefaultUnlinkBackendOperationOptions() UnlinkBackendOperationOptions { + return UnlinkBackendOperationOptions{} +} + +func (o UnlinkBackendOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o UnlinkBackendOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o UnlinkBackendOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.IsCleaningAuthConfig != nil { + out.Append("isCleaningAuthConfig", fmt.Sprintf("%v", *o.IsCleaningAuthConfig)) + } + return &out +} + +// UnlinkBackend ... +func (c StaticSitesClient) UnlinkBackend(ctx context.Context, id LinkedBackendId, options UnlinkBackendOperationOptions) (result UnlinkBackendOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_unlinkbackendfrombuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_unlinkbackendfrombuild.go new file mode 100644 index 000000000000..9ef02435e54b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_unlinkbackendfrombuild.go @@ -0,0 +1,76 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UnlinkBackendFromBuildOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData +} + +type UnlinkBackendFromBuildOperationOptions struct { + IsCleaningAuthConfig *bool +} + +func DefaultUnlinkBackendFromBuildOperationOptions() UnlinkBackendFromBuildOperationOptions { + return UnlinkBackendFromBuildOperationOptions{} +} + +func (o UnlinkBackendFromBuildOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o UnlinkBackendFromBuildOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o UnlinkBackendFromBuildOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.IsCleaningAuthConfig != nil { + out.Append("isCleaningAuthConfig", fmt.Sprintf("%v", *o.IsCleaningAuthConfig)) + } + return &out +} + +// UnlinkBackendFromBuild ... +func (c StaticSitesClient) UnlinkBackendFromBuild(ctx context.Context, id BuildLinkedBackendId, options UnlinkBackendFromBuildOperationOptions) (result UnlinkBackendFromBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatebuilddatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatebuilddatabaseconnection.go new file mode 100644 index 000000000000..c9611ae5cb38 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatebuilddatabaseconnection.go @@ -0,0 +1,58 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateBuildDatabaseConnectionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DatabaseConnection +} + +// UpdateBuildDatabaseConnection ... +func (c StaticSitesClient) UpdateBuildDatabaseConnection(ctx context.Context, id BuildDatabaseConnectionId, input DatabaseConnectionPatchRequest) (result UpdateBuildDatabaseConnectionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model DatabaseConnection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatedatabaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatedatabaseconnection.go new file mode 100644 index 000000000000..6e37673f34d2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatedatabaseconnection.go @@ -0,0 +1,58 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateDatabaseConnectionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DatabaseConnection +} + +// UpdateDatabaseConnection ... +func (c StaticSitesClient) UpdateDatabaseConnection(ctx context.Context, id DatabaseConnectionId, input DatabaseConnectionPatchRequest) (result UpdateDatabaseConnectionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model DatabaseConnection + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsite.go new file mode 100644 index 000000000000..2db8a28235ae --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsite.go @@ -0,0 +1,59 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateStaticSiteOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteARMResource +} + +// UpdateStaticSite ... +func (c StaticSitesClient) UpdateStaticSite(ctx context.Context, id StaticSiteId, input StaticSitePatchResource) (result UpdateStaticSiteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StaticSiteARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsiteuser.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsiteuser.go new file mode 100644 index 000000000000..ddcb14fbcc65 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_updatestaticsiteuser.go @@ -0,0 +1,58 @@ +package staticsites + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateStaticSiteUserOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *StaticSiteUserARMResource +} + +// UpdateStaticSiteUser ... +func (c StaticSitesClient) UpdateStaticSiteUser(ctx context.Context, id UserId, input StaticSiteUserARMResource) (result UpdateStaticSiteUserOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var model StaticSiteUserARMResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatebackend.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatebackend.go new file mode 100644 index 000000000000..12aa25c2202f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatebackend.go @@ -0,0 +1,74 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateBackendOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// ValidateBackend ... +func (c StaticSitesClient) ValidateBackend(ctx context.Context, id LinkedBackendId, input StaticSiteLinkedBackendARMResource) (result ValidateBackendOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/validate", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// ValidateBackendThenPoll performs ValidateBackend then polls until it's completed +func (c StaticSitesClient) ValidateBackendThenPoll(ctx context.Context, id LinkedBackendId, input StaticSiteLinkedBackendARMResource) error { + result, err := c.ValidateBackend(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ValidateBackend: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ValidateBackend: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatebackendforbuild.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatebackendforbuild.go new file mode 100644 index 000000000000..d703ff84c0bc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatebackendforbuild.go @@ -0,0 +1,74 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateBackendForBuildOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// ValidateBackendForBuild ... +func (c StaticSitesClient) ValidateBackendForBuild(ctx context.Context, id BuildLinkedBackendId, input StaticSiteLinkedBackendARMResource) (result ValidateBackendForBuildOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/validate", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// ValidateBackendForBuildThenPoll performs ValidateBackendForBuild then polls until it's completed +func (c StaticSitesClient) ValidateBackendForBuildThenPoll(ctx context.Context, id BuildLinkedBackendId, input StaticSiteLinkedBackendARMResource) error { + result, err := c.ValidateBackendForBuild(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ValidateBackendForBuild: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ValidateBackendForBuild: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatecustomdomaincanbeaddedtostaticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatecustomdomaincanbeaddedtostaticsite.go new file mode 100644 index 000000000000..deda3155c42b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/method_validatecustomdomaincanbeaddedtostaticsite.go @@ -0,0 +1,74 @@ +package staticsites + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ValidateCustomDomainCanBeAddedToStaticSiteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// ValidateCustomDomainCanBeAddedToStaticSite ... +func (c StaticSitesClient) ValidateCustomDomainCanBeAddedToStaticSite(ctx context.Context, id CustomDomainId, input StaticSiteCustomDomainRequestPropertiesARMResource) (result ValidateCustomDomainCanBeAddedToStaticSiteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/validate", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// ValidateCustomDomainCanBeAddedToStaticSiteThenPoll performs ValidateCustomDomainCanBeAddedToStaticSite then polls until it's completed +func (c StaticSitesClient) ValidateCustomDomainCanBeAddedToStaticSiteThenPoll(ctx context.Context, id CustomDomainId, input StaticSiteCustomDomainRequestPropertiesARMResource) error { + result, err := c.ValidateCustomDomainCanBeAddedToStaticSite(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ValidateCustomDomainCanBeAddedToStaticSite: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ValidateCustomDomainCanBeAddedToStaticSite: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_armidwrapper.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_armidwrapper.go new file mode 100644 index 000000000000..c9987651a5f2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_armidwrapper.go @@ -0,0 +1,8 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ArmIdWrapper struct { + Id *string `json:"id,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_armplan.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_armplan.go new file mode 100644 index 000000000000..2cb5352de6eb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_armplan.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ArmPlan struct { + Name *string `json:"name,omitempty"` + Product *string `json:"product,omitempty"` + PromotionCode *string `json:"promotionCode,omitempty"` + Publisher *string `json:"publisher,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_capability.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_capability.go new file mode 100644 index 000000000000..300bf980489f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_capability.go @@ -0,0 +1,10 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Capability struct { + Name *string `json:"name,omitempty"` + Reason *string `json:"reason,omitempty"` + Value *string `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnection.go new file mode 100644 index 000000000000..cd069f365d42 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnection.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseConnection struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *DatabaseConnectionProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionoverview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionoverview.go new file mode 100644 index 000000000000..8597c4ff8b48 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionoverview.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseConnectionOverview struct { + ConfigurationFiles *[]StaticSiteDatabaseConnectionConfigurationFileOverview `json:"configurationFiles,omitempty"` + ConnectionIdentity *string `json:"connectionIdentity,omitempty"` + Name *string `json:"name,omitempty"` + Region *string `json:"region,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionpatchrequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionpatchrequest.go new file mode 100644 index 000000000000..493e3509268c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionpatchrequest.go @@ -0,0 +1,8 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseConnectionPatchRequest struct { + Properties *DatabaseConnectionPatchRequestProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionpatchrequestproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionpatchrequestproperties.go new file mode 100644 index 000000000000..2b5eb824c264 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionpatchrequestproperties.go @@ -0,0 +1,11 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseConnectionPatchRequestProperties struct { + ConnectionIdentity *string `json:"connectionIdentity,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Region *string `json:"region,omitempty"` + ResourceId *string `json:"resourceId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionproperties.go new file mode 100644 index 000000000000..81aee01e533a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_databaseconnectionproperties.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseConnectionProperties struct { + ConfigurationFiles *[]StaticSiteDatabaseConnectionConfigurationFileOverview `json:"configurationFiles,omitempty"` + ConnectionIdentity *string `json:"connectionIdentity,omitempty"` + ConnectionString *string `json:"connectionString,omitempty"` + Region string `json:"region"` + ResourceId string `json:"resourceId"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_errorentity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_errorentity.go new file mode 100644 index 000000000000..6b726cb5492f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_errorentity.go @@ -0,0 +1,15 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ErrorEntity struct { + Code *string `json:"code,omitempty"` + Details *[]ErrorEntity `json:"details,omitempty"` + ExtendedCode *string `json:"extendedCode,omitempty"` + InnerErrors *[]ErrorEntity `json:"innerErrors,omitempty"` + Message *string `json:"message,omitempty"` + MessageTemplate *string `json:"messageTemplate,omitempty"` + Parameters *[]string `json:"parameters,omitempty"` + Target *string `json:"target,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkconnectionstate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkconnectionstate.go new file mode 100644 index 000000000000..bdfe81e8a98f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkconnectionstate.go @@ -0,0 +1,10 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkConnectionState struct { + ActionsRequired *string `json:"actionsRequired,omitempty"` + Description *string `json:"description,omitempty"` + Status *string `json:"status,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresource.go new file mode 100644 index 000000000000..975df70d5c79 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresource.go @@ -0,0 +1,11 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkResource struct { + Id string `json:"id"` + Name string `json:"name"` + Properties PrivateLinkResourceProperties `json:"properties"` + Type string `json:"type"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresourceproperties.go new file mode 100644 index 000000000000..8dacfc8b182a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresourceproperties.go @@ -0,0 +1,10 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkResourceProperties struct { + GroupId *string `json:"groupId,omitempty"` + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresourceswrapper.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresourceswrapper.go new file mode 100644 index 000000000000..2890dfe9e4ad --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_privatelinkresourceswrapper.go @@ -0,0 +1,8 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateLinkResourcesWrapper struct { + Value []PrivateLinkResource `json:"value"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnection.go new file mode 100644 index 000000000000..2456e6e1d5b8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnection.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RemotePrivateEndpointConnection struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *RemotePrivateEndpointConnectionProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionarmresource.go new file mode 100644 index 000000000000..708bf563a7fa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RemotePrivateEndpointConnectionARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *RemotePrivateEndpointConnectionARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionarmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionarmresourceproperties.go new file mode 100644 index 000000000000..75f3ef6233dd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionarmresourceproperties.go @@ -0,0 +1,11 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RemotePrivateEndpointConnectionARMResourceProperties struct { + IPAddresses *[]string `json:"ipAddresses,omitempty"` + PrivateEndpoint *ArmIdWrapper `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionproperties.go new file mode 100644 index 000000000000..23d098fcaa6b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_remoteprivateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RemotePrivateEndpointConnectionProperties struct { + IPAddresses *[]string `json:"ipAddresses,omitempty"` + PrivateEndpoint *ArmIdWrapper `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_responsemessageenveloperemoteprivateendpointconnection.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_responsemessageenveloperemoteprivateendpointconnection.go new file mode 100644 index 000000000000..54a231b34602 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_responsemessageenveloperemoteprivateendpointconnection.go @@ -0,0 +1,24 @@ +package staticsites + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResponseMessageEnvelopeRemotePrivateEndpointConnection struct { + Error *ErrorEntity `json:"error,omitempty"` + Id *string `json:"id,omitempty"` + Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Plan *ArmPlan `json:"plan,omitempty"` + Properties *RemotePrivateEndpointConnection `json:"properties,omitempty"` + Sku *SkuDescription `json:"sku,omitempty"` + Status *string `json:"status,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` + Zones *zones.Schema `json:"zones,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_skucapacity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_skucapacity.go new file mode 100644 index 000000000000..d8cd9de7ec4e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_skucapacity.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SkuCapacity struct { + Default *int64 `json:"default,omitempty"` + ElasticMaximum *int64 `json:"elasticMaximum,omitempty"` + Maximum *int64 `json:"maximum,omitempty"` + Minimum *int64 `json:"minimum,omitempty"` + ScaleType *string `json:"scaleType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_skudescription.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_skudescription.go new file mode 100644 index 000000000000..2e1e0cde311e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_skudescription.go @@ -0,0 +1,15 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SkuDescription struct { + Capabilities *[]Capability `json:"capabilities,omitempty"` + Capacity *int64 `json:"capacity,omitempty"` + Family *string `json:"family,omitempty"` + Locations *[]string `json:"locations,omitempty"` + Name *string `json:"name,omitempty"` + Size *string `json:"size,omitempty"` + SkuCapacity *SkuCapacity `json:"skuCapacity,omitempty"` + Tier *string `json:"tier,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsite.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsite.go new file mode 100644 index 000000000000..9fad6989e545 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsite.go @@ -0,0 +1,25 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSite struct { + AllowConfigFileUpdates *bool `json:"allowConfigFileUpdates,omitempty"` + Branch *string `json:"branch,omitempty"` + BuildProperties *StaticSiteBuildProperties `json:"buildProperties,omitempty"` + ContentDistributionEndpoint *string `json:"contentDistributionEndpoint,omitempty"` + CustomDomains *[]string `json:"customDomains,omitempty"` + DatabaseConnections *[]DatabaseConnectionOverview `json:"databaseConnections,omitempty"` + DefaultHostname *string `json:"defaultHostname,omitempty"` + EnterpriseGradeCdnStatus *EnterpriseGradeCdnStatus `json:"enterpriseGradeCdnStatus,omitempty"` + KeyVaultReferenceIdentity *string `json:"keyVaultReferenceIdentity,omitempty"` + LinkedBackends *[]StaticSiteLinkedBackend `json:"linkedBackends,omitempty"` + PrivateEndpointConnections *[]ResponseMessageEnvelopeRemotePrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + Provider *string `json:"provider,omitempty"` + PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` + RepositoryToken *string `json:"repositoryToken,omitempty"` + RepositoryUrl *string `json:"repositoryUrl,omitempty"` + StagingEnvironmentPolicy *StagingEnvironmentPolicy `json:"stagingEnvironmentPolicy,omitempty"` + TemplateProperties *StaticSiteTemplateOptions `json:"templateProperties,omitempty"` + UserProvidedFunctionApps *[]StaticSiteUserProvidedFunctionApp `json:"userProvidedFunctionApps,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitearmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitearmresource.go new file mode 100644 index 000000000000..a54aa2362bbb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitearmresource.go @@ -0,0 +1,20 @@ +package staticsites + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteARMResource struct { + Id *string `json:"id,omitempty"` + Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` + Kind *string `json:"kind,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *StaticSite `json:"properties,omitempty"` + Sku *SkuDescription `json:"sku,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebasicauthpropertiesarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebasicauthpropertiesarmresource.go new file mode 100644 index 000000000000..bf58faf53d3c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebasicauthpropertiesarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteBasicAuthPropertiesARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteBasicAuthPropertiesARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go new file mode 100644 index 000000000000..80795463497f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebasicauthpropertiesarmresourceproperties.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteBasicAuthPropertiesARMResourceProperties struct { + ApplicableEnvironmentsMode string `json:"applicableEnvironmentsMode"` + Environments *[]string `json:"environments,omitempty"` + Password *string `json:"password,omitempty"` + SecretState *string `json:"secretState,omitempty"` + SecretUrl *string `json:"secretUrl,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildarmresource.go new file mode 100644 index 000000000000..332e5334386d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteBuildARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteBuildARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildarmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildarmresourceproperties.go new file mode 100644 index 000000000000..50bbe9e5443b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildarmresourceproperties.go @@ -0,0 +1,47 @@ +package staticsites + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteBuildARMResourceProperties struct { + BuildId *string `json:"buildId,omitempty"` + CreatedTimeUtc *string `json:"createdTimeUtc,omitempty"` + DatabaseConnections *[]DatabaseConnectionOverview `json:"databaseConnections,omitempty"` + Hostname *string `json:"hostname,omitempty"` + LastUpdatedOn *string `json:"lastUpdatedOn,omitempty"` + LinkedBackends *[]StaticSiteLinkedBackend `json:"linkedBackends,omitempty"` + PullRequestTitle *string `json:"pullRequestTitle,omitempty"` + SourceBranch *string `json:"sourceBranch,omitempty"` + Status *BuildStatus `json:"status,omitempty"` + UserProvidedFunctionApps *[]StaticSiteUserProvidedFunctionApp `json:"userProvidedFunctionApps,omitempty"` +} + +func (o *StaticSiteBuildARMResourceProperties) GetCreatedTimeUtcAsTime() (*time.Time, error) { + if o.CreatedTimeUtc == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedTimeUtc, "2006-01-02T15:04:05Z07:00") +} + +func (o *StaticSiteBuildARMResourceProperties) SetCreatedTimeUtcAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedTimeUtc = &formatted +} + +func (o *StaticSiteBuildARMResourceProperties) GetLastUpdatedOnAsTime() (*time.Time, error) { + if o.LastUpdatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastUpdatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *StaticSiteBuildARMResourceProperties) SetLastUpdatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastUpdatedOn = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildproperties.go new file mode 100644 index 000000000000..9dbe72ed06c8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitebuildproperties.go @@ -0,0 +1,15 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteBuildProperties struct { + ApiBuildCommand *string `json:"apiBuildCommand,omitempty"` + ApiLocation *string `json:"apiLocation,omitempty"` + AppArtifactLocation *string `json:"appArtifactLocation,omitempty"` + AppBuildCommand *string `json:"appBuildCommand,omitempty"` + AppLocation *string `json:"appLocation,omitempty"` + GitHubActionSecretNameOverride *string `json:"githubActionSecretNameOverride,omitempty"` + OutputLocation *string `json:"outputLocation,omitempty"` + SkipGithubActionWorkflowGeneration *bool `json:"skipGithubActionWorkflowGeneration,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainoverviewarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainoverviewarmresource.go new file mode 100644 index 000000000000..95f00a987622 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainoverviewarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteCustomDomainOverviewARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteCustomDomainOverviewARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainoverviewarmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainoverviewarmresourceproperties.go new file mode 100644 index 000000000000..cc0b5c992745 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainoverviewarmresourceproperties.go @@ -0,0 +1,30 @@ +package staticsites + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteCustomDomainOverviewARMResourceProperties struct { + CreatedOn *string `json:"createdOn,omitempty"` + DomainName *string `json:"domainName,omitempty"` + ErrorMessage *string `json:"errorMessage,omitempty"` + Status *CustomDomainStatus `json:"status,omitempty"` + ValidationToken *string `json:"validationToken,omitempty"` +} + +func (o *StaticSiteCustomDomainOverviewARMResourceProperties) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *StaticSiteCustomDomainOverviewARMResourceProperties) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainrequestpropertiesarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainrequestpropertiesarmresource.go new file mode 100644 index 000000000000..b790fc90f5d6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainrequestpropertiesarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteCustomDomainRequestPropertiesARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteCustomDomainRequestPropertiesARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainrequestpropertiesarmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainrequestpropertiesarmresourceproperties.go new file mode 100644 index 000000000000..e4510ee88550 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitecustomdomainrequestpropertiesarmresourceproperties.go @@ -0,0 +1,8 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteCustomDomainRequestPropertiesARMResourceProperties struct { + ValidationMethod *string `json:"validationMethod,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitedatabaseconnectionconfigurationfileoverview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitedatabaseconnectionconfigurationfileoverview.go new file mode 100644 index 000000000000..0389a6f704cf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitedatabaseconnectionconfigurationfileoverview.go @@ -0,0 +1,10 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteDatabaseConnectionConfigurationFileOverview struct { + Contents *string `json:"contents,omitempty"` + FileName *string `json:"fileName,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitefunctionoverviewarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitefunctionoverviewarmresource.go new file mode 100644 index 000000000000..fa8ca3288d9c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitefunctionoverviewarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteFunctionOverviewARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteFunctionOverviewARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitefunctionoverviewarmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitefunctionoverviewarmresourceproperties.go new file mode 100644 index 000000000000..46eeb3307745 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitefunctionoverviewarmresourceproperties.go @@ -0,0 +1,9 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteFunctionOverviewARMResourceProperties struct { + FunctionName *string `json:"functionName,omitempty"` + TriggerType *TriggerTypes `json:"triggerType,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackend.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackend.go new file mode 100644 index 000000000000..52b103d13bc3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackend.go @@ -0,0 +1,29 @@ +package staticsites + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteLinkedBackend struct { + BackendResourceId *string `json:"backendResourceId,omitempty"` + CreatedOn *string `json:"createdOn,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + Region *string `json:"region,omitempty"` +} + +func (o *StaticSiteLinkedBackend) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *StaticSiteLinkedBackend) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackendarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackendarmresource.go new file mode 100644 index 000000000000..97ddc7ab2ac5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackendarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteLinkedBackendARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteLinkedBackendARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackendarmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackendarmresourceproperties.go new file mode 100644 index 000000000000..5ec2c55c3933 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitelinkedbackendarmresourceproperties.go @@ -0,0 +1,29 @@ +package staticsites + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteLinkedBackendARMResourceProperties struct { + BackendResourceId *string `json:"backendResourceId,omitempty"` + CreatedOn *string `json:"createdOn,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + Region *string `json:"region,omitempty"` +} + +func (o *StaticSiteLinkedBackendARMResourceProperties) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *StaticSiteLinkedBackendARMResourceProperties) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitepatchresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitepatchresource.go new file mode 100644 index 000000000000..6969a6ebae49 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitepatchresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSitePatchResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSite `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteresetpropertiesarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteresetpropertiesarmresource.go new file mode 100644 index 000000000000..53a0c64632ad --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteresetpropertiesarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteResetPropertiesARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteResetPropertiesARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteresetpropertiesarmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteresetpropertiesarmresourceproperties.go new file mode 100644 index 000000000000..87a927d39523 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteresetpropertiesarmresourceproperties.go @@ -0,0 +1,9 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteResetPropertiesARMResourceProperties struct { + RepositoryToken *string `json:"repositoryToken,omitempty"` + ShouldUpdateRepository *bool `json:"shouldUpdateRepository,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreview.go new file mode 100644 index 000000000000..01cca8f1d477 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreview.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSitesWorkflowPreview struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSitesWorkflowPreviewProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewproperties.go new file mode 100644 index 000000000000..4e0aa482c925 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewproperties.go @@ -0,0 +1,9 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSitesWorkflowPreviewProperties struct { + Contents *string `json:"contents,omitempty"` + Path *string `json:"path,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewrequest.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewrequest.go new file mode 100644 index 000000000000..c255ba006977 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewrequest.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSitesWorkflowPreviewRequest struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSitesWorkflowPreviewRequestProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go new file mode 100644 index 000000000000..bca5c553bc44 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitesworkflowpreviewrequestproperties.go @@ -0,0 +1,10 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSitesWorkflowPreviewRequestProperties struct { + Branch *string `json:"branch,omitempty"` + BuildProperties *StaticSiteBuildProperties `json:"buildProperties,omitempty"` + RepositoryUrl *string `json:"repositoryUrl,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitetemplateoptions.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitetemplateoptions.go new file mode 100644 index 000000000000..5afb0421afc4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitetemplateoptions.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteTemplateOptions struct { + Description *string `json:"description,omitempty"` + IsPrivate *bool `json:"isPrivate,omitempty"` + Owner *string `json:"owner,omitempty"` + RepositoryName *string `json:"repositoryName,omitempty"` + TemplateRepositoryUrl *string `json:"templateRepositoryUrl,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserarmresource.go new file mode 100644 index 000000000000..296cf30c6f8f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteUserARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteUserARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserarmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserarmresourceproperties.go new file mode 100644 index 000000000000..1ee310fa7734 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserarmresourceproperties.go @@ -0,0 +1,11 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteUserARMResourceProperties struct { + DisplayName *string `json:"displayName,omitempty"` + Provider *string `json:"provider,omitempty"` + Roles *string `json:"roles,omitempty"` + UserId *string `json:"userId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationrequestresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationrequestresource.go new file mode 100644 index 000000000000..d9d5ae47bdcb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationrequestresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteUserInvitationRequestResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteUserInvitationRequestResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationrequestresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationrequestresourceproperties.go new file mode 100644 index 000000000000..744a01b8f56f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationrequestresourceproperties.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteUserInvitationRequestResourceProperties struct { + Domain *string `json:"domain,omitempty"` + NumHoursToExpiration *int64 `json:"numHoursToExpiration,omitempty"` + Provider *string `json:"provider,omitempty"` + Roles *string `json:"roles,omitempty"` + UserDetails *string `json:"userDetails,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationresponseresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationresponseresource.go new file mode 100644 index 000000000000..1c89e5056c0c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationresponseresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteUserInvitationResponseResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteUserInvitationResponseResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go new file mode 100644 index 000000000000..674c99a3b509 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserinvitationresponseresourceproperties.go @@ -0,0 +1,27 @@ +package staticsites + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteUserInvitationResponseResourceProperties struct { + ExpiresOn *string `json:"expiresOn,omitempty"` + InvitationUrl *string `json:"invitationUrl,omitempty"` +} + +func (o *StaticSiteUserInvitationResponseResourceProperties) GetExpiresOnAsTime() (*time.Time, error) { + if o.ExpiresOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ExpiresOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *StaticSiteUserInvitationResponseResourceProperties) SetExpiresOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ExpiresOn = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapp.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapp.go new file mode 100644 index 000000000000..08c7d23a344b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapp.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteUserProvidedFunctionApp struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteUserProvidedFunctionAppProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapparmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapparmresource.go new file mode 100644 index 000000000000..c3a983f8eeaf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapparmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteUserProvidedFunctionAppARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteUserProvidedFunctionAppARMResourceProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapparmresourceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapparmresourceproperties.go new file mode 100644 index 000000000000..5c3f5f4b6290 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionapparmresourceproperties.go @@ -0,0 +1,28 @@ +package staticsites + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteUserProvidedFunctionAppARMResourceProperties struct { + CreatedOn *string `json:"createdOn,omitempty"` + FunctionAppRegion *string `json:"functionAppRegion,omitempty"` + FunctionAppResourceId *string `json:"functionAppResourceId,omitempty"` +} + +func (o *StaticSiteUserProvidedFunctionAppARMResourceProperties) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *StaticSiteUserProvidedFunctionAppARMResourceProperties) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionappproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionappproperties.go new file mode 100644 index 000000000000..d1aa33d93e10 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsiteuserprovidedfunctionappproperties.go @@ -0,0 +1,28 @@ +package staticsites + +import ( + "time" + + "github.com/hashicorp/go-azure-helpers/lang/dates" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteUserProvidedFunctionAppProperties struct { + CreatedOn *string `json:"createdOn,omitempty"` + FunctionAppRegion *string `json:"functionAppRegion,omitempty"` + FunctionAppResourceId *string `json:"functionAppResourceId,omitempty"` +} + +func (o *StaticSiteUserProvidedFunctionAppProperties) GetCreatedOnAsTime() (*time.Time, error) { + if o.CreatedOn == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreatedOn, "2006-01-02T15:04:05Z07:00") +} + +func (o *StaticSiteUserProvidedFunctionAppProperties) SetCreatedOnAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreatedOn = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitezipdeployment.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitezipdeployment.go new file mode 100644 index 000000000000..29435dc00a6d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitezipdeployment.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteZipDeployment struct { + ApiZipUrl *string `json:"apiZipUrl,omitempty"` + AppZipUrl *string `json:"appZipUrl,omitempty"` + DeploymentTitle *string `json:"deploymentTitle,omitempty"` + FunctionLanguage *string `json:"functionLanguage,omitempty"` + Provider *string `json:"provider,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitezipdeploymentarmresource.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitezipdeploymentarmresource.go new file mode 100644 index 000000000000..f842a2730dc0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_staticsitezipdeploymentarmresource.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StaticSiteZipDeploymentARMResource struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *StaticSiteZipDeployment `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_stringdictionary.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_stringdictionary.go new file mode 100644 index 000000000000..719659036142 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_stringdictionary.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StringDictionary struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *map[string]string `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_stringlist.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_stringlist.go new file mode 100644 index 000000000000..79987b1ea842 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/model_stringlist.go @@ -0,0 +1,12 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StringList struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties *[]string `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/predicates.go new file mode 100644 index 000000000000..b27ed7b5388c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/predicates.go @@ -0,0 +1,289 @@ +package staticsites + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatabaseConnectionOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p DatabaseConnectionOperationPredicate) Matches(input DatabaseConnection) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} + +type RemotePrivateEndpointConnectionARMResourceOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p RemotePrivateEndpointConnectionARMResourceOperationPredicate) Matches(input RemotePrivateEndpointConnectionARMResource) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} + +type StaticSiteARMResourceOperationPredicate struct { + Id *string + Kind *string + Location *string + Name *string + Type *string +} + +func (p StaticSiteARMResourceOperationPredicate) Matches(input StaticSiteARMResource) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} + +type StaticSiteBasicAuthPropertiesARMResourceOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p StaticSiteBasicAuthPropertiesARMResourceOperationPredicate) Matches(input StaticSiteBasicAuthPropertiesARMResource) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} + +type StaticSiteBuildARMResourceOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p StaticSiteBuildARMResourceOperationPredicate) Matches(input StaticSiteBuildARMResource) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} + +type StaticSiteCustomDomainOverviewARMResourceOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p StaticSiteCustomDomainOverviewARMResourceOperationPredicate) Matches(input StaticSiteCustomDomainOverviewARMResource) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} + +type StaticSiteFunctionOverviewARMResourceOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p StaticSiteFunctionOverviewARMResourceOperationPredicate) Matches(input StaticSiteFunctionOverviewARMResource) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} + +type StaticSiteLinkedBackendARMResourceOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p StaticSiteLinkedBackendARMResourceOperationPredicate) Matches(input StaticSiteLinkedBackendARMResource) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} + +type StaticSiteUserARMResourceOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p StaticSiteUserARMResourceOperationPredicate) Matches(input StaticSiteUserARMResource) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} + +type StaticSiteUserProvidedFunctionAppARMResourceOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p StaticSiteUserProvidedFunctionAppARMResourceOperationPredicate) Matches(input StaticSiteUserProvidedFunctionAppARMResource) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/version.go new file mode 100644 index 000000000000..dbb89d0c49bd --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites/version.go @@ -0,0 +1,12 @@ +package staticsites + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-01-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/staticsites/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 44a266596926..b5846fa0f0de 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1053,6 +1053,7 @@ github.com/hashicorp/go-azure-sdk/resource-manager/web/2016-06-01/managedapis github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/appserviceenvironments github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/appserviceplans github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/resourceproviders +github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/staticsites github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/webapps github.com/hashicorp/go-azure-sdk/resource-manager/webpubsub/2023-02-01 github.com/hashicorp/go-azure-sdk/resource-manager/webpubsub/2023-02-01/webpubsub diff --git a/website/docs/d/static_web_app.html.markdown b/website/docs/d/static_web_app.html.markdown new file mode 100644 index 000000000000..78b1995ecda1 --- /dev/null +++ b/website/docs/d/static_web_app.html.markdown @@ -0,0 +1,72 @@ +--- +subcategory: "App Service (Web Apps)" +layout: "azurerm" +page_title: "Azure Resource Manager: Data Source: azurerm_static_web_app" +description: |- + Gets information about an existing Static Web App. +--- + +# Data Source: azurerm_static_web_app + +Use this data source to access information about an existing Static Web App. + +## Example Usage + +```hcl +data "azurerm_static_web_app" "example" { + name = "existing" + resource_group_name = "existing" +} + + +``` + +## Arguments Reference + +The following arguments are supported: + +* `name` - (Required) The name of this Static Web App. + +* `resource_group_name` - (Required) The name of the Resource Group where the Static Web App exists. + +* `location` - The Azure region in which this Static Web App exists. + +* `api_key` - The API key of this Static Web App, which is used for later interacting with this Static Web App from other clients, e.g. GitHub Action. + +* `app_settings` - The map of key-value pairs of App Settings for the Static Web App. + +* `basic_auth` - A `basic_auth` block as defined below. + +* `configuration_file_changes_enabled` - Are changes to the configuration file permitted. + +* `default_host_name` - The default host name of the Static Web App. + +* `preview_environments_enabled` - Are Preview (Staging) environments enabled. + +* `sku_tier` - The SKU tier of the Static Web App. + +* `sku_size` - The SKU size of the Static Web App. + +* `identity` - An `identity` block as defined below. + +* `tags` - The mapping of tags assigned to the resource. + +--- + +An `identity` block exports the following: + +* `type` - The Type of Managed Identity assigned to this Static Web App resource. + +* `identity_ids` - The list of Managed Identity IDs which are assigned to this Static Web App resource. + +--- + +A `basic_auth` block exports the following: + +* `environments` - The Environment types which are configured to use Basic Auth access. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `read` - (Defaults to 5 minutes) Used when retrieving the Static Web App \ No newline at end of file diff --git a/website/docs/r/static_site.html.markdown b/website/docs/r/static_site.html.markdown index 660f3c93ba28..e5e567decf14 100644 --- a/website/docs/r/static_site.html.markdown +++ b/website/docs/r/static_site.html.markdown @@ -10,6 +10,8 @@ description: |- Manages an App Service Static Site. +-> **NOTE:** The `azurerm_static_site` resource is deprecated in favour of `azurerm_static_web_app` and will be removed in a future major release. + ->**NOTE:** After the Static Site is provisioned, you'll need to associate your target repository, which contains your web app, to the Static Site, by following the [Azure Static Site document](https://docs.microsoft.com/azure/static-web-apps/github-actions-workflow). ## Example Usage diff --git a/website/docs/r/static_site_custom_domain.html.markdown b/website/docs/r/static_site_custom_domain.html.markdown index 5e7cc7dba3d5..060e61a4f1d7 100644 --- a/website/docs/r/static_site_custom_domain.html.markdown +++ b/website/docs/r/static_site_custom_domain.html.markdown @@ -12,6 +12,8 @@ Manages a Static Site Custom Domain. !> DNS validation polling is only done for CNAME records, terraform will not validate TXT validation records are complete. +-> **NOTE:** The `azurerm_static_site_custom_domain` resource is deprecated in favour of `azurerm_static_web_app_custom_domain` and will be removed in a future major release. + ## Example Usage ### CNAME validation diff --git a/website/docs/r/static_web_app.html.markdown b/website/docs/r/static_web_app.html.markdown new file mode 100644 index 000000000000..e05753100c95 --- /dev/null +++ b/website/docs/r/static_web_app.html.markdown @@ -0,0 +1,96 @@ +--- +subcategory: "App Service (Web Apps)" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_static_web_app" +description: |- + Manages a Static Web App. +--- + +# azurerm_static_web_app + +Manages an App Service Static Web App. + +## Example Usage + +```hcl +resource "azurerm_resource_group" "example" { + name = "example-resources" + location = "West Europe" +} + +resource "azurerm_static_web_app" "example" { + name = "example" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location +} +``` + +## Arguments Reference + +The following arguments are supported: + +* `name` - (Required) The name which should be used for this Static Web App. Changing this forces a new Static Web App to be created. + +* `location` - (Required) The Azure Region where the Static Web App should exist. Changing this forces a new Static Web App to be created. + +* `resource_group_name` - (Required) The name of the Resource Group where the Static Web App should exist. Changing this forces a new Static Web App to be created. + +* `basic_auth` - (Optional) A `basic_auth` block as defined below. + +* `configuration_file_changes_enabled` - (Optional) Should changes to the configuration file be permitted. Defaults to `true`. + +* `preview_environments_enabled` - (Optional) Are Preview (Staging) environments enabled. Defaults to `true`. + +* `sku_tier` - (Optional) Specifies the SKU tier of the Static Web App. Possible values are `Free` or `Standard`. Defaults to `Free`. + +* `sku_size` - (Optional) Specifies the SKU size of the Static Web App. Possible values are `Free` or `Standard`. Defaults to `Free`. + +* `identity` - (Optional) An `identity` block as defined below. + +* `app_settings` - (Optional) A key-value pair of App Settings. + +* `tags` - (Optional) A mapping of tags to assign to the resource. + +--- + +An `identity` block supports the following: + +* `type` - (Required) The Type of Managed Identity assigned to this Static Web App resource. Possible values are `SystemAssigned`, `UserAssigned` and `SystemAssigned, UserAssigned`. + +* `identity_ids` - (Optional) A list of Managed Identity IDs which should be assigned to this Static Web App resource. + +--- + +A `basic_auth` block supports the following: + +* `password` - (Required) The password for the basic authentication access. + +* `environments` - (Required) The Environment types to use the Basic Auth for access. Possible values include `AllEnvironments` and `StagingEnvironments`. + +## Attributes Reference + +In addition to the Arguments listed above - the following Attributes are exported: + +* `id` - The ID of the Static Web App. + +* `api_key` - The API key of this Static Web App, which is used for later interacting with this Static Web App from other clients, e.g. GitHub Action. + +* `default_host_name` - The default host name of the Static Web App. + + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `create` - (Defaults to 30 minutes) Used when creating the Static Web App. +* `read` - (Defaults to 5 minutes) Used when retrieving the Static Web App. +* `update` - (Defaults to 30 minutes) Used when updating the Static Web App. +* `delete` - (Defaults to 30 minutes) Used when deleting the Static Web App. + +## Import + +Static Web Apps can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_static_web_app.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1 +``` diff --git a/website/docs/r/static_web_app_custom_domain.html.markdown b/website/docs/r/static_web_app_custom_domain.html.markdown new file mode 100644 index 000000000000..55afffffbac7 --- /dev/null +++ b/website/docs/r/static_web_app_custom_domain.html.markdown @@ -0,0 +1,115 @@ +--- +subcategory: "App Service (Web Apps)" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_static_web_app_custom_domain" +description: |- + Manages a Static Web App Custom Domain. +--- + +# azurerm_static_web_app_custom_domain + +Manages a Static Web App Custom Domain. + +!> DNS validation polling is only done for CNAME records, terraform will not validate TXT validation records are complete. + +## Example Usage + +### CNAME validation + +```hcl +resource "azurerm_resource_group" "example" { + name = "example-resources" + location = "West Europe" +} + +resource "azurerm_static_web_app" "example" { + name = "example" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location +} + +resource "azurerm_dns_cname_record" "example" { + name = "my-domain" + zone_name = "contoso.com" + resource_group_name = azurerm_resource_group.example.name + ttl = 300 + record = azurerm_static_web_app.example.default_host_name +} + +resource "azurerm_static_web_app_custom_domain" "example" { + static_web_app_id = azurerm_static_web_app.example.id + domain_name = "${azurerm_dns_cname_record.example.name}.${azurerm_dns_cname_record.example.zone_name}" + validation_type = "cname-delegation" +} +``` + +### TXT validation + +```hcl +resource "azurerm_resource_group" "example" { + name = "example-resources" + location = "West Europe" +} + +resource "azurerm_static_web_app" "example" { + name = "example" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location +} + +resource "azurerm_static_web_app_custom_domain" "example" { + static_web_app_id = azurerm_static_web_app.example.id + domain_name = "my-domain.contoso.com" + validation_type = "dns-txt-token" +} + +resource "azurerm_dns_txt_record" "example" { + name = "_dnsauth.my-domain" + zone_name = "contoso.com" + resource_group_name = azurerm_resource_group.example.name + ttl = 300 + record { + value = azurerm_static_web_app_custom_domain.example.validation_token + } +} +``` + +## Arguments Reference + +The following arguments are supported: + +* `domain_name` - (Required) The Domain Name which should be associated with this Static Site. Changing this forces a new Static Site Custom Domain to be created. + +* `static_web_app_id` - (Required) The ID of the Static Site. Changing this forces a new Static Site Custom Domain to be created. + +* `validation_type` - (Required) One of `cname-delegation` or `dns-txt-token`. Changing this forces a new Static Site Custom Domain to be created. + +-> **NOTE:** Apex domains must use `dns-txt-token` validation. + +-> **NOTE:** Validation using `dns-txt-token` is performed asynchronously and Terraform does not wait for the validation process to be successful before marking the resource as created successfully. Please ensure that the appropriate TXT record is created using the `validation_token` value for this to complete out of band. + +## Attributes Reference + +In addition to the Arguments listed above - the following Attributes are exported: + +* `id` - The ID of the Static Site Custom Domain. + +* `validation_token` - Token to be used with `dns-txt-token` validation. + +-> **NOTE:** For `cname-delegation` this will be empty. For `dns-txt-token` validation, this value exists until the domain has been validated and is then cleared. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `create` - (Defaults to 30 minutes) Used when creating the Static Site Custom Domain. +* `read` - (Defaults to 5 minutes) Used when retrieving the Static Site Custom Domain. +* `delete` - (Defaults to 30 minutes) Used when deleting the Static Site Custom Domain. + +## Import + +Static Site Custom Domains can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_static_web_app_custom_domain.example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Web/staticSites/my-static-site1/customDomains/name.contoso.com +```