diff --git a/.teamcity/components/generated/services.kt b/.teamcity/components/generated/services.kt index ad0bae3b4be4..f70ec7ae8653 100644 --- a/.teamcity/components/generated/services.kt +++ b/.teamcity/components/generated/services.kt @@ -90,6 +90,7 @@ var services = mapOf( "newrelic" to "New Relic", "nginx" to "Nginx", "notificationhub" to "Notification Hub", + "oracledatabase" to "Oracle Database", "orbital" to "Orbital", "paloalto" to "Palo Alto", "policy" to "Policy", diff --git a/internal/clients/client.go b/internal/clients/client.go index ec8d2f15b347..384faa8fd86a 100644 --- a/internal/clients/client.go +++ b/internal/clients/client.go @@ -106,6 +106,7 @@ import ( newrelic "github.com/hashicorp/terraform-provider-azurerm/internal/services/newrelic/client" nginx "github.com/hashicorp/terraform-provider-azurerm/internal/services/nginx/client" notificationhub "github.com/hashicorp/terraform-provider-azurerm/internal/services/notificationhub/client" + oracledatabase "github.com/hashicorp/terraform-provider-azurerm/internal/services/oracledatabase/client" orbital "github.com/hashicorp/terraform-provider-azurerm/internal/services/orbital/client" paloalto "github.com/hashicorp/terraform-provider-azurerm/internal/services/paloalto/client" policy "github.com/hashicorp/terraform-provider-azurerm/internal/services/policy/client" @@ -236,6 +237,7 @@ type Client struct { NewRelic *newrelic.Client Nginx *nginx_2024_06_01_preview.Client NotificationHubs *notificationhub.Client + OracleDatabase *oracledatabase.Client Orbital *orbital.Client PaloAlto *paloalto.Client Policy *policy.Client @@ -532,6 +534,9 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error if client.NotificationHubs, err = notificationhub.NewClient(o); err != nil { return fmt.Errorf("building clients for NotificationHubs: %+v", err) } + if client.OracleDatabase, err = oracledatabase.NewClient(o); err != nil { + return fmt.Errorf("building clients for OracleDatabase: %+v", err) + } if client.Orbital, err = orbital.NewClient(o); err != nil { return fmt.Errorf("building clients for Orbital: %+v", err) } diff --git a/internal/provider/services.go b/internal/provider/services.go index e350c7df91e7..6da74bc6f280 100644 --- a/internal/provider/services.go +++ b/internal/provider/services.go @@ -90,6 +90,7 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/newrelic" "github.com/hashicorp/terraform-provider-azurerm/internal/services/nginx" "github.com/hashicorp/terraform-provider-azurerm/internal/services/notificationhub" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/oracledatabase" "github.com/hashicorp/terraform-provider-azurerm/internal/services/orbital" "github.com/hashicorp/terraform-provider-azurerm/internal/services/paloalto" "github.com/hashicorp/terraform-provider-azurerm/internal/services/policy" @@ -188,6 +189,7 @@ func SupportedTypedServices() []sdk.TypedServiceRegistration { networkfunction.Registration{}, newrelic.Registration{}, nginx.Registration{}, + oracledatabase.Registration{}, orbital.Registration{}, paloalto.Registration{}, policy.Registration{}, diff --git a/internal/services/oracledatabase/client/client.go b/internal/services/oracledatabase/client/client.go new file mode 100644 index 000000000000..6d3467596a8e --- /dev/null +++ b/internal/services/oracledatabase/client/client.go @@ -0,0 +1,26 @@ +// Copyright © 2024, Oracle and/or its affiliates. All rights reserved + +package client + +import ( + oracedatabase "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/terraform-provider-azurerm/internal/common" +) + +type Client struct { + OracleDatabaseClient *oracedatabase.Client +} + +func NewClient(o *common.ClientOptions) (*Client, error) { + o.DisableCorrelationRequestID = true + oracleDatabaseClient, err := oracedatabase.NewClientWithBaseURI(o.Environment.ResourceManager, func(c *resourcemanager.Client) { + o.Configure(c, o.Authorizers.ResourceManager) + }) + if err != nil { + return nil, err + } + return &Client{ + OracleDatabaseClient: oracleDatabaseClient, + }, nil +} diff --git a/internal/services/oracledatabase/exadata_infrastructure_data_source.go b/internal/services/oracledatabase/exadata_infrastructure_data_source.go new file mode 100644 index 000000000000..508a20647eb6 --- /dev/null +++ b/internal/services/oracledatabase/exadata_infrastructure_data_source.go @@ -0,0 +1,571 @@ +// Copyright © 2024, Oracle and/or its affiliates. All rights reserved + +package oracledatabase + +import ( + "context" + "fmt" + "time" + + "github.com/hashicorp/terraform-provider-azurerm/utils" + + "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/location" + "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" +) + +type ExadataInfraDataSource struct{} + +type ExadataInfraDataModel struct { + Location string `tfschema:"location"` + Name string `tfschema:"name"` + ResourceGroupName string `tfschema:"resource_group_name"` + Type string `tfschema:"type"` + Tags map[string]interface{} `tfschema:"tags"` + Zones zones.Schema `tfschema:"zones"` + + // SystemData + SystemData []SystemDataModel `tfschema:"system_data"` + + // CloudExadataInfrastructureProperties + ActivatedStorageCount int64 `tfschema:"activated_storage_count"` + AdditionalStorageCount int64 `tfschema:"additional_storage_count"` + AvailableStorageSizeInGbs int64 `tfschema:"available_storage_size_in_gbs"` + ComputeCount int64 `tfschema:"compute_count"` + CpuCount int64 `tfschema:"cpu_count"` + CustomerContacts []string `tfschema:"customer_contacts"` + DataStorageSizeInTbs float64 `tfschema:"data_storage_size_in_tbs"` + DbNodeStorageSizeInGbs int64 `tfschema:"db_node_storage_size_in_gbs"` + DbServerVersion string `tfschema:"db_server_version"` + DisplayName string `tfschema:"display_name"` + EstimatedPatchingTime []EstimatedPatchingTimeModel `tfschema:"estimated_patching_time"` + LastMaintenanceRunId string `tfschema:"last_maintenance_run_id"` + LifecycleDetails string `tfschema:"lifecycle_details"` + LifecycleState string `tfschema:"lifecycle_state"` + MaintenanceWindow []MaintenanceWindowModel `tfschema:"maintenance_window"` + MaxCPUCount int64 `tfschema:"max_cpu_count"` + MaxDataStorageInTbs float64 `tfschema:"max_data_storage_in_tbs"` + MaxDbNodeStorageSizeInGbs int64 `tfschema:"max_db_node_storage_size_in_gbs"` + MaxMemoryInGbs int64 `tfschema:"max_memory_in_gbs"` + MemorySizeInGbs int64 `tfschema:"memory_size_in_gbs"` + MonthlyDbServerVersion string `tfschema:"monthly_db_server_version"` + MonthlyStorageServerVersion string `tfschema:"monthly_storage_server_version"` + NextMaintenanceRunId string `tfschema:"next_maintenance_run_id"` + OciUrl string `tfschema:"oci_url"` + Ocid string `tfschema:"ocid"` + ProvisioningState string `tfschema:"provisioning_state"` + Shape string `tfschema:"shape"` + StorageCount int64 `tfschema:"storage_count"` + StorageServerVersion string `tfschema:"storage_server_version"` + TimeCreated string `tfschema:"time_created"` + TotalStorageSizeInGbs int64 `tfschema:"total_storage_size_in_gbs"` +} + +type SystemDataModel struct { + CreatedBy string `tfschema:"created_by"` + CreatedByType string `tfschema:"created_by_type"` + CreatedAt string `tfschema:"created_at"` + LastModifiedBy string `tfschema:"last_modified_by"` + LastModifiedbyType string `tfschema:"last_modified_by_type"` + LastModifiedAt string `tfschema:"last_modified_at"` +} + +type EstimatedPatchingTimeModel struct { + EstimatedDbServerPatchingTime *int64 `tfschema:"estimated_db_server_patching_time"` + EstimatedNetworkSwitchesPatchingTime *int64 `tfschema:"estimated_network_switches_patching_time"` + EstimatedStorageServerPatchingTime *int64 `tfschema:"estimated_storage_server_patching_time"` + TotalEstimatedPatchingTime *int64 `tfschema:"total_estimated_patching_time"` +} + +type MaintenanceWindowModel struct { + DaysOfWeek []string `tfschema:"days_of_week"` + HoursOfDay []int64 `tfschema:"hours_of_day"` + LeadTimeInWeeks int64 `tfschema:"lead_time_in_weeks"` + Months []string `tfschema:"months"` + PatchingMode string `tfschema:"patching_mode"` + Preference string `tfschema:"preference"` + WeeksOfMonth []int64 `tfschema:"weeks_of_month"` +} + +func (d ExadataInfraDataSource) Arguments() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "resource_group_name": commonschema.ResourceGroupNameForDataSource(), + + "name": { + Type: pluginsdk.TypeString, + Required: true, + }, + } +} + +func (d ExadataInfraDataSource) Attributes() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + "location": commonschema.LocationComputed(), + + "type": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + // SystemData + "system_data": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "created_by": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "created_by_type": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "created_at": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "last_modified_by": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "last_modified_by_type": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "last_modified_at": { + Type: pluginsdk.TypeString, + Computed: true, + }, + }, + }, + }, + + // CloudExadataInfrastructureProperties + "activated_storage_count": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "additional_storage_count": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "available_storage_size_in_gbs": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "compute_count": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "cpu_count": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "customer_contacts": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "data_storage_size_in_tbs": { + Type: pluginsdk.TypeFloat, + Computed: true, + }, + + "db_node_storage_size_in_gbs": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "db_server_version": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "display_name": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "estimated_patching_time": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "estimated_db_server_patching_time": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "estimated_network_switches_patching_time": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "estimated_storage_server_patching_time": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "total_estimated_patching_time": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + }, + }, + }, + + "last_maintenance_run_id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "lifecycle_details": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "lifecycle_state": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "maintenance_window": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "custom_action_timeout_in_mins": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "days_of_week": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "hours_of_day": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeInt, + }, + }, + + "is_custom_action_timeout_enabled": { + Type: pluginsdk.TypeBool, + Computed: true, + }, + + "is_monthly_patching_enabled": { + Type: pluginsdk.TypeBool, + Computed: true, + }, + + "lead_time_in_weeks": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "months": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "patching_mode": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "preference": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "weeks_of_month": { + Type: pluginsdk.TypeList, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeInt, + }, + }, + }, + }, + }, + + "max_cpu_count": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "max_data_storage_in_tbs": { + Type: pluginsdk.TypeFloat, + Computed: true, + }, + + "max_db_node_storage_size_in_gbs": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "max_memory_in_gbs": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "memory_size_in_gbs": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "monthly_db_server_version": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "monthly_storage_server_version": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "next_maintenance_run_id": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "oci_url": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "ocid": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "provisioning_state": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "shape": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "storage_count": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "storage_server_version": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "time_created": { + Type: pluginsdk.TypeString, + Computed: true, + }, + + "total_storage_size_in_gbs": { + Type: pluginsdk.TypeInt, + Computed: true, + }, + + "tags": commonschema.TagsDataSource(), + + "zones": commonschema.ZonesMultipleComputed(), + } +} + +func (d ExadataInfraDataSource) ModelObject() interface{} { + return nil +} + +func (d ExadataInfraDataSource) ResourceType() string { + return "azurerm_oracle_exadata_infrastructure" +} + +func (d ExadataInfraDataSource) IDValidationFunc() pluginsdk.SchemaValidateFunc { + return cloudexadatainfrastructures.ValidateCloudExadataInfrastructureID +} + +func (d ExadataInfraDataSource) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.OracleDatabase.OracleDatabaseClient.CloudExadataInfrastructures + subscriptionId := metadata.Client.Account.SubscriptionId + + id := cloudexadatainfrastructures.NewCloudExadataInfrastructureID(subscriptionId, + metadata.ResourceData.Get("resource_group_name").(string), + metadata.ResourceData.Get("name").(string)) + + resp, err := client.Get(ctx, id) + if err != nil { + if response.WasNotFound(resp.HttpResponse) { + return fmt.Errorf("%s was not found", id) + } + return fmt.Errorf("retrieving %s: %+v", id, err) + } + + if model := resp.Model; model != nil { + err := metadata.ResourceData.Set("location", location.NormalizeNilable(&model.Location)) + if err != nil { + return err + } + + var output ExadataInfraDataModel + + prop := model.Properties + if prop != nil { + output = ExadataInfraDataModel{ + ActivatedStorageCount: pointer.From(prop.ActivatedStorageCount), + AdditionalStorageCount: pointer.From(prop.AdditionalStorageCount), + AvailableStorageSizeInGbs: pointer.From(prop.AvailableStorageSizeInGbs), + CpuCount: pointer.From(prop.CpuCount), + ComputeCount: pointer.From(prop.ComputeCount), + CustomerContacts: FlattenCustomerContacts(prop.CustomerContacts), + DataStorageSizeInTbs: pointer.From(prop.DataStorageSizeInTbs), + DbNodeStorageSizeInGbs: pointer.From(prop.DbNodeStorageSizeInGbs), + DbServerVersion: pointer.From(prop.DbServerVersion), + DisplayName: prop.DisplayName, + EstimatedPatchingTime: FlattenEstimatedPatchingTimes(prop.EstimatedPatchingTime), + LastMaintenanceRunId: pointer.From(prop.LastMaintenanceRunId), + LifecycleDetails: pointer.From(prop.LifecycleDetails), + LifecycleState: string(*prop.LifecycleState), + MaintenanceWindow: FlattenMaintenanceWindow(prop.MaintenanceWindow), + MaxCPUCount: pointer.From(prop.MaxCPUCount), + MaxDataStorageInTbs: pointer.From(prop.MaxDataStorageInTbs), + MaxDbNodeStorageSizeInGbs: pointer.From(prop.MaxDbNodeStorageSizeInGbs), + MaxMemoryInGbs: pointer.From(prop.MaxMemoryInGbs), + MemorySizeInGbs: pointer.From(prop.MemorySizeInGbs), + MonthlyDbServerVersion: pointer.From(prop.MonthlyDbServerVersion), + MonthlyStorageServerVersion: pointer.From(prop.MonthlyStorageServerVersion), + NextMaintenanceRunId: pointer.From(prop.NextMaintenanceRunId), + OciUrl: pointer.From(prop.OciURL), + Ocid: pointer.From(prop.Ocid), + ProvisioningState: string(*prop.ProvisioningState), + Shape: prop.Shape, + StorageCount: pointer.From(prop.StorageCount), + StorageServerVersion: pointer.From(prop.StorageServerVersion), + TimeCreated: pointer.From(prop.TimeCreated), + TotalStorageSizeInGbs: pointer.From(prop.TotalStorageSizeInGbs), + } + } + + systemData := model.SystemData + if systemData != nil { + output.SystemData = []SystemDataModel{ + { + CreatedBy: systemData.CreatedBy, + CreatedByType: systemData.CreatedByType, + CreatedAt: systemData.CreatedAt, + LastModifiedBy: systemData.LastModifiedBy, + LastModifiedbyType: systemData.LastModifiedbyType, + LastModifiedAt: systemData.LastModifiedAt, + }, + } + } + + output.Name = id.CloudExadataInfrastructureName + output.ResourceGroupName = id.ResourceGroupName + output.Type = pointer.From(model.Type) + output.Tags = utils.FlattenPtrMapStringString(model.Tags) + output.Location = model.Location + output.Zones = model.Zones + + metadata.SetID(id) + return metadata.Encode(&output) + } + return nil + }, + } +} + +func FlattenCustomerContacts(customerContactsList *[]cloudexadatainfrastructures.CustomerContact) []string { + var customerContacts []string + if customerContactsList != nil { + for _, customerContact := range *customerContactsList { + customerContacts = append(customerContacts, customerContact.Email) + } + } + return customerContacts +} + +func FlattenEstimatedPatchingTimes(estimatedPatchingTime *cloudexadatainfrastructures.EstimatedPatchingTime) []EstimatedPatchingTimeModel { + if estimatedPatchingTime != nil { + return []EstimatedPatchingTimeModel{ + { + EstimatedDbServerPatchingTime: estimatedPatchingTime.EstimatedDbServerPatchingTime, + EstimatedNetworkSwitchesPatchingTime: estimatedPatchingTime.EstimatedNetworkSwitchesPatchingTime, + EstimatedStorageServerPatchingTime: estimatedPatchingTime.EstimatedStorageServerPatchingTime, + TotalEstimatedPatchingTime: estimatedPatchingTime.TotalEstimatedPatchingTime, + }, + } + } + return nil +} + +func FlattenMaintenanceWindow(maintenanceWindow *cloudexadatainfrastructures.MaintenanceWindow) []MaintenanceWindowModel { + if maintenanceWindow != nil { + return []MaintenanceWindowModel{ + { + DaysOfWeek: FlattenDayOfWeek(maintenanceWindow.DaysOfWeek), + HoursOfDay: pointer.From(maintenanceWindow.HoursOfDay), + LeadTimeInWeeks: pointer.From(maintenanceWindow.LeadTimeInWeeks), + Months: FlattenMonths(maintenanceWindow.Months), + PatchingMode: string(pointer.From(maintenanceWindow.PatchingMode)), + Preference: string(pointer.From(maintenanceWindow.Preference)), + WeeksOfMonth: pointer.From(maintenanceWindow.WeeksOfMonth), + }, + } + } + return []MaintenanceWindowModel{} +} + +func FlattenDayOfWeek(dayOfWeeks *[]cloudexadatainfrastructures.DayOfWeek) []string { + var dayOfWeeksArray []string + if dayOfWeeks != nil { + for _, dayOfWeek := range *dayOfWeeks { + dayOfWeeksArray = append(dayOfWeeksArray, string(dayOfWeek.Name)) + } + } + return dayOfWeeksArray +} + +func FlattenMonths(months *[]cloudexadatainfrastructures.Month) []string { + var monthsArray []string + if months != nil { + for _, month := range *months { + monthsArray = append(monthsArray, string(month.Name)) + } + } + return monthsArray +} diff --git a/internal/services/oracledatabase/exadata_infrastructure_data_source_test.go b/internal/services/oracledatabase/exadata_infrastructure_data_source_test.go new file mode 100644 index 000000000000..885dca07bb0a --- /dev/null +++ b/internal/services/oracledatabase/exadata_infrastructure_data_source_test.go @@ -0,0 +1,46 @@ +// Copyright © 2024, Oracle and/or its affiliates. All rights reserved + +package oracledatabase_test + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/oracledatabase" +) + +type ExadataInfraDataSource struct{} + +func TestExadataInfraDataSource_basic(t *testing.T) { + data := acceptance.BuildTestData(t, oracledatabase.ExadataInfraDataSource{}.ResourceType(), "test") + r := ExadataInfraDataSource{} + + data.DataSourceTest(t, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).Key("name").Exists(), + check.That(data.ResourceName).Key("location").Exists(), + check.That(data.ResourceName).Key("resource_group_name").Exists(), + check.That(data.ResourceName).Key("compute_count").Exists(), + check.That(data.ResourceName).Key("display_name").Exists(), + check.That(data.ResourceName).Key("shape").Exists(), + check.That(data.ResourceName).Key("storage_count").Exists(), + check.That(data.ResourceName).Key("zones.#").HasValue("1"), + ), + }, + }) +} + +func (d ExadataInfraDataSource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +data "azurerm_oracle_exadata_infrastructure" "test" { + name = azurerm_oracle_exadata_infrastructure.test.name + resource_group_name = azurerm_oracle_exadata_infrastructure.test.resource_group_name +} +`, ExadataInfraResource{}.basic(data)) +} diff --git a/internal/services/oracledatabase/exadata_infrastructure_resource.go b/internal/services/oracledatabase/exadata_infrastructure_resource.go new file mode 100644 index 000000000000..861d018e11a3 --- /dev/null +++ b/internal/services/oracledatabase/exadata_infrastructure_resource.go @@ -0,0 +1,374 @@ +// Copyright © 2024, Oracle and/or its affiliates. All rights reserved + +package oracledatabase + +import ( + "context" + "fmt" + "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/tags" + "github.com/hashicorp/go-azure-helpers/resourcemanager/zones" + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/oracledatabase/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +var _ sdk.Resource = ExadataInfraResource{} + +type ExadataInfraResource struct{} + +type ExadataInfraResourceModel struct { + // Azure + Location string `tfschema:"location"` + Name string `tfschema:"name"` + ResourceGroupName string `tfschema:"resource_group_name"` + Tags map[string]interface{} `tfschema:"tags"` + Zones zones.Schema `tfschema:"zones"` + + // Required + ComputeCount int64 `tfschema:"compute_count"` + DisplayName string `tfschema:"display_name"` + Shape string `tfschema:"shape"` + StorageCount int64 `tfschema:"storage_count"` + + // Optional + CustomerContacts []string `tfschema:"customer_contacts"` + MaintenanceWindow []MaintenanceWindowModel `tfschema:"maintenance_window"` +} + +func (ExadataInfraResource) Arguments() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{ + // Azure + "location": commonschema.Location(), + + "name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "resource_group_name": commonschema.ResourceGroupName(), + + // Required + "compute_count": { + Type: pluginsdk.TypeInt, + Required: true, + ValidateFunc: validate.ComputeCount, + }, + + "display_name": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "shape": { + Type: pluginsdk.TypeString, + Required: true, + }, + + "storage_count": { + Type: pluginsdk.TypeInt, + Required: true, + ValidateFunc: validate.StorageCount, + }, + + // Optional + "customer_contacts": { + Type: pluginsdk.TypeList, + Optional: true, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "maintenance_window": { + Type: pluginsdk.TypeList, + Optional: true, + Computed: true, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "days_of_week": { + Type: pluginsdk.TypeList, + Optional: true, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + ValidateFunc: validate.DaysOfWeek, + }, + }, + + "hours_of_day": { + Type: pluginsdk.TypeList, + Optional: true, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeInt, + ValidateFunc: validate.HoursOfDay, + }, + }, + + "lead_time_in_weeks": { + Type: pluginsdk.TypeInt, + Optional: true, + Computed: true, + ValidateFunc: validate.LeadTimeInWeeks, + }, + + "months": { + Type: pluginsdk.TypeList, + Optional: true, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + ValidateFunc: validate.Month, + }, + }, + + "patching_mode": { + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validate.PatchingMode, + }, + + "preference": { + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validate.Preference, + }, + + "weeks_of_month": { + Type: pluginsdk.TypeList, + Optional: true, + Computed: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeInt, + ValidateFunc: validate.WeeksOfMonth, + }, + }, + }, + }, + }, + + "tags": commonschema.Tags(), + + "zones": commonschema.ZonesMultipleRequired(), + } +} + +func (ExadataInfraResource) Attributes() map[string]*pluginsdk.Schema { + return map[string]*pluginsdk.Schema{} +} + +func (ExadataInfraResource) ModelObject() interface{} { + return &ExadataInfraResource{} +} + +func (ExadataInfraResource) ResourceType() string { + return "azurerm_oracle_exadata_infrastructure" +} + +func (r ExadataInfraResource) Create() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 120 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.OracleDatabase.OracleDatabaseClient.CloudExadataInfrastructures + subscriptionId := metadata.Client.Account.SubscriptionId + + var model ExadataInfraResourceModel + if err := metadata.Decode(&model); err != nil { + return err + } + + id := cloudexadatainfrastructures.NewCloudExadataInfrastructureID(subscriptionId, + model.ResourceGroupName, + model.Name) + + existing, err := client.Get(ctx, id) + if err != nil && !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) + } + + param := cloudexadatainfrastructures.CloudExadataInfrastructure{ + Name: pointer.To(model.Name), + Location: model.Location, + Tags: tags.Expand(model.Tags), + Zones: model.Zones, + Properties: &cloudexadatainfrastructures.CloudExadataInfrastructureProperties{ + ComputeCount: pointer.To(model.ComputeCount), + DisplayName: model.DisplayName, + StorageCount: pointer.To(model.StorageCount), + Shape: model.Shape, + CustomerContacts: pointer.To(ExpandCustomerContacts(model.CustomerContacts)), + }, + } + + if len(model.MaintenanceWindow) > 0 { + param.Properties.MaintenanceWindow = &cloudexadatainfrastructures.MaintenanceWindow{ + DaysOfWeek: pointer.To(ExpandDayOfWeekTo(model.MaintenanceWindow[0].DaysOfWeek)), + HoursOfDay: pointer.To(model.MaintenanceWindow[0].HoursOfDay), + LeadTimeInWeeks: pointer.To(model.MaintenanceWindow[0].LeadTimeInWeeks), + Months: pointer.To(ExpandMonths(model.MaintenanceWindow[0].Months)), + PatchingMode: pointer.To(cloudexadatainfrastructures.PatchingMode(model.MaintenanceWindow[0].PatchingMode)), + Preference: pointer.To(cloudexadatainfrastructures.Preference(model.MaintenanceWindow[0].Preference)), + WeeksOfMonth: pointer.To(model.MaintenanceWindow[0].WeeksOfMonth), + } + } + + if err := client.CreateOrUpdateThenPoll(ctx, id, param); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + + metadata.SetID(id) + return nil + }, + } +} + +func (r ExadataInfraResource) Update() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + + client := metadata.Client.OracleDatabase.OracleDatabaseClient.CloudExadataInfrastructures + id, err := cloudexadatainfrastructures.ParseCloudExadataInfrastructureID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + var model ExadataInfraResourceModel + if err = metadata.Decode(&model); err != nil { + return fmt.Errorf("decoding err: %+v", err) + } + + existing, err := client.Get(ctx, *id) + if err != nil { + return fmt.Errorf("retrieving exists when updating: +%v", *id) + } + if existing.Model == nil && existing.Model.Properties == nil { + return fmt.Errorf("retrieving as nil when updating for %v", *id) + } + + if metadata.ResourceData.HasChangesExcept("tags") { + return fmt.Errorf("only `tags` currently support updates") + } + + if metadata.ResourceData.HasChange("tags") { + update := &cloudexadatainfrastructures.CloudExadataInfrastructureUpdate{ + Tags: tags.Expand(model.Tags), + } + err = client.UpdateThenPoll(ctx, *id, *update) + if err != nil { + return fmt.Errorf("updating %s: %v", id, err) + } + } + return nil + }, + } +} + +func (ExadataInfraResource) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + id, err := cloudexadatainfrastructures.ParseCloudExadataInfrastructureID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + client := metadata.Client.OracleDatabase.OracleDatabaseClient.CloudExadataInfrastructures + result, err := client.Get(ctx, *id) + if err != nil { + if response.WasNotFound(result.HttpResponse) { + return metadata.MarkAsGone(id) + } + return err + } + + if result.Model == nil { + return fmt.Errorf("retrieving %s got nil model", id) + } + + prop := result.Model.Properties + output := ExadataInfraResourceModel{ + CustomerContacts: FlattenCustomerContacts(result.Model.Properties.CustomerContacts), + Name: pointer.ToString(result.Model.Name), + Location: result.Model.Location, + Zones: result.Model.Zones, + ResourceGroupName: id.ResourceGroupName, + Tags: utils.FlattenPtrMapStringString(result.Model.Tags), + ComputeCount: pointer.From(prop.ComputeCount), + DisplayName: prop.DisplayName, + StorageCount: pointer.From(prop.StorageCount), + Shape: prop.Shape, + MaintenanceWindow: FlattenMaintenanceWindow(prop.MaintenanceWindow), + } + + return metadata.Encode(&output) + }, + } +} + +func (ExadataInfraResource) Delete() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 60 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.OracleDatabase.OracleDatabaseClient.CloudExadataInfrastructures + + id, err := cloudexadatainfrastructures.ParseCloudExadataInfrastructureID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + if err = client.DeleteThenPoll(ctx, *id); err != nil { + return fmt.Errorf("deleting %s: %+v", *id, err) + } + + return nil + }, + } +} + +func (ExadataInfraResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { + return cloudexadatainfrastructures.ValidateCloudExadataInfrastructureID +} + +func ExpandCustomerContacts(customerContactsList []string) []cloudexadatainfrastructures.CustomerContact { + var customerContacts []cloudexadatainfrastructures.CustomerContact + for _, customerContact := range customerContactsList { + customerContacts = append(customerContacts, cloudexadatainfrastructures.CustomerContact{ + Email: customerContact, + }) + } + return customerContacts +} + +func ExpandDayOfWeekTo(daysOfWeek []string) []cloudexadatainfrastructures.DayOfWeek { + var daysOfWeekConverted []cloudexadatainfrastructures.DayOfWeek + for _, day := range daysOfWeek { + daysOfWeekConverted = append(daysOfWeekConverted, cloudexadatainfrastructures.DayOfWeek{ + Name: cloudexadatainfrastructures.DayOfWeekName(day), + }) + } + return daysOfWeekConverted +} + +func ExpandMonths(months []string) []cloudexadatainfrastructures.Month { + var monthsConverted []cloudexadatainfrastructures.Month + for _, month := range months { + monthsConverted = append(monthsConverted, cloudexadatainfrastructures.Month{ + Name: cloudexadatainfrastructures.MonthName(month), + }) + } + return monthsConverted +} diff --git a/internal/services/oracledatabase/exadata_infrastructure_resource_test.go b/internal/services/oracledatabase/exadata_infrastructure_resource_test.go new file mode 100644 index 000000000000..3c195b54bc86 --- /dev/null +++ b/internal/services/oracledatabase/exadata_infrastructure_resource_test.go @@ -0,0 +1,211 @@ +// Copyright © 2024, Oracle and/or its affiliates. All rights reserved + +package oracledatabase_test + +import ( + "context" + "fmt" + "testing" + + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/oracledatabase" + + "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" + "github.com/hashicorp/terraform-provider-azurerm/utils" +) + +type ExadataInfraResource struct{} + +func (a ExadataInfraResource) Exists(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { + id, err := cloudexadatainfrastructures.ParseCloudExadataInfrastructureID(state.ID) + if err != nil { + return nil, err + } + resp, err := client.OracleDatabase.OracleDatabaseClient.CloudExadataInfrastructures.Get(ctx, *id) + if err != nil { + return nil, fmt.Errorf("retrieving Exadata Infrastructure %s: %+v", id, err) + } + return utils.Bool(resp.Model != nil), nil +} + +func (a ExadataInfraResource) Destroy(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { + id, err := cloudexadatainfrastructures.ParseCloudExadataInfrastructureID(state.ID) + if err != nil { + return nil, err + } + if _, err := client.OracleDatabase.OracleDatabaseClient.CloudExadataInfrastructures.Delete(ctx, *id); err != nil { + return nil, fmt.Errorf("deleting Exadata Infrastructure %s: %+v", id, err) + } + return utils.Bool(true), nil +} + +func TestExaInfra_basic(t *testing.T) { + data := acceptance.BuildTestData(t, oracledatabase.ExadataInfraResource{}.ResourceType(), "test") + r := ExadataInfraResource{} + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestExaInfra_allFields(t *testing.T) { + data := acceptance.BuildTestData(t, oracledatabase.ExadataInfraResource{}.ResourceType(), "test") + r := ExadataInfraResource{} + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.allFields(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestExaInfra_requiresImport(t *testing.T) { + data := acceptance.BuildTestData(t, oracledatabase.ExadataInfraResource{}.ResourceType(), "test") + r := ExadataInfraResource{} + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.RequiresImportErrorStep(r.requiresImport), + }) +} + +func TestExaInfra_update(t *testing.T) { + data := acceptance.BuildTestData(t, oracledatabase.ExadataInfraResource{}.ResourceType(), "test") + r := ExadataInfraResource{} + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.update(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func (a ExadataInfraResource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_oracle_exadata_infrastructure" "test" { + name = "OFakeacctest%[2]d" + location = "%[3]s" + resource_group_name = azurerm_resource_group.test.name + compute_count = "2" + display_name = "OFakeacctest%[2]d" + shape = "Exadata.X9M" + storage_count = "3" + zones = ["3"] +} +`, a.template(data), data.RandomInteger, data.Locations.Primary) +} + +func (a ExadataInfraResource) allFields(data acceptance.TestData) string { + return fmt.Sprintf(` + + +%s + +resource "azurerm_oracle_exadata_infrastructure" "test" { + name = "OFakeacctest%[2]d" + location = "%[3]s" + resource_group_name = azurerm_resource_group.test.name + compute_count = "2" + display_name = "OFakeacctest%[2]d" + shape = "Exadata.X9M" + storage_count = "3" + zones = ["3"] + customer_contacts = ["test@test.com"] + + maintenance_window { + days_of_week = ["Monday"] + hours_of_day = [4] + months = ["January"] + weeks_of_month = [2] + lead_time_in_weeks = 1 + patching_mode = "Rolling" + preference = "NoPreference" + } + + tags = { + test = "testTag1" + } +} +`, a.template(data), data.RandomInteger, data.Locations.Primary) +} + +func (a ExadataInfraResource) update(data acceptance.TestData) string { + return fmt.Sprintf(` + + +%s + +resource "azurerm_oracle_exadata_infrastructure" "test" { + name = "OFakeacctest%[2]d" + location = "%[3]s" + resource_group_name = azurerm_resource_group.test.name + compute_count = "2" + display_name = "OFakeacctest%[2]d" + shape = "Exadata.X9M" + storage_count = "3" + zones = ["3"] + tags = { + test = "testTag1" + } +} +`, a.template(data), data.RandomInteger, data.Locations.Primary) +} + +func (a ExadataInfraResource) requiresImport(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_oracle_exadata_infrastructure" "import" { + name = azurerm_oracle_exadata_infrastructure.test.name + location = azurerm_oracle_exadata_infrastructure.test.location + resource_group_name = azurerm_oracle_exadata_infrastructure.test.resource_group_name + compute_count = azurerm_oracle_exadata_infrastructure.test.compute_count + display_name = azurerm_oracle_exadata_infrastructure.test.display_name + shape = azurerm_oracle_exadata_infrastructure.test.shape + storage_count = azurerm_oracle_exadata_infrastructure.test.storage_count + zones = azurerm_oracle_exadata_infrastructure.test.zones +} +`, a.basic(data)) +} + +func (a ExadataInfraResource) template(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +data "azurerm_client_config" "current" {} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} +`, data.RandomInteger, data.Locations.Primary, data.RandomString) +} diff --git a/internal/services/oracledatabase/registration.go b/internal/services/oracledatabase/registration.go new file mode 100644 index 000000000000..9fd0cf33ba27 --- /dev/null +++ b/internal/services/oracledatabase/registration.go @@ -0,0 +1,37 @@ +// Copyright © 2024, Oracle and/or its affiliates. All rights reserved + +package oracledatabase + +import ( + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" +) + +type Registration struct{} + +var ( + _ sdk.TypedServiceRegistration = Registration{} +) + +func (r Registration) DataSources() []sdk.DataSource { + return []sdk.DataSource{ + ExadataInfraDataSource{}, + } +} + +func (r Registration) Resources() []sdk.Resource { + return []sdk.Resource{ + ExadataInfraResource{}, + } +} + +// Name is the name of this Service +func (r Registration) Name() string { + return "Oracle Database" +} + +// WebsiteCategories returns a list of categories which can be used for the sidebar +func (r Registration) WebsiteCategories() []string { + return []string{ + "Oracle Database", + } +} diff --git a/internal/services/oracledatabase/validate/exadata_infrastructure.go b/internal/services/oracledatabase/validate/exadata_infrastructure.go new file mode 100644 index 000000000000..977a43a050ed --- /dev/null +++ b/internal/services/oracledatabase/validate/exadata_infrastructure.go @@ -0,0 +1,156 @@ +package validate + +import ( + "fmt" + "slices" + + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures" +) + +func ComputeCount(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(int) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be int", k)) + return + } + + if v < 2 || v > 32 { + errors = append(errors, fmt.Errorf("the compute count must be between %d and %d", 2, 32)) + return + } + + return +} + +func StorageCount(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(int) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be int", k)) + return + } + + if v < 3 || v > 64 { + errors = append(errors, fmt.Errorf("the storage count must be between %d and %d", 3, 64)) + return + } + + return +} + +// MaintenanceWindow validation + +func DaysOfWeek(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be string", k)) + return + } + + validDaysOfWeek := []string{"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"} + + if !slices.Contains(validDaysOfWeek, v) { + errors = append(errors, fmt.Errorf("days of week must be %v", validDaysOfWeek)) + return + } + + return +} + +func HoursOfDay(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(int) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be int", k)) + return + } + + hoursOfDayValidationMsg := "valid hours of day are: 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time" + + "slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot" + + "12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot" + + "20:00 - 23:59 UTC" + + if (v < 0 || v > 20) || (v%4 != 0) { + errors = append(errors, fmt.Errorf("%s", hoursOfDayValidationMsg)) + return + } + + return +} + +func LeadTimeInWeeks(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(int) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be int", k)) + return + } + + if v < 1 || v > 4 { + errors = append(errors, fmt.Errorf("the lead time in weeks must be between %d and %d", 1, 4)) + return + } + + return +} + +func Month(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be string", k)) + return + } + + validMonth := []string{"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} + + if !slices.Contains(validMonth, v) { + errors = append(errors, fmt.Errorf("month must be %v", validMonth)) + return + } + + return +} + +func WeeksOfMonth(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(int) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be int", k)) + return + } + + if v < 1 || v > 4 { + errors = append(errors, fmt.Errorf("weeksOfMonth should be a list of integers between %d and %d (inclusive)", 1, 4)) + return + } + + return +} + +func Preference(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be list of strings", k)) + return + } + + if v != string(cloudexadatainfrastructures.PreferenceCustomPreference) && v != string(cloudexadatainfrastructures.PreferenceNoPreference) { + errors = append(errors, fmt.Errorf("%v must be %v or %v", k, + string(cloudexadatainfrastructures.PreferenceCustomPreference), string(cloudexadatainfrastructures.PreferenceNoPreference))) + return + } + + return +} + +func PatchingMode(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be list of strings", k)) + return + } + + if v != string(cloudexadatainfrastructures.PatchingModeRolling) && v != string(cloudexadatainfrastructures.PatchingModeNonRolling) { + errors = append(errors, fmt.Errorf("%v must be %v or %v", k, + string(cloudexadatainfrastructures.PatchingModeRolling), string(cloudexadatainfrastructures.PatchingModeNonRolling))) + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/README.md new file mode 100644 index 000000000000..16a4e1543622 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/README.md @@ -0,0 +1,99 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups` Documentation + +The `autonomousdatabasebackups` SDK allows for interaction with Azure Resource Manager `oracledatabase` (API Version `2024-06-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-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups" +``` + + +### Client Initialization + +```go +client := autonomousdatabasebackups.NewAutonomousDatabaseBackupsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `AutonomousDatabaseBackupsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := autonomousdatabasebackups.NewAutonomousDatabaseBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName", "autonomousDatabaseBackupName") + +payload := autonomousdatabasebackups.AutonomousDatabaseBackup{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `AutonomousDatabaseBackupsClient.Delete` + +```go +ctx := context.TODO() +id := autonomousdatabasebackups.NewAutonomousDatabaseBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName", "autonomousDatabaseBackupName") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `AutonomousDatabaseBackupsClient.Get` + +```go +ctx := context.TODO() +id := autonomousdatabasebackups.NewAutonomousDatabaseBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName", "autonomousDatabaseBackupName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AutonomousDatabaseBackupsClient.ListByAutonomousDatabase` + +```go +ctx := context.TODO() +id := autonomousdatabasebackups.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") + +// alternatively `client.ListByAutonomousDatabase(ctx, id)` can be used to do batched pagination +items, err := client.ListByAutonomousDatabaseComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `AutonomousDatabaseBackupsClient.Update` + +```go +ctx := context.TODO() +id := autonomousdatabasebackups.NewAutonomousDatabaseBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName", "autonomousDatabaseBackupName") + +payload := autonomousdatabasebackups.AutonomousDatabaseBackupUpdate{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/client.go new file mode 100644 index 000000000000..4ed283296668 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/client.go @@ -0,0 +1,26 @@ +package autonomousdatabasebackups + +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 AutonomousDatabaseBackupsClient struct { + Client *resourcemanager.Client +} + +func NewAutonomousDatabaseBackupsClientWithBaseURI(sdkApi sdkEnv.Api) (*AutonomousDatabaseBackupsClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "autonomousdatabasebackups", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating AutonomousDatabaseBackupsClient: %+v", err) + } + + return &AutonomousDatabaseBackupsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/constants.go new file mode 100644 index 000000000000..95360d30614a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/constants.go @@ -0,0 +1,151 @@ +package autonomousdatabasebackups + +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 AutonomousDatabaseBackupLifecycleState string + +const ( + AutonomousDatabaseBackupLifecycleStateActive AutonomousDatabaseBackupLifecycleState = "Active" + AutonomousDatabaseBackupLifecycleStateCreating AutonomousDatabaseBackupLifecycleState = "Creating" + AutonomousDatabaseBackupLifecycleStateDeleting AutonomousDatabaseBackupLifecycleState = "Deleting" + AutonomousDatabaseBackupLifecycleStateFailed AutonomousDatabaseBackupLifecycleState = "Failed" + AutonomousDatabaseBackupLifecycleStateUpdating AutonomousDatabaseBackupLifecycleState = "Updating" +) + +func PossibleValuesForAutonomousDatabaseBackupLifecycleState() []string { + return []string{ + string(AutonomousDatabaseBackupLifecycleStateActive), + string(AutonomousDatabaseBackupLifecycleStateCreating), + string(AutonomousDatabaseBackupLifecycleStateDeleting), + string(AutonomousDatabaseBackupLifecycleStateFailed), + string(AutonomousDatabaseBackupLifecycleStateUpdating), + } +} + +func (s *AutonomousDatabaseBackupLifecycleState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAutonomousDatabaseBackupLifecycleState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAutonomousDatabaseBackupLifecycleState(input string) (*AutonomousDatabaseBackupLifecycleState, error) { + vals := map[string]AutonomousDatabaseBackupLifecycleState{ + "active": AutonomousDatabaseBackupLifecycleStateActive, + "creating": AutonomousDatabaseBackupLifecycleStateCreating, + "deleting": AutonomousDatabaseBackupLifecycleStateDeleting, + "failed": AutonomousDatabaseBackupLifecycleStateFailed, + "updating": AutonomousDatabaseBackupLifecycleStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AutonomousDatabaseBackupLifecycleState(input) + return &out, nil +} + +type AutonomousDatabaseBackupType string + +const ( + AutonomousDatabaseBackupTypeFull AutonomousDatabaseBackupType = "Full" + AutonomousDatabaseBackupTypeIncremental AutonomousDatabaseBackupType = "Incremental" + AutonomousDatabaseBackupTypeLongTerm AutonomousDatabaseBackupType = "LongTerm" +) + +func PossibleValuesForAutonomousDatabaseBackupType() []string { + return []string{ + string(AutonomousDatabaseBackupTypeFull), + string(AutonomousDatabaseBackupTypeIncremental), + string(AutonomousDatabaseBackupTypeLongTerm), + } +} + +func (s *AutonomousDatabaseBackupType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAutonomousDatabaseBackupType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAutonomousDatabaseBackupType(input string) (*AutonomousDatabaseBackupType, error) { + vals := map[string]AutonomousDatabaseBackupType{ + "full": AutonomousDatabaseBackupTypeFull, + "incremental": AutonomousDatabaseBackupTypeIncremental, + "longterm": AutonomousDatabaseBackupTypeLongTerm, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AutonomousDatabaseBackupType(input) + return &out, nil +} + +type AzureResourceProvisioningState string + +const ( + AzureResourceProvisioningStateCanceled AzureResourceProvisioningState = "Canceled" + AzureResourceProvisioningStateFailed AzureResourceProvisioningState = "Failed" + AzureResourceProvisioningStateProvisioning AzureResourceProvisioningState = "Provisioning" + AzureResourceProvisioningStateSucceeded AzureResourceProvisioningState = "Succeeded" +) + +func PossibleValuesForAzureResourceProvisioningState() []string { + return []string{ + string(AzureResourceProvisioningStateCanceled), + string(AzureResourceProvisioningStateFailed), + string(AzureResourceProvisioningStateProvisioning), + string(AzureResourceProvisioningStateSucceeded), + } +} + +func (s *AzureResourceProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureResourceProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureResourceProvisioningState(input string) (*AzureResourceProvisioningState, error) { + vals := map[string]AzureResourceProvisioningState{ + "canceled": AzureResourceProvisioningStateCanceled, + "failed": AzureResourceProvisioningStateFailed, + "provisioning": AzureResourceProvisioningStateProvisioning, + "succeeded": AzureResourceProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureResourceProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabase.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabase.go new file mode 100644 index 000000000000..116d0282b399 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabase.go @@ -0,0 +1,130 @@ +package autonomousdatabasebackups + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&AutonomousDatabaseId{}) +} + +var _ resourceids.ResourceId = &AutonomousDatabaseId{} + +// AutonomousDatabaseId is a struct representing the Resource ID for a Autonomous Database +type AutonomousDatabaseId struct { + SubscriptionId string + ResourceGroupName string + AutonomousDatabaseName string +} + +// NewAutonomousDatabaseID returns a new AutonomousDatabaseId struct +func NewAutonomousDatabaseID(subscriptionId string, resourceGroupName string, autonomousDatabaseName string) AutonomousDatabaseId { + return AutonomousDatabaseId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutonomousDatabaseName: autonomousDatabaseName, + } +} + +// ParseAutonomousDatabaseID parses 'input' into a AutonomousDatabaseId +func ParseAutonomousDatabaseID(input string) (*AutonomousDatabaseId, error) { + parser := resourceids.NewParserFromResourceIdType(&AutonomousDatabaseId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AutonomousDatabaseId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseAutonomousDatabaseIDInsensitively parses 'input' case-insensitively into a AutonomousDatabaseId +// note: this method should only be used for API response data and not user input +func ParseAutonomousDatabaseIDInsensitively(input string) (*AutonomousDatabaseId, error) { + parser := resourceids.NewParserFromResourceIdType(&AutonomousDatabaseId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AutonomousDatabaseId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *AutonomousDatabaseId) 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.AutonomousDatabaseName, ok = input.Parsed["autonomousDatabaseName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "autonomousDatabaseName", input) + } + + return nil +} + +// ValidateAutonomousDatabaseID checks that 'input' can be parsed as a Autonomous Database ID +func ValidateAutonomousDatabaseID(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 := ParseAutonomousDatabaseID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Autonomous Database ID +func (id AutonomousDatabaseId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Oracle.Database/autonomousDatabases/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutonomousDatabaseName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Autonomous Database ID +func (id AutonomousDatabaseId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticAutonomousDatabases", "autonomousDatabases", "autonomousDatabases"), + resourceids.UserSpecifiedSegment("autonomousDatabaseName", "autonomousDatabaseName"), + } +} + +// String returns a human-readable description of this Autonomous Database ID +func (id AutonomousDatabaseId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Autonomous Database Name: %q", id.AutonomousDatabaseName), + } + return fmt.Sprintf("Autonomous Database (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabasebackup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabasebackup.go new file mode 100644 index 000000000000..01f5c286121c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/id_autonomousdatabasebackup.go @@ -0,0 +1,139 @@ +package autonomousdatabasebackups + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&AutonomousDatabaseBackupId{}) +} + +var _ resourceids.ResourceId = &AutonomousDatabaseBackupId{} + +// AutonomousDatabaseBackupId is a struct representing the Resource ID for a Autonomous Database Backup +type AutonomousDatabaseBackupId struct { + SubscriptionId string + ResourceGroupName string + AutonomousDatabaseName string + AutonomousDatabaseBackupName string +} + +// NewAutonomousDatabaseBackupID returns a new AutonomousDatabaseBackupId struct +func NewAutonomousDatabaseBackupID(subscriptionId string, resourceGroupName string, autonomousDatabaseName string, autonomousDatabaseBackupName string) AutonomousDatabaseBackupId { + return AutonomousDatabaseBackupId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutonomousDatabaseName: autonomousDatabaseName, + AutonomousDatabaseBackupName: autonomousDatabaseBackupName, + } +} + +// ParseAutonomousDatabaseBackupID parses 'input' into a AutonomousDatabaseBackupId +func ParseAutonomousDatabaseBackupID(input string) (*AutonomousDatabaseBackupId, error) { + parser := resourceids.NewParserFromResourceIdType(&AutonomousDatabaseBackupId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AutonomousDatabaseBackupId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseAutonomousDatabaseBackupIDInsensitively parses 'input' case-insensitively into a AutonomousDatabaseBackupId +// note: this method should only be used for API response data and not user input +func ParseAutonomousDatabaseBackupIDInsensitively(input string) (*AutonomousDatabaseBackupId, error) { + parser := resourceids.NewParserFromResourceIdType(&AutonomousDatabaseBackupId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AutonomousDatabaseBackupId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *AutonomousDatabaseBackupId) 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.AutonomousDatabaseName, ok = input.Parsed["autonomousDatabaseName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "autonomousDatabaseName", input) + } + + if id.AutonomousDatabaseBackupName, ok = input.Parsed["autonomousDatabaseBackupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "autonomousDatabaseBackupName", input) + } + + return nil +} + +// ValidateAutonomousDatabaseBackupID checks that 'input' can be parsed as a Autonomous Database Backup ID +func ValidateAutonomousDatabaseBackupID(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 := ParseAutonomousDatabaseBackupID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Autonomous Database Backup ID +func (id AutonomousDatabaseBackupId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Oracle.Database/autonomousDatabases/%s/autonomousDatabaseBackups/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutonomousDatabaseName, id.AutonomousDatabaseBackupName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Autonomous Database Backup ID +func (id AutonomousDatabaseBackupId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticAutonomousDatabases", "autonomousDatabases", "autonomousDatabases"), + resourceids.UserSpecifiedSegment("autonomousDatabaseName", "autonomousDatabaseName"), + resourceids.StaticSegment("staticAutonomousDatabaseBackups", "autonomousDatabaseBackups", "autonomousDatabaseBackups"), + resourceids.UserSpecifiedSegment("autonomousDatabaseBackupName", "autonomousDatabaseBackupName"), + } +} + +// String returns a human-readable description of this Autonomous Database Backup ID +func (id AutonomousDatabaseBackupId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Autonomous Database Name: %q", id.AutonomousDatabaseName), + fmt.Sprintf("Autonomous Database Backup Name: %q", id.AutonomousDatabaseBackupName), + } + return fmt.Sprintf("Autonomous Database Backup (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_createorupdate.go new file mode 100644 index 000000000000..81b5ea2dbcec --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_createorupdate.go @@ -0,0 +1,75 @@ +package autonomousdatabasebackups + +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 CreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *AutonomousDatabaseBackup +} + +// CreateOrUpdate ... +func (c AutonomousDatabaseBackupsClient) CreateOrUpdate(ctx context.Context, id AutonomousDatabaseBackupId, input AutonomousDatabaseBackup) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + 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 +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c AutonomousDatabaseBackupsClient) CreateOrUpdateThenPoll(ctx context.Context, id AutonomousDatabaseBackupId, input AutonomousDatabaseBackup) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_delete.go new file mode 100644 index 000000000000..4af10c5bf28f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_delete.go @@ -0,0 +1,70 @@ +package autonomousdatabasebackups + +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 DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c AutonomousDatabaseBackupsClient) Delete(ctx context.Context, id AutonomousDatabaseBackupId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + 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 +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c AutonomousDatabaseBackupsClient) DeleteThenPoll(ctx context.Context, id AutonomousDatabaseBackupId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_get.go new file mode 100644 index 000000000000..57459c26d220 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_get.go @@ -0,0 +1,53 @@ +package autonomousdatabasebackups + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *AutonomousDatabaseBackup +} + +// Get ... +func (c AutonomousDatabaseBackupsClient) Get(ctx context.Context, id AutonomousDatabaseBackupId) (result GetOperationResponse, 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 AutonomousDatabaseBackup + 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/oracledatabase/2024-06-01/autonomousdatabasebackups/method_listbyautonomousdatabase.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_listbyautonomousdatabase.go new file mode 100644 index 000000000000..38df32dfe02c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_listbyautonomousdatabase.go @@ -0,0 +1,105 @@ +package autonomousdatabasebackups + +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 ListByAutonomousDatabaseOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]AutonomousDatabaseBackup +} + +type ListByAutonomousDatabaseCompleteResult struct { + LatestHttpResponse *http.Response + Items []AutonomousDatabaseBackup +} + +type ListByAutonomousDatabaseCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByAutonomousDatabaseCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByAutonomousDatabase ... +func (c AutonomousDatabaseBackupsClient) ListByAutonomousDatabase(ctx context.Context, id AutonomousDatabaseId) (result ListByAutonomousDatabaseOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByAutonomousDatabaseCustomPager{}, + Path: fmt.Sprintf("%s/autonomousDatabaseBackups", 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 *[]AutonomousDatabaseBackup `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByAutonomousDatabaseComplete retrieves all the results into a single object +func (c AutonomousDatabaseBackupsClient) ListByAutonomousDatabaseComplete(ctx context.Context, id AutonomousDatabaseId) (ListByAutonomousDatabaseCompleteResult, error) { + return c.ListByAutonomousDatabaseCompleteMatchingPredicate(ctx, id, AutonomousDatabaseBackupOperationPredicate{}) +} + +// ListByAutonomousDatabaseCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c AutonomousDatabaseBackupsClient) ListByAutonomousDatabaseCompleteMatchingPredicate(ctx context.Context, id AutonomousDatabaseId, predicate AutonomousDatabaseBackupOperationPredicate) (result ListByAutonomousDatabaseCompleteResult, err error) { + items := make([]AutonomousDatabaseBackup, 0) + + resp, err := c.ListByAutonomousDatabase(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListByAutonomousDatabaseCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_update.go new file mode 100644 index 000000000000..e769ca8bab97 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_update.go @@ -0,0 +1,75 @@ +package autonomousdatabasebackups + +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 UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *AutonomousDatabaseBackup +} + +// Update ... +func (c AutonomousDatabaseBackupsClient) Update(ctx context.Context, id AutonomousDatabaseBackupId, input AutonomousDatabaseBackupUpdate) (result UpdateOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c AutonomousDatabaseBackupsClient) UpdateThenPoll(ctx context.Context, id AutonomousDatabaseBackupId, input AutonomousDatabaseBackupUpdate) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackup.go new file mode 100644 index 000000000000..d58ba310e225 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackup.go @@ -0,0 +1,16 @@ +package autonomousdatabasebackups + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDatabaseBackup struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *AutonomousDatabaseBackupProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackupproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackupproperties.go new file mode 100644 index 000000000000..bb592faa99a7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackupproperties.go @@ -0,0 +1,41 @@ +package autonomousdatabasebackups + +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 AutonomousDatabaseBackupProperties struct { + AutonomousDatabaseOcid *string `json:"autonomousDatabaseOcid,omitempty"` + BackupType *AutonomousDatabaseBackupType `json:"backupType,omitempty"` + DatabaseSizeInTbs *float64 `json:"databaseSizeInTbs,omitempty"` + DbVersion *string `json:"dbVersion,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + IsAutomatic *bool `json:"isAutomatic,omitempty"` + IsRestorable *bool `json:"isRestorable,omitempty"` + LifecycleDetails *string `json:"lifecycleDetails,omitempty"` + LifecycleState *AutonomousDatabaseBackupLifecycleState `json:"lifecycleState,omitempty"` + Ocid *string `json:"ocid,omitempty"` + ProvisioningState *AzureResourceProvisioningState `json:"provisioningState,omitempty"` + RetentionPeriodInDays *int64 `json:"retentionPeriodInDays,omitempty"` + SizeInTbs *float64 `json:"sizeInTbs,omitempty"` + TimeAvailableTil *string `json:"timeAvailableTil,omitempty"` + TimeEnded *string `json:"timeEnded,omitempty"` + TimeStarted *string `json:"timeStarted,omitempty"` +} + +func (o *AutonomousDatabaseBackupProperties) GetTimeAvailableTilAsTime() (*time.Time, error) { + if o.TimeAvailableTil == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeAvailableTil, "2006-01-02T15:04:05Z07:00") +} + +func (o *AutonomousDatabaseBackupProperties) SetTimeAvailableTilAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeAvailableTil = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackupupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackupupdate.go new file mode 100644 index 000000000000..4ccab72b0dc0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackupupdate.go @@ -0,0 +1,8 @@ +package autonomousdatabasebackups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDatabaseBackupUpdate struct { + Properties *AutonomousDatabaseBackupUpdateProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackupupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackupupdateproperties.go new file mode 100644 index 000000000000..cebcbe7eb157 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackupupdateproperties.go @@ -0,0 +1,8 @@ +package autonomousdatabasebackups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDatabaseBackupUpdateProperties struct { + RetentionPeriodInDays *int64 `json:"retentionPeriodInDays,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/predicates.go new file mode 100644 index 000000000000..ba62aa1ff05f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/predicates.go @@ -0,0 +1,27 @@ +package autonomousdatabasebackups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDatabaseBackupOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p AutonomousDatabaseBackupOperationPredicate) Matches(input AutonomousDatabaseBackup) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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/oracledatabase/2024-06-01/autonomousdatabasebackups/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/version.go new file mode 100644 index 000000000000..461a301d8085 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/version.go @@ -0,0 +1,10 @@ +package autonomousdatabasebackups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-06-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/autonomousdatabasebackups/2024-06-01" +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/README.md new file mode 100644 index 000000000000..8f83dcdc1752 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets` Documentation + +The `autonomousdatabasecharactersets` SDK allows for interaction with Azure Resource Manager `oracledatabase` (API Version `2024-06-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-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets" +``` + + +### Client Initialization + +```go +client := autonomousdatabasecharactersets.NewAutonomousDatabaseCharacterSetsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `AutonomousDatabaseCharacterSetsClient.Get` + +```go +ctx := context.TODO() +id := autonomousdatabasecharactersets.NewAutonomousDatabaseCharacterSetID("12345678-1234-9876-4563-123456789012", "locationName", "autonomousDatabaseCharacterSetName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AutonomousDatabaseCharacterSetsClient.ListByLocation` + +```go +ctx := context.TODO() +id := autonomousdatabasecharactersets.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") + +// alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination +items, err := client.ListByLocationComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/client.go new file mode 100644 index 000000000000..9ce4a4fa3571 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/client.go @@ -0,0 +1,26 @@ +package autonomousdatabasecharactersets + +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 AutonomousDatabaseCharacterSetsClient struct { + Client *resourcemanager.Client +} + +func NewAutonomousDatabaseCharacterSetsClientWithBaseURI(sdkApi sdkEnv.Api) (*AutonomousDatabaseCharacterSetsClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "autonomousdatabasecharactersets", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating AutonomousDatabaseCharacterSetsClient: %+v", err) + } + + return &AutonomousDatabaseCharacterSetsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_autonomousdatabasecharacterset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_autonomousdatabasecharacterset.go new file mode 100644 index 000000000000..5bd55410b850 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_autonomousdatabasecharacterset.go @@ -0,0 +1,130 @@ +package autonomousdatabasecharactersets + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&AutonomousDatabaseCharacterSetId{}) +} + +var _ resourceids.ResourceId = &AutonomousDatabaseCharacterSetId{} + +// AutonomousDatabaseCharacterSetId is a struct representing the Resource ID for a Autonomous Database Character Set +type AutonomousDatabaseCharacterSetId struct { + SubscriptionId string + LocationName string + AutonomousDatabaseCharacterSetName string +} + +// NewAutonomousDatabaseCharacterSetID returns a new AutonomousDatabaseCharacterSetId struct +func NewAutonomousDatabaseCharacterSetID(subscriptionId string, locationName string, autonomousDatabaseCharacterSetName string) AutonomousDatabaseCharacterSetId { + return AutonomousDatabaseCharacterSetId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + AutonomousDatabaseCharacterSetName: autonomousDatabaseCharacterSetName, + } +} + +// ParseAutonomousDatabaseCharacterSetID parses 'input' into a AutonomousDatabaseCharacterSetId +func ParseAutonomousDatabaseCharacterSetID(input string) (*AutonomousDatabaseCharacterSetId, error) { + parser := resourceids.NewParserFromResourceIdType(&AutonomousDatabaseCharacterSetId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AutonomousDatabaseCharacterSetId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseAutonomousDatabaseCharacterSetIDInsensitively parses 'input' case-insensitively into a AutonomousDatabaseCharacterSetId +// note: this method should only be used for API response data and not user input +func ParseAutonomousDatabaseCharacterSetIDInsensitively(input string) (*AutonomousDatabaseCharacterSetId, error) { + parser := resourceids.NewParserFromResourceIdType(&AutonomousDatabaseCharacterSetId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AutonomousDatabaseCharacterSetId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *AutonomousDatabaseCharacterSetId) 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) + } + + if id.AutonomousDatabaseCharacterSetName, ok = input.Parsed["autonomousDatabaseCharacterSetName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "autonomousDatabaseCharacterSetName", input) + } + + return nil +} + +// ValidateAutonomousDatabaseCharacterSetID checks that 'input' can be parsed as a Autonomous Database Character Set ID +func ValidateAutonomousDatabaseCharacterSetID(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 := ParseAutonomousDatabaseCharacterSetID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Autonomous Database Character Set ID +func (id AutonomousDatabaseCharacterSetId) ID() string { + fmtString := "/subscriptions/%s/providers/Oracle.Database/locations/%s/autonomousDatabaseCharacterSets/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName, id.AutonomousDatabaseCharacterSetName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Autonomous Database Character Set ID +func (id AutonomousDatabaseCharacterSetId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + resourceids.StaticSegment("staticAutonomousDatabaseCharacterSets", "autonomousDatabaseCharacterSets", "autonomousDatabaseCharacterSets"), + resourceids.UserSpecifiedSegment("autonomousDatabaseCharacterSetName", "autonomousDatabaseCharacterSetName"), + } +} + +// String returns a human-readable description of this Autonomous Database Character Set ID +func (id AutonomousDatabaseCharacterSetId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + fmt.Sprintf("Autonomous Database Character Set Name: %q", id.AutonomousDatabaseCharacterSetName), + } + return fmt.Sprintf("Autonomous Database Character Set (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_location.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_location.go new file mode 100644 index 000000000000..1afa483132c8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/id_location.go @@ -0,0 +1,121 @@ +package autonomousdatabasecharactersets + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&LocationId{}) +} + +var _ resourceids.ResourceId = &LocationId{} + +// LocationId is a struct representing the Resource ID for a Location +type LocationId struct { + SubscriptionId string + LocationName string +} + +// NewLocationID returns a new LocationId struct +func NewLocationID(subscriptionId string, locationName string) LocationId { + return LocationId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + } +} + +// ParseLocationID parses 'input' into a LocationId +func ParseLocationID(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseLocationIDInsensitively parses 'input' case-insensitively into a LocationId +// note: this method should only be used for API response data and not user input +func ParseLocationIDInsensitively(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *LocationId) 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 +} + +// ValidateLocationID checks that 'input' can be parsed as a Location ID +func ValidateLocationID(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 := ParseLocationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Location ID +func (id LocationId) ID() string { + fmtString := "/subscriptions/%s/providers/Oracle.Database/locations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Location ID +func (id LocationId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + } +} + +// String returns a human-readable description of this Location ID +func (id LocationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + } + return fmt.Sprintf("Location (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/method_get.go new file mode 100644 index 000000000000..a221ce4e8673 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/method_get.go @@ -0,0 +1,53 @@ +package autonomousdatabasecharactersets + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *AutonomousDatabaseCharacterSet +} + +// Get ... +func (c AutonomousDatabaseCharacterSetsClient) Get(ctx context.Context, id AutonomousDatabaseCharacterSetId) (result GetOperationResponse, 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 AutonomousDatabaseCharacterSet + 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/oracledatabase/2024-06-01/autonomousdatabasecharactersets/method_listbylocation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/method_listbylocation.go new file mode 100644 index 000000000000..fed9644ac135 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/method_listbylocation.go @@ -0,0 +1,105 @@ +package autonomousdatabasecharactersets + +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 ListByLocationOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]AutonomousDatabaseCharacterSet +} + +type ListByLocationCompleteResult struct { + LatestHttpResponse *http.Response + Items []AutonomousDatabaseCharacterSet +} + +type ListByLocationCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByLocationCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByLocation ... +func (c AutonomousDatabaseCharacterSetsClient) ListByLocation(ctx context.Context, id LocationId) (result ListByLocationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByLocationCustomPager{}, + Path: fmt.Sprintf("%s/autonomousDatabaseCharacterSets", 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 *[]AutonomousDatabaseCharacterSet `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByLocationComplete retrieves all the results into a single object +func (c AutonomousDatabaseCharacterSetsClient) ListByLocationComplete(ctx context.Context, id LocationId) (ListByLocationCompleteResult, error) { + return c.ListByLocationCompleteMatchingPredicate(ctx, id, AutonomousDatabaseCharacterSetOperationPredicate{}) +} + +// ListByLocationCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c AutonomousDatabaseCharacterSetsClient) ListByLocationCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate AutonomousDatabaseCharacterSetOperationPredicate) (result ListByLocationCompleteResult, err error) { + items := make([]AutonomousDatabaseCharacterSet, 0) + + resp, err := c.ListByLocation(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListByLocationCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/model_autonomousdatabasecharacterset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/model_autonomousdatabasecharacterset.go new file mode 100644 index 000000000000..6fa0b10b403b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/model_autonomousdatabasecharacterset.go @@ -0,0 +1,16 @@ +package autonomousdatabasecharactersets + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDatabaseCharacterSet struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *AutonomousDatabaseCharacterSetProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/model_autonomousdatabasecharactersetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/model_autonomousdatabasecharactersetproperties.go new file mode 100644 index 000000000000..901e37d3b140 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/model_autonomousdatabasecharactersetproperties.go @@ -0,0 +1,8 @@ +package autonomousdatabasecharactersets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDatabaseCharacterSetProperties struct { + CharacterSet *string `json:"characterSet,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/predicates.go new file mode 100644 index 000000000000..248c5399d40f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/predicates.go @@ -0,0 +1,27 @@ +package autonomousdatabasecharactersets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDatabaseCharacterSetOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p AutonomousDatabaseCharacterSetOperationPredicate) Matches(input AutonomousDatabaseCharacterSet) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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/oracledatabase/2024-06-01/autonomousdatabasecharactersets/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/version.go new file mode 100644 index 000000000000..59b6beb71323 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets/version.go @@ -0,0 +1,10 @@ +package autonomousdatabasecharactersets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-06-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/autonomousdatabasecharactersets/2024-06-01" +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/README.md new file mode 100644 index 000000000000..41c33e4c8b0b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets` Documentation + +The `autonomousdatabasenationalcharactersets` SDK allows for interaction with Azure Resource Manager `oracledatabase` (API Version `2024-06-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-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets" +``` + + +### Client Initialization + +```go +client := autonomousdatabasenationalcharactersets.NewAutonomousDatabaseNationalCharacterSetsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `AutonomousDatabaseNationalCharacterSetsClient.Get` + +```go +ctx := context.TODO() +id := autonomousdatabasenationalcharactersets.NewAutonomousDatabaseNationalCharacterSetID("12345678-1234-9876-4563-123456789012", "locationName", "autonomousDatabaseNationalCharacterSetName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AutonomousDatabaseNationalCharacterSetsClient.ListByLocation` + +```go +ctx := context.TODO() +id := autonomousdatabasenationalcharactersets.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") + +// alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination +items, err := client.ListByLocationComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/client.go new file mode 100644 index 000000000000..a02efac62b71 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/client.go @@ -0,0 +1,26 @@ +package autonomousdatabasenationalcharactersets + +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 AutonomousDatabaseNationalCharacterSetsClient struct { + Client *resourcemanager.Client +} + +func NewAutonomousDatabaseNationalCharacterSetsClientWithBaseURI(sdkApi sdkEnv.Api) (*AutonomousDatabaseNationalCharacterSetsClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "autonomousdatabasenationalcharactersets", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating AutonomousDatabaseNationalCharacterSetsClient: %+v", err) + } + + return &AutonomousDatabaseNationalCharacterSetsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_autonomousdatabasenationalcharacterset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_autonomousdatabasenationalcharacterset.go new file mode 100644 index 000000000000..97a41a6ea493 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_autonomousdatabasenationalcharacterset.go @@ -0,0 +1,130 @@ +package autonomousdatabasenationalcharactersets + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&AutonomousDatabaseNationalCharacterSetId{}) +} + +var _ resourceids.ResourceId = &AutonomousDatabaseNationalCharacterSetId{} + +// AutonomousDatabaseNationalCharacterSetId is a struct representing the Resource ID for a Autonomous Database National Character Set +type AutonomousDatabaseNationalCharacterSetId struct { + SubscriptionId string + LocationName string + AutonomousDatabaseNationalCharacterSetName string +} + +// NewAutonomousDatabaseNationalCharacterSetID returns a new AutonomousDatabaseNationalCharacterSetId struct +func NewAutonomousDatabaseNationalCharacterSetID(subscriptionId string, locationName string, autonomousDatabaseNationalCharacterSetName string) AutonomousDatabaseNationalCharacterSetId { + return AutonomousDatabaseNationalCharacterSetId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + AutonomousDatabaseNationalCharacterSetName: autonomousDatabaseNationalCharacterSetName, + } +} + +// ParseAutonomousDatabaseNationalCharacterSetID parses 'input' into a AutonomousDatabaseNationalCharacterSetId +func ParseAutonomousDatabaseNationalCharacterSetID(input string) (*AutonomousDatabaseNationalCharacterSetId, error) { + parser := resourceids.NewParserFromResourceIdType(&AutonomousDatabaseNationalCharacterSetId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AutonomousDatabaseNationalCharacterSetId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseAutonomousDatabaseNationalCharacterSetIDInsensitively parses 'input' case-insensitively into a AutonomousDatabaseNationalCharacterSetId +// note: this method should only be used for API response data and not user input +func ParseAutonomousDatabaseNationalCharacterSetIDInsensitively(input string) (*AutonomousDatabaseNationalCharacterSetId, error) { + parser := resourceids.NewParserFromResourceIdType(&AutonomousDatabaseNationalCharacterSetId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AutonomousDatabaseNationalCharacterSetId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *AutonomousDatabaseNationalCharacterSetId) 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) + } + + if id.AutonomousDatabaseNationalCharacterSetName, ok = input.Parsed["autonomousDatabaseNationalCharacterSetName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "autonomousDatabaseNationalCharacterSetName", input) + } + + return nil +} + +// ValidateAutonomousDatabaseNationalCharacterSetID checks that 'input' can be parsed as a Autonomous Database National Character Set ID +func ValidateAutonomousDatabaseNationalCharacterSetID(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 := ParseAutonomousDatabaseNationalCharacterSetID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Autonomous Database National Character Set ID +func (id AutonomousDatabaseNationalCharacterSetId) ID() string { + fmtString := "/subscriptions/%s/providers/Oracle.Database/locations/%s/autonomousDatabaseNationalCharacterSets/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName, id.AutonomousDatabaseNationalCharacterSetName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Autonomous Database National Character Set ID +func (id AutonomousDatabaseNationalCharacterSetId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + resourceids.StaticSegment("staticAutonomousDatabaseNationalCharacterSets", "autonomousDatabaseNationalCharacterSets", "autonomousDatabaseNationalCharacterSets"), + resourceids.UserSpecifiedSegment("autonomousDatabaseNationalCharacterSetName", "autonomousDatabaseNationalCharacterSetName"), + } +} + +// String returns a human-readable description of this Autonomous Database National Character Set ID +func (id AutonomousDatabaseNationalCharacterSetId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + fmt.Sprintf("Autonomous Database National Character Set Name: %q", id.AutonomousDatabaseNationalCharacterSetName), + } + return fmt.Sprintf("Autonomous Database National Character Set (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_location.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_location.go new file mode 100644 index 000000000000..a999a7f708c4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/id_location.go @@ -0,0 +1,121 @@ +package autonomousdatabasenationalcharactersets + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&LocationId{}) +} + +var _ resourceids.ResourceId = &LocationId{} + +// LocationId is a struct representing the Resource ID for a Location +type LocationId struct { + SubscriptionId string + LocationName string +} + +// NewLocationID returns a new LocationId struct +func NewLocationID(subscriptionId string, locationName string) LocationId { + return LocationId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + } +} + +// ParseLocationID parses 'input' into a LocationId +func ParseLocationID(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseLocationIDInsensitively parses 'input' case-insensitively into a LocationId +// note: this method should only be used for API response data and not user input +func ParseLocationIDInsensitively(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *LocationId) 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 +} + +// ValidateLocationID checks that 'input' can be parsed as a Location ID +func ValidateLocationID(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 := ParseLocationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Location ID +func (id LocationId) ID() string { + fmtString := "/subscriptions/%s/providers/Oracle.Database/locations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Location ID +func (id LocationId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + } +} + +// String returns a human-readable description of this Location ID +func (id LocationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + } + return fmt.Sprintf("Location (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/method_get.go new file mode 100644 index 000000000000..363ea0b0a5ac --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/method_get.go @@ -0,0 +1,53 @@ +package autonomousdatabasenationalcharactersets + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *AutonomousDatabaseNationalCharacterSet +} + +// Get ... +func (c AutonomousDatabaseNationalCharacterSetsClient) Get(ctx context.Context, id AutonomousDatabaseNationalCharacterSetId) (result GetOperationResponse, 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 AutonomousDatabaseNationalCharacterSet + 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/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/method_listbylocation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/method_listbylocation.go new file mode 100644 index 000000000000..98ab6421827a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/method_listbylocation.go @@ -0,0 +1,105 @@ +package autonomousdatabasenationalcharactersets + +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 ListByLocationOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]AutonomousDatabaseNationalCharacterSet +} + +type ListByLocationCompleteResult struct { + LatestHttpResponse *http.Response + Items []AutonomousDatabaseNationalCharacterSet +} + +type ListByLocationCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByLocationCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByLocation ... +func (c AutonomousDatabaseNationalCharacterSetsClient) ListByLocation(ctx context.Context, id LocationId) (result ListByLocationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByLocationCustomPager{}, + Path: fmt.Sprintf("%s/autonomousDatabaseNationalCharacterSets", 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 *[]AutonomousDatabaseNationalCharacterSet `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByLocationComplete retrieves all the results into a single object +func (c AutonomousDatabaseNationalCharacterSetsClient) ListByLocationComplete(ctx context.Context, id LocationId) (ListByLocationCompleteResult, error) { + return c.ListByLocationCompleteMatchingPredicate(ctx, id, AutonomousDatabaseNationalCharacterSetOperationPredicate{}) +} + +// ListByLocationCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c AutonomousDatabaseNationalCharacterSetsClient) ListByLocationCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate AutonomousDatabaseNationalCharacterSetOperationPredicate) (result ListByLocationCompleteResult, err error) { + items := make([]AutonomousDatabaseNationalCharacterSet, 0) + + resp, err := c.ListByLocation(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListByLocationCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/model_autonomousdatabasenationalcharacterset.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/model_autonomousdatabasenationalcharacterset.go new file mode 100644 index 000000000000..1bf4f8d2c11c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/model_autonomousdatabasenationalcharacterset.go @@ -0,0 +1,16 @@ +package autonomousdatabasenationalcharactersets + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDatabaseNationalCharacterSet struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *AutonomousDatabaseNationalCharacterSetProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/model_autonomousdatabasenationalcharactersetproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/model_autonomousdatabasenationalcharactersetproperties.go new file mode 100644 index 000000000000..075fdf79954a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/model_autonomousdatabasenationalcharactersetproperties.go @@ -0,0 +1,8 @@ +package autonomousdatabasenationalcharactersets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDatabaseNationalCharacterSetProperties struct { + CharacterSet *string `json:"characterSet,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/predicates.go new file mode 100644 index 000000000000..6dcbbef5c7b0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/predicates.go @@ -0,0 +1,27 @@ +package autonomousdatabasenationalcharactersets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDatabaseNationalCharacterSetOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p AutonomousDatabaseNationalCharacterSetOperationPredicate) Matches(input AutonomousDatabaseNationalCharacterSet) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/version.go new file mode 100644 index 000000000000..edda0b2b3b45 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets/version.go @@ -0,0 +1,10 @@ +package autonomousdatabasenationalcharactersets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-06-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/autonomousdatabasenationalcharactersets/2024-06-01" +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/README.md new file mode 100644 index 000000000000..d4b1d4c08eba --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/README.md @@ -0,0 +1,201 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases` Documentation + +The `autonomousdatabases` SDK allows for interaction with Azure Resource Manager `oracledatabase` (API Version `2024-06-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/oracledatabase/2024-06-01/autonomousdatabases" +``` + + +### Client Initialization + +```go +client := autonomousdatabases.NewAutonomousDatabasesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `AutonomousDatabasesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") + +payload := autonomousdatabases.AutonomousDatabase{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `AutonomousDatabasesClient.Delete` + +```go +ctx := context.TODO() +id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `AutonomousDatabasesClient.Failover` + +```go +ctx := context.TODO() +id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") + +payload := autonomousdatabases.PeerDbDetails{ + // ... +} + + +if err := client.FailoverThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `AutonomousDatabasesClient.GenerateWallet` + +```go +ctx := context.TODO() +id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") + +payload := autonomousdatabases.GenerateAutonomousDatabaseWalletDetails{ + // ... +} + + +read, err := client.GenerateWallet(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AutonomousDatabasesClient.Get` + +```go +ctx := context.TODO() +id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AutonomousDatabasesClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.ListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `AutonomousDatabasesClient.ListBySubscription` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `AutonomousDatabasesClient.Restore` + +```go +ctx := context.TODO() +id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") + +payload := autonomousdatabases.RestoreAutonomousDatabaseDetails{ + // ... +} + + +if err := client.RestoreThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `AutonomousDatabasesClient.Shrink` + +```go +ctx := context.TODO() +id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") + +if err := client.ShrinkThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `AutonomousDatabasesClient.Switchover` + +```go +ctx := context.TODO() +id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") + +payload := autonomousdatabases.PeerDbDetails{ + // ... +} + + +if err := client.SwitchoverThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `AutonomousDatabasesClient.Update` + +```go +ctx := context.TODO() +id := autonomousdatabases.NewAutonomousDatabaseID("12345678-1234-9876-4563-123456789012", "example-resource-group", "autonomousDatabaseName") + +payload := autonomousdatabases.AutonomousDatabaseUpdate{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/client.go new file mode 100644 index 000000000000..1e8755ba76c8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/client.go @@ -0,0 +1,26 @@ +package autonomousdatabases + +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 AutonomousDatabasesClient struct { + Client *resourcemanager.Client +} + +func NewAutonomousDatabasesClientWithBaseURI(sdkApi sdkEnv.Api) (*AutonomousDatabasesClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "autonomousdatabases", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating AutonomousDatabasesClient: %+v", err) + } + + return &AutonomousDatabasesClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/constants.go new file mode 100644 index 000000000000..22b9ad59574d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/constants.go @@ -0,0 +1,1264 @@ +package autonomousdatabases + +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 AutonomousDatabaseLifecycleState string + +const ( + AutonomousDatabaseLifecycleStateAvailable AutonomousDatabaseLifecycleState = "Available" + AutonomousDatabaseLifecycleStateAvailableNeedsAttention AutonomousDatabaseLifecycleState = "AvailableNeedsAttention" + AutonomousDatabaseLifecycleStateBackupInProgress AutonomousDatabaseLifecycleState = "BackupInProgress" + AutonomousDatabaseLifecycleStateInaccessible AutonomousDatabaseLifecycleState = "Inaccessible" + AutonomousDatabaseLifecycleStateMaintenanceInProgress AutonomousDatabaseLifecycleState = "MaintenanceInProgress" + AutonomousDatabaseLifecycleStateProvisioning AutonomousDatabaseLifecycleState = "Provisioning" + AutonomousDatabaseLifecycleStateRecreating AutonomousDatabaseLifecycleState = "Recreating" + AutonomousDatabaseLifecycleStateRestarting AutonomousDatabaseLifecycleState = "Restarting" + AutonomousDatabaseLifecycleStateRestoreFailed AutonomousDatabaseLifecycleState = "RestoreFailed" + AutonomousDatabaseLifecycleStateRestoreInProgress AutonomousDatabaseLifecycleState = "RestoreInProgress" + AutonomousDatabaseLifecycleStateRoleChangeInProgress AutonomousDatabaseLifecycleState = "RoleChangeInProgress" + AutonomousDatabaseLifecycleStateScaleInProgress AutonomousDatabaseLifecycleState = "ScaleInProgress" + AutonomousDatabaseLifecycleStateStandby AutonomousDatabaseLifecycleState = "Standby" + AutonomousDatabaseLifecycleStateStarting AutonomousDatabaseLifecycleState = "Starting" + AutonomousDatabaseLifecycleStateStopped AutonomousDatabaseLifecycleState = "Stopped" + AutonomousDatabaseLifecycleStateStopping AutonomousDatabaseLifecycleState = "Stopping" + AutonomousDatabaseLifecycleStateTerminated AutonomousDatabaseLifecycleState = "Terminated" + AutonomousDatabaseLifecycleStateTerminating AutonomousDatabaseLifecycleState = "Terminating" + AutonomousDatabaseLifecycleStateUnavailable AutonomousDatabaseLifecycleState = "Unavailable" + AutonomousDatabaseLifecycleStateUpdating AutonomousDatabaseLifecycleState = "Updating" + AutonomousDatabaseLifecycleStateUpgrading AutonomousDatabaseLifecycleState = "Upgrading" +) + +func PossibleValuesForAutonomousDatabaseLifecycleState() []string { + return []string{ + string(AutonomousDatabaseLifecycleStateAvailable), + string(AutonomousDatabaseLifecycleStateAvailableNeedsAttention), + string(AutonomousDatabaseLifecycleStateBackupInProgress), + string(AutonomousDatabaseLifecycleStateInaccessible), + string(AutonomousDatabaseLifecycleStateMaintenanceInProgress), + string(AutonomousDatabaseLifecycleStateProvisioning), + string(AutonomousDatabaseLifecycleStateRecreating), + string(AutonomousDatabaseLifecycleStateRestarting), + string(AutonomousDatabaseLifecycleStateRestoreFailed), + string(AutonomousDatabaseLifecycleStateRestoreInProgress), + string(AutonomousDatabaseLifecycleStateRoleChangeInProgress), + string(AutonomousDatabaseLifecycleStateScaleInProgress), + string(AutonomousDatabaseLifecycleStateStandby), + string(AutonomousDatabaseLifecycleStateStarting), + string(AutonomousDatabaseLifecycleStateStopped), + string(AutonomousDatabaseLifecycleStateStopping), + string(AutonomousDatabaseLifecycleStateTerminated), + string(AutonomousDatabaseLifecycleStateTerminating), + string(AutonomousDatabaseLifecycleStateUnavailable), + string(AutonomousDatabaseLifecycleStateUpdating), + string(AutonomousDatabaseLifecycleStateUpgrading), + } +} + +func (s *AutonomousDatabaseLifecycleState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAutonomousDatabaseLifecycleState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAutonomousDatabaseLifecycleState(input string) (*AutonomousDatabaseLifecycleState, error) { + vals := map[string]AutonomousDatabaseLifecycleState{ + "available": AutonomousDatabaseLifecycleStateAvailable, + "availableneedsattention": AutonomousDatabaseLifecycleStateAvailableNeedsAttention, + "backupinprogress": AutonomousDatabaseLifecycleStateBackupInProgress, + "inaccessible": AutonomousDatabaseLifecycleStateInaccessible, + "maintenanceinprogress": AutonomousDatabaseLifecycleStateMaintenanceInProgress, + "provisioning": AutonomousDatabaseLifecycleStateProvisioning, + "recreating": AutonomousDatabaseLifecycleStateRecreating, + "restarting": AutonomousDatabaseLifecycleStateRestarting, + "restorefailed": AutonomousDatabaseLifecycleStateRestoreFailed, + "restoreinprogress": AutonomousDatabaseLifecycleStateRestoreInProgress, + "rolechangeinprogress": AutonomousDatabaseLifecycleStateRoleChangeInProgress, + "scaleinprogress": AutonomousDatabaseLifecycleStateScaleInProgress, + "standby": AutonomousDatabaseLifecycleStateStandby, + "starting": AutonomousDatabaseLifecycleStateStarting, + "stopped": AutonomousDatabaseLifecycleStateStopped, + "stopping": AutonomousDatabaseLifecycleStateStopping, + "terminated": AutonomousDatabaseLifecycleStateTerminated, + "terminating": AutonomousDatabaseLifecycleStateTerminating, + "unavailable": AutonomousDatabaseLifecycleStateUnavailable, + "updating": AutonomousDatabaseLifecycleStateUpdating, + "upgrading": AutonomousDatabaseLifecycleStateUpgrading, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AutonomousDatabaseLifecycleState(input) + return &out, nil +} + +type AutonomousMaintenanceScheduleType string + +const ( + AutonomousMaintenanceScheduleTypeEarly AutonomousMaintenanceScheduleType = "Early" + AutonomousMaintenanceScheduleTypeRegular AutonomousMaintenanceScheduleType = "Regular" +) + +func PossibleValuesForAutonomousMaintenanceScheduleType() []string { + return []string{ + string(AutonomousMaintenanceScheduleTypeEarly), + string(AutonomousMaintenanceScheduleTypeRegular), + } +} + +func (s *AutonomousMaintenanceScheduleType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAutonomousMaintenanceScheduleType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAutonomousMaintenanceScheduleType(input string) (*AutonomousMaintenanceScheduleType, error) { + vals := map[string]AutonomousMaintenanceScheduleType{ + "early": AutonomousMaintenanceScheduleTypeEarly, + "regular": AutonomousMaintenanceScheduleTypeRegular, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AutonomousMaintenanceScheduleType(input) + return &out, nil +} + +type AzureResourceProvisioningState string + +const ( + AzureResourceProvisioningStateCanceled AzureResourceProvisioningState = "Canceled" + AzureResourceProvisioningStateFailed AzureResourceProvisioningState = "Failed" + AzureResourceProvisioningStateProvisioning AzureResourceProvisioningState = "Provisioning" + AzureResourceProvisioningStateSucceeded AzureResourceProvisioningState = "Succeeded" +) + +func PossibleValuesForAzureResourceProvisioningState() []string { + return []string{ + string(AzureResourceProvisioningStateCanceled), + string(AzureResourceProvisioningStateFailed), + string(AzureResourceProvisioningStateProvisioning), + string(AzureResourceProvisioningStateSucceeded), + } +} + +func (s *AzureResourceProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureResourceProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureResourceProvisioningState(input string) (*AzureResourceProvisioningState, error) { + vals := map[string]AzureResourceProvisioningState{ + "canceled": AzureResourceProvisioningStateCanceled, + "failed": AzureResourceProvisioningStateFailed, + "provisioning": AzureResourceProvisioningStateProvisioning, + "succeeded": AzureResourceProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureResourceProvisioningState(input) + return &out, nil +} + +type CloneType string + +const ( + CloneTypeFull CloneType = "Full" + CloneTypeMetadata CloneType = "Metadata" +) + +func PossibleValuesForCloneType() []string { + return []string{ + string(CloneTypeFull), + string(CloneTypeMetadata), + } +} + +func (s *CloneType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCloneType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCloneType(input string) (*CloneType, error) { + vals := map[string]CloneType{ + "full": CloneTypeFull, + "metadata": CloneTypeMetadata, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CloneType(input) + return &out, nil +} + +type ComputeModel string + +const ( + ComputeModelECPU ComputeModel = "ECPU" + ComputeModelOCPU ComputeModel = "OCPU" +) + +func PossibleValuesForComputeModel() []string { + return []string{ + string(ComputeModelECPU), + string(ComputeModelOCPU), + } +} + +func (s *ComputeModel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseComputeModel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseComputeModel(input string) (*ComputeModel, error) { + vals := map[string]ComputeModel{ + "ecpu": ComputeModelECPU, + "ocpu": ComputeModelOCPU, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ComputeModel(input) + return &out, nil +} + +type ConsumerGroup string + +const ( + ConsumerGroupHigh ConsumerGroup = "High" + ConsumerGroupLow ConsumerGroup = "Low" + ConsumerGroupMedium ConsumerGroup = "Medium" + ConsumerGroupTp ConsumerGroup = "Tp" + ConsumerGroupTpurgent ConsumerGroup = "Tpurgent" +) + +func PossibleValuesForConsumerGroup() []string { + return []string{ + string(ConsumerGroupHigh), + string(ConsumerGroupLow), + string(ConsumerGroupMedium), + string(ConsumerGroupTp), + string(ConsumerGroupTpurgent), + } +} + +func (s *ConsumerGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseConsumerGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseConsumerGroup(input string) (*ConsumerGroup, error) { + vals := map[string]ConsumerGroup{ + "high": ConsumerGroupHigh, + "low": ConsumerGroupLow, + "medium": ConsumerGroupMedium, + "tp": ConsumerGroupTp, + "tpurgent": ConsumerGroupTpurgent, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ConsumerGroup(input) + return &out, nil +} + +type DataBaseType string + +const ( + DataBaseTypeClone DataBaseType = "Clone" + DataBaseTypeRegular DataBaseType = "Regular" +) + +func PossibleValuesForDataBaseType() []string { + return []string{ + string(DataBaseTypeClone), + string(DataBaseTypeRegular), + } +} + +func (s *DataBaseType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDataBaseType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDataBaseType(input string) (*DataBaseType, error) { + vals := map[string]DataBaseType{ + "clone": DataBaseTypeClone, + "regular": DataBaseTypeRegular, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DataBaseType(input) + return &out, nil +} + +type DataSafeStatusType string + +const ( + DataSafeStatusTypeDeregistering DataSafeStatusType = "Deregistering" + DataSafeStatusTypeFailed DataSafeStatusType = "Failed" + DataSafeStatusTypeNotRegistered DataSafeStatusType = "NotRegistered" + DataSafeStatusTypeRegistered DataSafeStatusType = "Registered" + DataSafeStatusTypeRegistering DataSafeStatusType = "Registering" +) + +func PossibleValuesForDataSafeStatusType() []string { + return []string{ + string(DataSafeStatusTypeDeregistering), + string(DataSafeStatusTypeFailed), + string(DataSafeStatusTypeNotRegistered), + string(DataSafeStatusTypeRegistered), + string(DataSafeStatusTypeRegistering), + } +} + +func (s *DataSafeStatusType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDataSafeStatusType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDataSafeStatusType(input string) (*DataSafeStatusType, error) { + vals := map[string]DataSafeStatusType{ + "deregistering": DataSafeStatusTypeDeregistering, + "failed": DataSafeStatusTypeFailed, + "notregistered": DataSafeStatusTypeNotRegistered, + "registered": DataSafeStatusTypeRegistered, + "registering": DataSafeStatusTypeRegistering, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DataSafeStatusType(input) + return &out, nil +} + +type DatabaseEditionType string + +const ( + DatabaseEditionTypeEnterpriseEdition DatabaseEditionType = "EnterpriseEdition" + DatabaseEditionTypeStandardEdition DatabaseEditionType = "StandardEdition" +) + +func PossibleValuesForDatabaseEditionType() []string { + return []string{ + string(DatabaseEditionTypeEnterpriseEdition), + string(DatabaseEditionTypeStandardEdition), + } +} + +func (s *DatabaseEditionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDatabaseEditionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDatabaseEditionType(input string) (*DatabaseEditionType, error) { + vals := map[string]DatabaseEditionType{ + "enterpriseedition": DatabaseEditionTypeEnterpriseEdition, + "standardedition": DatabaseEditionTypeStandardEdition, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DatabaseEditionType(input) + return &out, nil +} + +type DayOfWeekName string + +const ( + DayOfWeekNameFriday DayOfWeekName = "Friday" + DayOfWeekNameMonday DayOfWeekName = "Monday" + DayOfWeekNameSaturday DayOfWeekName = "Saturday" + DayOfWeekNameSunday DayOfWeekName = "Sunday" + DayOfWeekNameThursday DayOfWeekName = "Thursday" + DayOfWeekNameTuesday DayOfWeekName = "Tuesday" + DayOfWeekNameWednesday DayOfWeekName = "Wednesday" +) + +func PossibleValuesForDayOfWeekName() []string { + return []string{ + string(DayOfWeekNameFriday), + string(DayOfWeekNameMonday), + string(DayOfWeekNameSaturday), + string(DayOfWeekNameSunday), + string(DayOfWeekNameThursday), + string(DayOfWeekNameTuesday), + string(DayOfWeekNameWednesday), + } +} + +func (s *DayOfWeekName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDayOfWeekName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDayOfWeekName(input string) (*DayOfWeekName, error) { + vals := map[string]DayOfWeekName{ + "friday": DayOfWeekNameFriday, + "monday": DayOfWeekNameMonday, + "saturday": DayOfWeekNameSaturday, + "sunday": DayOfWeekNameSunday, + "thursday": DayOfWeekNameThursday, + "tuesday": DayOfWeekNameTuesday, + "wednesday": DayOfWeekNameWednesday, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DayOfWeekName(input) + return &out, nil +} + +type DisasterRecoveryType string + +const ( + DisasterRecoveryTypeAdg DisasterRecoveryType = "Adg" + DisasterRecoveryTypeBackupBased DisasterRecoveryType = "BackupBased" +) + +func PossibleValuesForDisasterRecoveryType() []string { + return []string{ + string(DisasterRecoveryTypeAdg), + string(DisasterRecoveryTypeBackupBased), + } +} + +func (s *DisasterRecoveryType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDisasterRecoveryType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDisasterRecoveryType(input string) (*DisasterRecoveryType, error) { + vals := map[string]DisasterRecoveryType{ + "adg": DisasterRecoveryTypeAdg, + "backupbased": DisasterRecoveryTypeBackupBased, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DisasterRecoveryType(input) + return &out, nil +} + +type GenerateType string + +const ( + GenerateTypeAll GenerateType = "All" + GenerateTypeSingle GenerateType = "Single" +) + +func PossibleValuesForGenerateType() []string { + return []string{ + string(GenerateTypeAll), + string(GenerateTypeSingle), + } +} + +func (s *GenerateType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGenerateType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGenerateType(input string) (*GenerateType, error) { + vals := map[string]GenerateType{ + "all": GenerateTypeAll, + "single": GenerateTypeSingle, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GenerateType(input) + return &out, nil +} + +type HostFormatType string + +const ( + HostFormatTypeFqdn HostFormatType = "Fqdn" + HostFormatTypeIP HostFormatType = "Ip" +) + +func PossibleValuesForHostFormatType() []string { + return []string{ + string(HostFormatTypeFqdn), + string(HostFormatTypeIP), + } +} + +func (s *HostFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseHostFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseHostFormatType(input string) (*HostFormatType, error) { + vals := map[string]HostFormatType{ + "fqdn": HostFormatTypeFqdn, + "ip": HostFormatTypeIP, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := HostFormatType(input) + return &out, nil +} + +type LicenseModel string + +const ( + LicenseModelBringYourOwnLicense LicenseModel = "BringYourOwnLicense" + LicenseModelLicenseIncluded LicenseModel = "LicenseIncluded" +) + +func PossibleValuesForLicenseModel() []string { + return []string{ + string(LicenseModelBringYourOwnLicense), + string(LicenseModelLicenseIncluded), + } +} + +func (s *LicenseModel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLicenseModel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLicenseModel(input string) (*LicenseModel, error) { + vals := map[string]LicenseModel{ + "bringyourownlicense": LicenseModelBringYourOwnLicense, + "licenseincluded": LicenseModelLicenseIncluded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LicenseModel(input) + return &out, nil +} + +type OpenModeType string + +const ( + OpenModeTypeReadOnly OpenModeType = "ReadOnly" + OpenModeTypeReadWrite OpenModeType = "ReadWrite" +) + +func PossibleValuesForOpenModeType() []string { + return []string{ + string(OpenModeTypeReadOnly), + string(OpenModeTypeReadWrite), + } +} + +func (s *OpenModeType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOpenModeType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOpenModeType(input string) (*OpenModeType, error) { + vals := map[string]OpenModeType{ + "readonly": OpenModeTypeReadOnly, + "readwrite": OpenModeTypeReadWrite, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OpenModeType(input) + return &out, nil +} + +type OperationsInsightsStatusType string + +const ( + OperationsInsightsStatusTypeDisabling OperationsInsightsStatusType = "Disabling" + OperationsInsightsStatusTypeEnabled OperationsInsightsStatusType = "Enabled" + OperationsInsightsStatusTypeEnabling OperationsInsightsStatusType = "Enabling" + OperationsInsightsStatusTypeFailedDisabling OperationsInsightsStatusType = "FailedDisabling" + OperationsInsightsStatusTypeFailedEnabling OperationsInsightsStatusType = "FailedEnabling" + OperationsInsightsStatusTypeNotEnabled OperationsInsightsStatusType = "NotEnabled" +) + +func PossibleValuesForOperationsInsightsStatusType() []string { + return []string{ + string(OperationsInsightsStatusTypeDisabling), + string(OperationsInsightsStatusTypeEnabled), + string(OperationsInsightsStatusTypeEnabling), + string(OperationsInsightsStatusTypeFailedDisabling), + string(OperationsInsightsStatusTypeFailedEnabling), + string(OperationsInsightsStatusTypeNotEnabled), + } +} + +func (s *OperationsInsightsStatusType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOperationsInsightsStatusType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOperationsInsightsStatusType(input string) (*OperationsInsightsStatusType, error) { + vals := map[string]OperationsInsightsStatusType{ + "disabling": OperationsInsightsStatusTypeDisabling, + "enabled": OperationsInsightsStatusTypeEnabled, + "enabling": OperationsInsightsStatusTypeEnabling, + "faileddisabling": OperationsInsightsStatusTypeFailedDisabling, + "failedenabling": OperationsInsightsStatusTypeFailedEnabling, + "notenabled": OperationsInsightsStatusTypeNotEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OperationsInsightsStatusType(input) + return &out, nil +} + +type PermissionLevelType string + +const ( + PermissionLevelTypeRestricted PermissionLevelType = "Restricted" + PermissionLevelTypeUnrestricted PermissionLevelType = "Unrestricted" +) + +func PossibleValuesForPermissionLevelType() []string { + return []string{ + string(PermissionLevelTypeRestricted), + string(PermissionLevelTypeUnrestricted), + } +} + +func (s *PermissionLevelType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePermissionLevelType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePermissionLevelType(input string) (*PermissionLevelType, error) { + vals := map[string]PermissionLevelType{ + "restricted": PermissionLevelTypeRestricted, + "unrestricted": PermissionLevelTypeUnrestricted, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PermissionLevelType(input) + return &out, nil +} + +type ProtocolType string + +const ( + ProtocolTypeTCP ProtocolType = "TCP" + ProtocolTypeTCPS ProtocolType = "TCPS" +) + +func PossibleValuesForProtocolType() []string { + return []string{ + string(ProtocolTypeTCP), + string(ProtocolTypeTCPS), + } +} + +func (s *ProtocolType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProtocolType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProtocolType(input string) (*ProtocolType, error) { + vals := map[string]ProtocolType{ + "tcp": ProtocolTypeTCP, + "tcps": ProtocolTypeTCPS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProtocolType(input) + return &out, nil +} + +type RefreshableModelType string + +const ( + RefreshableModelTypeAutomatic RefreshableModelType = "Automatic" + RefreshableModelTypeManual RefreshableModelType = "Manual" +) + +func PossibleValuesForRefreshableModelType() []string { + return []string{ + string(RefreshableModelTypeAutomatic), + string(RefreshableModelTypeManual), + } +} + +func (s *RefreshableModelType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRefreshableModelType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRefreshableModelType(input string) (*RefreshableModelType, error) { + vals := map[string]RefreshableModelType{ + "automatic": RefreshableModelTypeAutomatic, + "manual": RefreshableModelTypeManual, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RefreshableModelType(input) + return &out, nil +} + +type RefreshableStatusType string + +const ( + RefreshableStatusTypeNotRefreshing RefreshableStatusType = "NotRefreshing" + RefreshableStatusTypeRefreshing RefreshableStatusType = "Refreshing" +) + +func PossibleValuesForRefreshableStatusType() []string { + return []string{ + string(RefreshableStatusTypeNotRefreshing), + string(RefreshableStatusTypeRefreshing), + } +} + +func (s *RefreshableStatusType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRefreshableStatusType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRefreshableStatusType(input string) (*RefreshableStatusType, error) { + vals := map[string]RefreshableStatusType{ + "notrefreshing": RefreshableStatusTypeNotRefreshing, + "refreshing": RefreshableStatusTypeRefreshing, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RefreshableStatusType(input) + return &out, nil +} + +type RepeatCadenceType string + +const ( + RepeatCadenceTypeMonthly RepeatCadenceType = "Monthly" + RepeatCadenceTypeOneTime RepeatCadenceType = "OneTime" + RepeatCadenceTypeWeekly RepeatCadenceType = "Weekly" + RepeatCadenceTypeYearly RepeatCadenceType = "Yearly" +) + +func PossibleValuesForRepeatCadenceType() []string { + return []string{ + string(RepeatCadenceTypeMonthly), + string(RepeatCadenceTypeOneTime), + string(RepeatCadenceTypeWeekly), + string(RepeatCadenceTypeYearly), + } +} + +func (s *RepeatCadenceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRepeatCadenceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRepeatCadenceType(input string) (*RepeatCadenceType, error) { + vals := map[string]RepeatCadenceType{ + "monthly": RepeatCadenceTypeMonthly, + "onetime": RepeatCadenceTypeOneTime, + "weekly": RepeatCadenceTypeWeekly, + "yearly": RepeatCadenceTypeYearly, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RepeatCadenceType(input) + return &out, nil +} + +type RoleType string + +const ( + RoleTypeBackupCopy RoleType = "BackupCopy" + RoleTypeDisabledStandby RoleType = "DisabledStandby" + RoleTypePrimary RoleType = "Primary" + RoleTypeSnapshotStandby RoleType = "SnapshotStandby" + RoleTypeStandby RoleType = "Standby" +) + +func PossibleValuesForRoleType() []string { + return []string{ + string(RoleTypeBackupCopy), + string(RoleTypeDisabledStandby), + string(RoleTypePrimary), + string(RoleTypeSnapshotStandby), + string(RoleTypeStandby), + } +} + +func (s *RoleType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRoleType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRoleType(input string) (*RoleType, error) { + vals := map[string]RoleType{ + "backupcopy": RoleTypeBackupCopy, + "disabledstandby": RoleTypeDisabledStandby, + "primary": RoleTypePrimary, + "snapshotstandby": RoleTypeSnapshotStandby, + "standby": RoleTypeStandby, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RoleType(input) + return &out, nil +} + +type SessionModeType string + +const ( + SessionModeTypeDirect SessionModeType = "Direct" + SessionModeTypeRedirect SessionModeType = "Redirect" +) + +func PossibleValuesForSessionModeType() []string { + return []string{ + string(SessionModeTypeDirect), + string(SessionModeTypeRedirect), + } +} + +func (s *SessionModeType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSessionModeType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSessionModeType(input string) (*SessionModeType, error) { + vals := map[string]SessionModeType{ + "direct": SessionModeTypeDirect, + "redirect": SessionModeTypeRedirect, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SessionModeType(input) + return &out, nil +} + +type SourceType string + +const ( + SourceTypeBackupFromId SourceType = "BackupFromId" + SourceTypeBackupFromTimestamp SourceType = "BackupFromTimestamp" + SourceTypeCloneToRefreshable SourceType = "CloneToRefreshable" + SourceTypeCrossRegionDataguard SourceType = "CrossRegionDataguard" + SourceTypeCrossRegionDisasterRecovery SourceType = "CrossRegionDisasterRecovery" + SourceTypeDatabase SourceType = "Database" + SourceTypeNone SourceType = "None" +) + +func PossibleValuesForSourceType() []string { + return []string{ + string(SourceTypeBackupFromId), + string(SourceTypeBackupFromTimestamp), + string(SourceTypeCloneToRefreshable), + string(SourceTypeCrossRegionDataguard), + string(SourceTypeCrossRegionDisasterRecovery), + string(SourceTypeDatabase), + string(SourceTypeNone), + } +} + +func (s *SourceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSourceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSourceType(input string) (*SourceType, error) { + vals := map[string]SourceType{ + "backupfromid": SourceTypeBackupFromId, + "backupfromtimestamp": SourceTypeBackupFromTimestamp, + "clonetorefreshable": SourceTypeCloneToRefreshable, + "crossregiondataguard": SourceTypeCrossRegionDataguard, + "crossregiondisasterrecovery": SourceTypeCrossRegionDisasterRecovery, + "database": SourceTypeDatabase, + "none": SourceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SourceType(input) + return &out, nil +} + +type SyntaxFormatType string + +const ( + SyntaxFormatTypeEzconnect SyntaxFormatType = "Ezconnect" + SyntaxFormatTypeEzconnectplus SyntaxFormatType = "Ezconnectplus" + SyntaxFormatTypeLong SyntaxFormatType = "Long" +) + +func PossibleValuesForSyntaxFormatType() []string { + return []string{ + string(SyntaxFormatTypeEzconnect), + string(SyntaxFormatTypeEzconnectplus), + string(SyntaxFormatTypeLong), + } +} + +func (s *SyntaxFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSyntaxFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSyntaxFormatType(input string) (*SyntaxFormatType, error) { + vals := map[string]SyntaxFormatType{ + "ezconnect": SyntaxFormatTypeEzconnect, + "ezconnectplus": SyntaxFormatTypeEzconnectplus, + "long": SyntaxFormatTypeLong, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SyntaxFormatType(input) + return &out, nil +} + +type TlsAuthenticationType string + +const ( + TlsAuthenticationTypeMutual TlsAuthenticationType = "Mutual" + TlsAuthenticationTypeServer TlsAuthenticationType = "Server" +) + +func PossibleValuesForTlsAuthenticationType() []string { + return []string{ + string(TlsAuthenticationTypeMutual), + string(TlsAuthenticationTypeServer), + } +} + +func (s *TlsAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTlsAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTlsAuthenticationType(input string) (*TlsAuthenticationType, error) { + vals := map[string]TlsAuthenticationType{ + "mutual": TlsAuthenticationTypeMutual, + "server": TlsAuthenticationTypeServer, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TlsAuthenticationType(input) + return &out, nil +} + +type WorkloadType string + +const ( + WorkloadTypeAJD WorkloadType = "AJD" + WorkloadTypeAPEX WorkloadType = "APEX" + WorkloadTypeDW WorkloadType = "DW" + WorkloadTypeOLTP WorkloadType = "OLTP" +) + +func PossibleValuesForWorkloadType() []string { + return []string{ + string(WorkloadTypeAJD), + string(WorkloadTypeAPEX), + string(WorkloadTypeDW), + string(WorkloadTypeOLTP), + } +} + +func (s *WorkloadType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWorkloadType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWorkloadType(input string) (*WorkloadType, error) { + vals := map[string]WorkloadType{ + "ajd": WorkloadTypeAJD, + "apex": WorkloadTypeAPEX, + "dw": WorkloadTypeDW, + "oltp": WorkloadTypeOLTP, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WorkloadType(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/id_autonomousdatabase.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/id_autonomousdatabase.go new file mode 100644 index 000000000000..6067f3c0ccaf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/id_autonomousdatabase.go @@ -0,0 +1,130 @@ +package autonomousdatabases + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&AutonomousDatabaseId{}) +} + +var _ resourceids.ResourceId = &AutonomousDatabaseId{} + +// AutonomousDatabaseId is a struct representing the Resource ID for a Autonomous Database +type AutonomousDatabaseId struct { + SubscriptionId string + ResourceGroupName string + AutonomousDatabaseName string +} + +// NewAutonomousDatabaseID returns a new AutonomousDatabaseId struct +func NewAutonomousDatabaseID(subscriptionId string, resourceGroupName string, autonomousDatabaseName string) AutonomousDatabaseId { + return AutonomousDatabaseId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + AutonomousDatabaseName: autonomousDatabaseName, + } +} + +// ParseAutonomousDatabaseID parses 'input' into a AutonomousDatabaseId +func ParseAutonomousDatabaseID(input string) (*AutonomousDatabaseId, error) { + parser := resourceids.NewParserFromResourceIdType(&AutonomousDatabaseId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AutonomousDatabaseId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseAutonomousDatabaseIDInsensitively parses 'input' case-insensitively into a AutonomousDatabaseId +// note: this method should only be used for API response data and not user input +func ParseAutonomousDatabaseIDInsensitively(input string) (*AutonomousDatabaseId, error) { + parser := resourceids.NewParserFromResourceIdType(&AutonomousDatabaseId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AutonomousDatabaseId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *AutonomousDatabaseId) 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.AutonomousDatabaseName, ok = input.Parsed["autonomousDatabaseName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "autonomousDatabaseName", input) + } + + return nil +} + +// ValidateAutonomousDatabaseID checks that 'input' can be parsed as a Autonomous Database ID +func ValidateAutonomousDatabaseID(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 := ParseAutonomousDatabaseID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Autonomous Database ID +func (id AutonomousDatabaseId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Oracle.Database/autonomousDatabases/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AutonomousDatabaseName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Autonomous Database ID +func (id AutonomousDatabaseId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticAutonomousDatabases", "autonomousDatabases", "autonomousDatabases"), + resourceids.UserSpecifiedSegment("autonomousDatabaseName", "autonomousDatabaseName"), + } +} + +// String returns a human-readable description of this Autonomous Database ID +func (id AutonomousDatabaseId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Autonomous Database Name: %q", id.AutonomousDatabaseName), + } + return fmt.Sprintf("Autonomous Database (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_createorupdate.go new file mode 100644 index 000000000000..7ed7016c55f4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_createorupdate.go @@ -0,0 +1,75 @@ +package autonomousdatabases + +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 CreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *AutonomousDatabase +} + +// CreateOrUpdate ... +func (c AutonomousDatabasesClient) CreateOrUpdate(ctx context.Context, id AutonomousDatabaseId, input AutonomousDatabase) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + 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 +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c AutonomousDatabasesClient) CreateOrUpdateThenPoll(ctx context.Context, id AutonomousDatabaseId, input AutonomousDatabase) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_delete.go new file mode 100644 index 000000000000..b2629b1ffd3e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_delete.go @@ -0,0 +1,70 @@ +package autonomousdatabases + +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 DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c AutonomousDatabasesClient) Delete(ctx context.Context, id AutonomousDatabaseId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + 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 +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c AutonomousDatabasesClient) DeleteThenPoll(ctx context.Context, id AutonomousDatabaseId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_failover.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_failover.go new file mode 100644 index 000000000000..ddad38876884 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_failover.go @@ -0,0 +1,75 @@ +package autonomousdatabases + +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 FailoverOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *AutonomousDatabase +} + +// Failover ... +func (c AutonomousDatabasesClient) Failover(ctx context.Context, id AutonomousDatabaseId, input PeerDbDetails) (result FailoverOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/failover", 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 +} + +// FailoverThenPoll performs Failover then polls until it's completed +func (c AutonomousDatabasesClient) FailoverThenPoll(ctx context.Context, id AutonomousDatabaseId, input PeerDbDetails) error { + result, err := c.Failover(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Failover: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Failover: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_generatewallet.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_generatewallet.go new file mode 100644 index 000000000000..0c49da12ec8d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_generatewallet.go @@ -0,0 +1,58 @@ +package autonomousdatabases + +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 GenerateWalletOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *AutonomousDatabaseWalletFile +} + +// GenerateWallet ... +func (c AutonomousDatabasesClient) GenerateWallet(ctx context.Context, id AutonomousDatabaseId, input GenerateAutonomousDatabaseWalletDetails) (result GenerateWalletOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/generateWallet", 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 AutonomousDatabaseWalletFile + 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/oracledatabase/2024-06-01/autonomousdatabases/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_get.go new file mode 100644 index 000000000000..048934eeb4ed --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_get.go @@ -0,0 +1,53 @@ +package autonomousdatabases + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *AutonomousDatabase +} + +// Get ... +func (c AutonomousDatabasesClient) Get(ctx context.Context, id AutonomousDatabaseId) (result GetOperationResponse, 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 AutonomousDatabase + 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/oracledatabase/2024-06-01/autonomousdatabases/method_listbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_listbyresourcegroup.go new file mode 100644 index 000000000000..fb66603459bf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_listbyresourcegroup.go @@ -0,0 +1,106 @@ +package autonomousdatabases + +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 ListByResourceGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]AutonomousDatabase +} + +type ListByResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []AutonomousDatabase +} + +type ListByResourceGroupCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByResourceGroupCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByResourceGroup ... +func (c AutonomousDatabasesClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ListByResourceGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByResourceGroupCustomPager{}, + Path: fmt.Sprintf("%s/providers/Oracle.Database/autonomousDatabases", 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 *[]AutonomousDatabase `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByResourceGroupComplete retrieves all the results into a single object +func (c AutonomousDatabasesClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, AutonomousDatabaseOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c AutonomousDatabasesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate AutonomousDatabaseOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]AutonomousDatabase, 0) + + resp, err := c.ListByResourceGroup(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListByResourceGroupCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_listbysubscription.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_listbysubscription.go new file mode 100644 index 000000000000..1cfc10b04884 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_listbysubscription.go @@ -0,0 +1,106 @@ +package autonomousdatabases + +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 ListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]AutonomousDatabase +} + +type ListBySubscriptionCompleteResult struct { + LatestHttpResponse *http.Response + Items []AutonomousDatabase +} + +type ListBySubscriptionCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListBySubscriptionCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListBySubscription ... +func (c AutonomousDatabasesClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListBySubscriptionCustomPager{}, + Path: fmt.Sprintf("%s/providers/Oracle.Database/autonomousDatabases", 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 *[]AutonomousDatabase `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListBySubscriptionComplete retrieves all the results into a single object +func (c AutonomousDatabasesClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { + return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, AutonomousDatabaseOperationPredicate{}) +} + +// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c AutonomousDatabasesClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate AutonomousDatabaseOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { + items := make([]AutonomousDatabase, 0) + + resp, err := c.ListBySubscription(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListBySubscriptionCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_restore.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_restore.go new file mode 100644 index 000000000000..c6e860c8c2d0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_restore.go @@ -0,0 +1,75 @@ +package autonomousdatabases + +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 RestoreOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *AutonomousDatabase +} + +// Restore ... +func (c AutonomousDatabasesClient) Restore(ctx context.Context, id AutonomousDatabaseId, input RestoreAutonomousDatabaseDetails) (result RestoreOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/restore", 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 +} + +// RestoreThenPoll performs Restore then polls until it's completed +func (c AutonomousDatabasesClient) RestoreThenPoll(ctx context.Context, id AutonomousDatabaseId, input RestoreAutonomousDatabaseDetails) error { + result, err := c.Restore(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Restore: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Restore: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_shrink.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_shrink.go new file mode 100644 index 000000000000..baed1bbf367a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_shrink.go @@ -0,0 +1,71 @@ +package autonomousdatabases + +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 ShrinkOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *AutonomousDatabase +} + +// Shrink ... +func (c AutonomousDatabasesClient) Shrink(ctx context.Context, id AutonomousDatabaseId) (result ShrinkOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/shrink", 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 +} + +// ShrinkThenPoll performs Shrink then polls until it's completed +func (c AutonomousDatabasesClient) ShrinkThenPoll(ctx context.Context, id AutonomousDatabaseId) error { + result, err := c.Shrink(ctx, id) + if err != nil { + return fmt.Errorf("performing Shrink: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Shrink: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_switchover.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_switchover.go new file mode 100644 index 000000000000..8b21a43f8512 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_switchover.go @@ -0,0 +1,75 @@ +package autonomousdatabases + +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 SwitchoverOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *AutonomousDatabase +} + +// Switchover ... +func (c AutonomousDatabasesClient) Switchover(ctx context.Context, id AutonomousDatabaseId, input PeerDbDetails) (result SwitchoverOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/switchover", 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 +} + +// SwitchoverThenPoll performs Switchover then polls until it's completed +func (c AutonomousDatabasesClient) SwitchoverThenPoll(ctx context.Context, id AutonomousDatabaseId, input PeerDbDetails) error { + result, err := c.Switchover(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Switchover: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Switchover: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_update.go new file mode 100644 index 000000000000..dea97562d892 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/method_update.go @@ -0,0 +1,75 @@ +package autonomousdatabases + +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 UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *AutonomousDatabase +} + +// Update ... +func (c AutonomousDatabasesClient) Update(ctx context.Context, id AutonomousDatabaseId, input AutonomousDatabaseUpdate) (result UpdateOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c AutonomousDatabasesClient) UpdateThenPoll(ctx context.Context, id AutonomousDatabaseId, input AutonomousDatabaseUpdate) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_allconnectionstringtype.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_allconnectionstringtype.go new file mode 100644 index 000000000000..a0c89f0608f1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_allconnectionstringtype.go @@ -0,0 +1,10 @@ +package autonomousdatabases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AllConnectionStringType struct { + High *string `json:"high,omitempty"` + Low *string `json:"low,omitempty"` + Medium *string `json:"medium,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_apexdetailstype.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_apexdetailstype.go new file mode 100644 index 000000000000..420d585f5d19 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_apexdetailstype.go @@ -0,0 +1,9 @@ +package autonomousdatabases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApexDetailsType struct { + ApexVersion *string `json:"apexVersion,omitempty"` + OrdsVersion *string `json:"ordsVersion,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabase.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabase.go new file mode 100644 index 000000000000..28287d73f00d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabase.go @@ -0,0 +1,59 @@ +package autonomousdatabases + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDatabase struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties AutonomousDatabaseBaseProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Unmarshaler = &AutonomousDatabase{} + +func (s *AutonomousDatabase) UnmarshalJSON(bytes []byte) error { + var decoded struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` + } + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + + s.Id = decoded.Id + s.Location = decoded.Location + s.Name = decoded.Name + s.SystemData = decoded.SystemData + s.Tags = decoded.Tags + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling AutonomousDatabase into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := UnmarshalAutonomousDatabaseBasePropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'AutonomousDatabase': %+v", err) + } + s.Properties = impl + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasebaseproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasebaseproperties.go new file mode 100644 index 000000000000..def86bd6e9ef --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasebaseproperties.go @@ -0,0 +1,157 @@ +package autonomousdatabases + +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 AutonomousDatabaseBaseProperties interface { + AutonomousDatabaseBaseProperties() BaseAutonomousDatabaseBasePropertiesImpl +} + +var _ AutonomousDatabaseBaseProperties = BaseAutonomousDatabaseBasePropertiesImpl{} + +type BaseAutonomousDatabaseBasePropertiesImpl struct { + ActualUsedDataStorageSizeInTbs *float64 `json:"actualUsedDataStorageSizeInTbs,omitempty"` + AdminPassword *string `json:"adminPassword,omitempty"` + AllocatedStorageSizeInTbs *float64 `json:"allocatedStorageSizeInTbs,omitempty"` + ApexDetails *ApexDetailsType `json:"apexDetails,omitempty"` + AutonomousDatabaseId *string `json:"autonomousDatabaseId,omitempty"` + AutonomousMaintenanceScheduleType *AutonomousMaintenanceScheduleType `json:"autonomousMaintenanceScheduleType,omitempty"` + AvailableUpgradeVersions *[]string `json:"availableUpgradeVersions,omitempty"` + BackupRetentionPeriodInDays *int64 `json:"backupRetentionPeriodInDays,omitempty"` + CharacterSet *string `json:"characterSet,omitempty"` + ComputeCount *float64 `json:"computeCount,omitempty"` + ComputeModel *ComputeModel `json:"computeModel,omitempty"` + ConnectionStrings *ConnectionStringType `json:"connectionStrings,omitempty"` + ConnectionURLs *ConnectionURLType `json:"connectionUrls,omitempty"` + CpuCoreCount *int64 `json:"cpuCoreCount,omitempty"` + CustomerContacts *[]CustomerContact `json:"customerContacts,omitempty"` + DataBaseType DataBaseType `json:"dataBaseType"` + DataSafeStatus *DataSafeStatusType `json:"dataSafeStatus,omitempty"` + DataStorageSizeInGbs *int64 `json:"dataStorageSizeInGbs,omitempty"` + DataStorageSizeInTbs *int64 `json:"dataStorageSizeInTbs,omitempty"` + DatabaseEdition *DatabaseEditionType `json:"databaseEdition,omitempty"` + DbVersion *string `json:"dbVersion,omitempty"` + DbWorkload *WorkloadType `json:"dbWorkload,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + FailedDataRecoveryInSeconds *int64 `json:"failedDataRecoveryInSeconds,omitempty"` + InMemoryAreaInGbs *int64 `json:"inMemoryAreaInGbs,omitempty"` + IsAutoScalingEnabled *bool `json:"isAutoScalingEnabled,omitempty"` + IsAutoScalingForStorageEnabled *bool `json:"isAutoScalingForStorageEnabled,omitempty"` + IsLocalDataGuardEnabled *bool `json:"isLocalDataGuardEnabled,omitempty"` + IsMtlsConnectionRequired *bool `json:"isMtlsConnectionRequired,omitempty"` + IsPreview *bool `json:"isPreview,omitempty"` + IsPreviewVersionWithServiceTermsAccepted *bool `json:"isPreviewVersionWithServiceTermsAccepted,omitempty"` + IsRemoteDataGuardEnabled *bool `json:"isRemoteDataGuardEnabled,omitempty"` + LicenseModel *LicenseModel `json:"licenseModel,omitempty"` + LifecycleDetails *string `json:"lifecycleDetails,omitempty"` + LifecycleState *AutonomousDatabaseLifecycleState `json:"lifecycleState,omitempty"` + LocalAdgAutoFailoverMaxDataLossLimit *int64 `json:"localAdgAutoFailoverMaxDataLossLimit,omitempty"` + LocalDisasterRecoveryType *DisasterRecoveryType `json:"localDisasterRecoveryType,omitempty"` + LocalStandbyDb *AutonomousDatabaseStandbySummary `json:"localStandbyDb,omitempty"` + LongTermBackupSchedule *LongTermBackUpScheduleDetails `json:"longTermBackupSchedule,omitempty"` + MemoryPerOracleComputeUnitInGbs *int64 `json:"memoryPerOracleComputeUnitInGbs,omitempty"` + NcharacterSet *string `json:"ncharacterSet,omitempty"` + NextLongTermBackupTimeStamp *string `json:"nextLongTermBackupTimeStamp,omitempty"` + OciURL *string `json:"ociUrl,omitempty"` + Ocid *string `json:"ocid,omitempty"` + OpenMode *OpenModeType `json:"openMode,omitempty"` + OperationsInsightsStatus *OperationsInsightsStatusType `json:"operationsInsightsStatus,omitempty"` + PeerDbId *string `json:"peerDbId,omitempty"` + PeerDbIds *[]string `json:"peerDbIds,omitempty"` + PermissionLevel *PermissionLevelType `json:"permissionLevel,omitempty"` + PrivateEndpoint *string `json:"privateEndpoint,omitempty"` + PrivateEndpointIP *string `json:"privateEndpointIp,omitempty"` + PrivateEndpointLabel *string `json:"privateEndpointLabel,omitempty"` + ProvisionableCPUs *[]int64 `json:"provisionableCpus,omitempty"` + ProvisioningState *AzureResourceProvisioningState `json:"provisioningState,omitempty"` + Role *RoleType `json:"role,omitempty"` + ScheduledOperations *ScheduledOperationsType `json:"scheduledOperations,omitempty"` + ServiceConsoleURL *string `json:"serviceConsoleUrl,omitempty"` + SqlWebDeveloperURL *string `json:"sqlWebDeveloperUrl,omitempty"` + SubnetId *string `json:"subnetId,omitempty"` + SupportedRegionsToCloneTo *[]string `json:"supportedRegionsToCloneTo,omitempty"` + TimeCreated *string `json:"timeCreated,omitempty"` + TimeDataGuardRoleChanged *string `json:"timeDataGuardRoleChanged,omitempty"` + TimeDeletionOfFreeAutonomousDatabase *string `json:"timeDeletionOfFreeAutonomousDatabase,omitempty"` + TimeLocalDataGuardEnabled *string `json:"timeLocalDataGuardEnabled,omitempty"` + TimeMaintenanceBegin *string `json:"timeMaintenanceBegin,omitempty"` + TimeMaintenanceEnd *string `json:"timeMaintenanceEnd,omitempty"` + TimeOfLastFailover *string `json:"timeOfLastFailover,omitempty"` + TimeOfLastRefresh *string `json:"timeOfLastRefresh,omitempty"` + TimeOfLastRefreshPoint *string `json:"timeOfLastRefreshPoint,omitempty"` + TimeOfLastSwitchover *string `json:"timeOfLastSwitchover,omitempty"` + TimeReclamationOfFreeAutonomousDatabase *string `json:"timeReclamationOfFreeAutonomousDatabase,omitempty"` + UsedDataStorageSizeInGbs *int64 `json:"usedDataStorageSizeInGbs,omitempty"` + UsedDataStorageSizeInTbs *int64 `json:"usedDataStorageSizeInTbs,omitempty"` + VnetId *string `json:"vnetId,omitempty"` + WhitelistedIPs *[]string `json:"whitelistedIps,omitempty"` +} + +func (s BaseAutonomousDatabaseBasePropertiesImpl) AutonomousDatabaseBaseProperties() BaseAutonomousDatabaseBasePropertiesImpl { + return s +} + +var _ AutonomousDatabaseBaseProperties = RawAutonomousDatabaseBasePropertiesImpl{} + +// RawAutonomousDatabaseBasePropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawAutonomousDatabaseBasePropertiesImpl struct { + autonomousDatabaseBaseProperties BaseAutonomousDatabaseBasePropertiesImpl + Type string + Values map[string]interface{} +} + +func (s RawAutonomousDatabaseBasePropertiesImpl) AutonomousDatabaseBaseProperties() BaseAutonomousDatabaseBasePropertiesImpl { + return s.autonomousDatabaseBaseProperties +} + +func UnmarshalAutonomousDatabaseBasePropertiesImplementation(input []byte) (AutonomousDatabaseBaseProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling AutonomousDatabaseBaseProperties into map[string]interface: %+v", err) + } + + var value string + if v, ok := temp["dataBaseType"]; ok { + value = fmt.Sprintf("%v", v) + } + + if strings.EqualFold(value, "Clone") { + var out AutonomousDatabaseCloneProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AutonomousDatabaseCloneProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Regular") { + var out AutonomousDatabaseProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into AutonomousDatabaseProperties: %+v", err) + } + return out, nil + } + + var parent BaseAutonomousDatabaseBasePropertiesImpl + if err := json.Unmarshal(input, &parent); err != nil { + return nil, fmt.Errorf("unmarshaling into BaseAutonomousDatabaseBasePropertiesImpl: %+v", err) + } + + return RawAutonomousDatabaseBasePropertiesImpl{ + autonomousDatabaseBaseProperties: parent, + Type: value, + Values: temp, + }, nil + +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasecloneproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasecloneproperties.go new file mode 100644 index 000000000000..da3cc5ce5662 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasecloneproperties.go @@ -0,0 +1,256 @@ +package autonomousdatabases + +import ( + "encoding/json" + "fmt" + "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. + +var _ AutonomousDatabaseBaseProperties = AutonomousDatabaseCloneProperties{} + +type AutonomousDatabaseCloneProperties struct { + CloneType CloneType `json:"cloneType"` + IsReconnectCloneEnabled *bool `json:"isReconnectCloneEnabled,omitempty"` + IsRefreshableClone *bool `json:"isRefreshableClone,omitempty"` + RefreshableModel *RefreshableModelType `json:"refreshableModel,omitempty"` + RefreshableStatus *RefreshableStatusType `json:"refreshableStatus,omitempty"` + Source *SourceType `json:"source,omitempty"` + SourceId string `json:"sourceId"` + TimeUntilReconnectCloneEnabled *string `json:"timeUntilReconnectCloneEnabled,omitempty"` + + // Fields inherited from AutonomousDatabaseBaseProperties + + ActualUsedDataStorageSizeInTbs *float64 `json:"actualUsedDataStorageSizeInTbs,omitempty"` + AdminPassword *string `json:"adminPassword,omitempty"` + AllocatedStorageSizeInTbs *float64 `json:"allocatedStorageSizeInTbs,omitempty"` + ApexDetails *ApexDetailsType `json:"apexDetails,omitempty"` + AutonomousDatabaseId *string `json:"autonomousDatabaseId,omitempty"` + AutonomousMaintenanceScheduleType *AutonomousMaintenanceScheduleType `json:"autonomousMaintenanceScheduleType,omitempty"` + AvailableUpgradeVersions *[]string `json:"availableUpgradeVersions,omitempty"` + BackupRetentionPeriodInDays *int64 `json:"backupRetentionPeriodInDays,omitempty"` + CharacterSet *string `json:"characterSet,omitempty"` + ComputeCount *float64 `json:"computeCount,omitempty"` + ComputeModel *ComputeModel `json:"computeModel,omitempty"` + ConnectionStrings *ConnectionStringType `json:"connectionStrings,omitempty"` + ConnectionURLs *ConnectionURLType `json:"connectionUrls,omitempty"` + CpuCoreCount *int64 `json:"cpuCoreCount,omitempty"` + CustomerContacts *[]CustomerContact `json:"customerContacts,omitempty"` + DataBaseType DataBaseType `json:"dataBaseType"` + DataSafeStatus *DataSafeStatusType `json:"dataSafeStatus,omitempty"` + DataStorageSizeInGbs *int64 `json:"dataStorageSizeInGbs,omitempty"` + DataStorageSizeInTbs *int64 `json:"dataStorageSizeInTbs,omitempty"` + DatabaseEdition *DatabaseEditionType `json:"databaseEdition,omitempty"` + DbVersion *string `json:"dbVersion,omitempty"` + DbWorkload *WorkloadType `json:"dbWorkload,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + FailedDataRecoveryInSeconds *int64 `json:"failedDataRecoveryInSeconds,omitempty"` + InMemoryAreaInGbs *int64 `json:"inMemoryAreaInGbs,omitempty"` + IsAutoScalingEnabled *bool `json:"isAutoScalingEnabled,omitempty"` + IsAutoScalingForStorageEnabled *bool `json:"isAutoScalingForStorageEnabled,omitempty"` + IsLocalDataGuardEnabled *bool `json:"isLocalDataGuardEnabled,omitempty"` + IsMtlsConnectionRequired *bool `json:"isMtlsConnectionRequired,omitempty"` + IsPreview *bool `json:"isPreview,omitempty"` + IsPreviewVersionWithServiceTermsAccepted *bool `json:"isPreviewVersionWithServiceTermsAccepted,omitempty"` + IsRemoteDataGuardEnabled *bool `json:"isRemoteDataGuardEnabled,omitempty"` + LicenseModel *LicenseModel `json:"licenseModel,omitempty"` + LifecycleDetails *string `json:"lifecycleDetails,omitempty"` + LifecycleState *AutonomousDatabaseLifecycleState `json:"lifecycleState,omitempty"` + LocalAdgAutoFailoverMaxDataLossLimit *int64 `json:"localAdgAutoFailoverMaxDataLossLimit,omitempty"` + LocalDisasterRecoveryType *DisasterRecoveryType `json:"localDisasterRecoveryType,omitempty"` + LocalStandbyDb *AutonomousDatabaseStandbySummary `json:"localStandbyDb,omitempty"` + LongTermBackupSchedule *LongTermBackUpScheduleDetails `json:"longTermBackupSchedule,omitempty"` + MemoryPerOracleComputeUnitInGbs *int64 `json:"memoryPerOracleComputeUnitInGbs,omitempty"` + NcharacterSet *string `json:"ncharacterSet,omitempty"` + NextLongTermBackupTimeStamp *string `json:"nextLongTermBackupTimeStamp,omitempty"` + OciURL *string `json:"ociUrl,omitempty"` + Ocid *string `json:"ocid,omitempty"` + OpenMode *OpenModeType `json:"openMode,omitempty"` + OperationsInsightsStatus *OperationsInsightsStatusType `json:"operationsInsightsStatus,omitempty"` + PeerDbId *string `json:"peerDbId,omitempty"` + PeerDbIds *[]string `json:"peerDbIds,omitempty"` + PermissionLevel *PermissionLevelType `json:"permissionLevel,omitempty"` + PrivateEndpoint *string `json:"privateEndpoint,omitempty"` + PrivateEndpointIP *string `json:"privateEndpointIp,omitempty"` + PrivateEndpointLabel *string `json:"privateEndpointLabel,omitempty"` + ProvisionableCPUs *[]int64 `json:"provisionableCpus,omitempty"` + ProvisioningState *AzureResourceProvisioningState `json:"provisioningState,omitempty"` + Role *RoleType `json:"role,omitempty"` + ScheduledOperations *ScheduledOperationsType `json:"scheduledOperations,omitempty"` + ServiceConsoleURL *string `json:"serviceConsoleUrl,omitempty"` + SqlWebDeveloperURL *string `json:"sqlWebDeveloperUrl,omitempty"` + SubnetId *string `json:"subnetId,omitempty"` + SupportedRegionsToCloneTo *[]string `json:"supportedRegionsToCloneTo,omitempty"` + TimeCreated *string `json:"timeCreated,omitempty"` + TimeDataGuardRoleChanged *string `json:"timeDataGuardRoleChanged,omitempty"` + TimeDeletionOfFreeAutonomousDatabase *string `json:"timeDeletionOfFreeAutonomousDatabase,omitempty"` + TimeLocalDataGuardEnabled *string `json:"timeLocalDataGuardEnabled,omitempty"` + TimeMaintenanceBegin *string `json:"timeMaintenanceBegin,omitempty"` + TimeMaintenanceEnd *string `json:"timeMaintenanceEnd,omitempty"` + TimeOfLastFailover *string `json:"timeOfLastFailover,omitempty"` + TimeOfLastRefresh *string `json:"timeOfLastRefresh,omitempty"` + TimeOfLastRefreshPoint *string `json:"timeOfLastRefreshPoint,omitempty"` + TimeOfLastSwitchover *string `json:"timeOfLastSwitchover,omitempty"` + TimeReclamationOfFreeAutonomousDatabase *string `json:"timeReclamationOfFreeAutonomousDatabase,omitempty"` + UsedDataStorageSizeInGbs *int64 `json:"usedDataStorageSizeInGbs,omitempty"` + UsedDataStorageSizeInTbs *int64 `json:"usedDataStorageSizeInTbs,omitempty"` + VnetId *string `json:"vnetId,omitempty"` + WhitelistedIPs *[]string `json:"whitelistedIps,omitempty"` +} + +func (s AutonomousDatabaseCloneProperties) AutonomousDatabaseBaseProperties() BaseAutonomousDatabaseBasePropertiesImpl { + return BaseAutonomousDatabaseBasePropertiesImpl{ + ActualUsedDataStorageSizeInTbs: s.ActualUsedDataStorageSizeInTbs, + AdminPassword: s.AdminPassword, + AllocatedStorageSizeInTbs: s.AllocatedStorageSizeInTbs, + ApexDetails: s.ApexDetails, + AutonomousDatabaseId: s.AutonomousDatabaseId, + AutonomousMaintenanceScheduleType: s.AutonomousMaintenanceScheduleType, + AvailableUpgradeVersions: s.AvailableUpgradeVersions, + BackupRetentionPeriodInDays: s.BackupRetentionPeriodInDays, + CharacterSet: s.CharacterSet, + ComputeCount: s.ComputeCount, + ComputeModel: s.ComputeModel, + ConnectionStrings: s.ConnectionStrings, + ConnectionURLs: s.ConnectionURLs, + CpuCoreCount: s.CpuCoreCount, + CustomerContacts: s.CustomerContacts, + DataBaseType: s.DataBaseType, + DataSafeStatus: s.DataSafeStatus, + DataStorageSizeInGbs: s.DataStorageSizeInGbs, + DataStorageSizeInTbs: s.DataStorageSizeInTbs, + DatabaseEdition: s.DatabaseEdition, + DbVersion: s.DbVersion, + DbWorkload: s.DbWorkload, + DisplayName: s.DisplayName, + FailedDataRecoveryInSeconds: s.FailedDataRecoveryInSeconds, + InMemoryAreaInGbs: s.InMemoryAreaInGbs, + IsAutoScalingEnabled: s.IsAutoScalingEnabled, + IsAutoScalingForStorageEnabled: s.IsAutoScalingForStorageEnabled, + IsLocalDataGuardEnabled: s.IsLocalDataGuardEnabled, + IsMtlsConnectionRequired: s.IsMtlsConnectionRequired, + IsPreview: s.IsPreview, + IsPreviewVersionWithServiceTermsAccepted: s.IsPreviewVersionWithServiceTermsAccepted, + IsRemoteDataGuardEnabled: s.IsRemoteDataGuardEnabled, + LicenseModel: s.LicenseModel, + LifecycleDetails: s.LifecycleDetails, + LifecycleState: s.LifecycleState, + LocalAdgAutoFailoverMaxDataLossLimit: s.LocalAdgAutoFailoverMaxDataLossLimit, + LocalDisasterRecoveryType: s.LocalDisasterRecoveryType, + LocalStandbyDb: s.LocalStandbyDb, + LongTermBackupSchedule: s.LongTermBackupSchedule, + MemoryPerOracleComputeUnitInGbs: s.MemoryPerOracleComputeUnitInGbs, + NcharacterSet: s.NcharacterSet, + NextLongTermBackupTimeStamp: s.NextLongTermBackupTimeStamp, + OciURL: s.OciURL, + Ocid: s.Ocid, + OpenMode: s.OpenMode, + OperationsInsightsStatus: s.OperationsInsightsStatus, + PeerDbId: s.PeerDbId, + PeerDbIds: s.PeerDbIds, + PermissionLevel: s.PermissionLevel, + PrivateEndpoint: s.PrivateEndpoint, + PrivateEndpointIP: s.PrivateEndpointIP, + PrivateEndpointLabel: s.PrivateEndpointLabel, + ProvisionableCPUs: s.ProvisionableCPUs, + ProvisioningState: s.ProvisioningState, + Role: s.Role, + ScheduledOperations: s.ScheduledOperations, + ServiceConsoleURL: s.ServiceConsoleURL, + SqlWebDeveloperURL: s.SqlWebDeveloperURL, + SubnetId: s.SubnetId, + SupportedRegionsToCloneTo: s.SupportedRegionsToCloneTo, + TimeCreated: s.TimeCreated, + TimeDataGuardRoleChanged: s.TimeDataGuardRoleChanged, + TimeDeletionOfFreeAutonomousDatabase: s.TimeDeletionOfFreeAutonomousDatabase, + TimeLocalDataGuardEnabled: s.TimeLocalDataGuardEnabled, + TimeMaintenanceBegin: s.TimeMaintenanceBegin, + TimeMaintenanceEnd: s.TimeMaintenanceEnd, + TimeOfLastFailover: s.TimeOfLastFailover, + TimeOfLastRefresh: s.TimeOfLastRefresh, + TimeOfLastRefreshPoint: s.TimeOfLastRefreshPoint, + TimeOfLastSwitchover: s.TimeOfLastSwitchover, + TimeReclamationOfFreeAutonomousDatabase: s.TimeReclamationOfFreeAutonomousDatabase, + UsedDataStorageSizeInGbs: s.UsedDataStorageSizeInGbs, + UsedDataStorageSizeInTbs: s.UsedDataStorageSizeInTbs, + VnetId: s.VnetId, + WhitelistedIPs: s.WhitelistedIPs, + } +} + +func (o *AutonomousDatabaseCloneProperties) GetNextLongTermBackupTimeStampAsTime() (*time.Time, error) { + if o.NextLongTermBackupTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.NextLongTermBackupTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *AutonomousDatabaseCloneProperties) SetNextLongTermBackupTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.NextLongTermBackupTimeStamp = &formatted +} + +func (o *AutonomousDatabaseCloneProperties) GetTimeCreatedAsTime() (*time.Time, error) { + if o.TimeCreated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeCreated, "2006-01-02T15:04:05Z07:00") +} + +func (o *AutonomousDatabaseCloneProperties) SetTimeCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeCreated = &formatted +} + +func (o *AutonomousDatabaseCloneProperties) GetTimeMaintenanceBeginAsTime() (*time.Time, error) { + if o.TimeMaintenanceBegin == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeMaintenanceBegin, "2006-01-02T15:04:05Z07:00") +} + +func (o *AutonomousDatabaseCloneProperties) SetTimeMaintenanceBeginAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeMaintenanceBegin = &formatted +} + +func (o *AutonomousDatabaseCloneProperties) GetTimeMaintenanceEndAsTime() (*time.Time, error) { + if o.TimeMaintenanceEnd == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeMaintenanceEnd, "2006-01-02T15:04:05Z07:00") +} + +func (o *AutonomousDatabaseCloneProperties) SetTimeMaintenanceEndAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeMaintenanceEnd = &formatted +} + +var _ json.Marshaler = AutonomousDatabaseCloneProperties{} + +func (s AutonomousDatabaseCloneProperties) MarshalJSON() ([]byte, error) { + type wrapper AutonomousDatabaseCloneProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AutonomousDatabaseCloneProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AutonomousDatabaseCloneProperties: %+v", err) + } + + decoded["dataBaseType"] = "Clone" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AutonomousDatabaseCloneProperties: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabaseproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabaseproperties.go new file mode 100644 index 000000000000..d465693ca1c5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabaseproperties.go @@ -0,0 +1,248 @@ +package autonomousdatabases + +import ( + "encoding/json" + "fmt" + "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. + +var _ AutonomousDatabaseBaseProperties = AutonomousDatabaseProperties{} + +type AutonomousDatabaseProperties struct { + + // Fields inherited from AutonomousDatabaseBaseProperties + + ActualUsedDataStorageSizeInTbs *float64 `json:"actualUsedDataStorageSizeInTbs,omitempty"` + AdminPassword *string `json:"adminPassword,omitempty"` + AllocatedStorageSizeInTbs *float64 `json:"allocatedStorageSizeInTbs,omitempty"` + ApexDetails *ApexDetailsType `json:"apexDetails,omitempty"` + AutonomousDatabaseId *string `json:"autonomousDatabaseId,omitempty"` + AutonomousMaintenanceScheduleType *AutonomousMaintenanceScheduleType `json:"autonomousMaintenanceScheduleType,omitempty"` + AvailableUpgradeVersions *[]string `json:"availableUpgradeVersions,omitempty"` + BackupRetentionPeriodInDays *int64 `json:"backupRetentionPeriodInDays,omitempty"` + CharacterSet *string `json:"characterSet,omitempty"` + ComputeCount *float64 `json:"computeCount,omitempty"` + ComputeModel *ComputeModel `json:"computeModel,omitempty"` + ConnectionStrings *ConnectionStringType `json:"connectionStrings,omitempty"` + ConnectionURLs *ConnectionURLType `json:"connectionUrls,omitempty"` + CpuCoreCount *int64 `json:"cpuCoreCount,omitempty"` + CustomerContacts *[]CustomerContact `json:"customerContacts,omitempty"` + DataBaseType DataBaseType `json:"dataBaseType"` + DataSafeStatus *DataSafeStatusType `json:"dataSafeStatus,omitempty"` + DataStorageSizeInGbs *int64 `json:"dataStorageSizeInGbs,omitempty"` + DataStorageSizeInTbs *int64 `json:"dataStorageSizeInTbs,omitempty"` + DatabaseEdition *DatabaseEditionType `json:"databaseEdition,omitempty"` + DbVersion *string `json:"dbVersion,omitempty"` + DbWorkload *WorkloadType `json:"dbWorkload,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + FailedDataRecoveryInSeconds *int64 `json:"failedDataRecoveryInSeconds,omitempty"` + InMemoryAreaInGbs *int64 `json:"inMemoryAreaInGbs,omitempty"` + IsAutoScalingEnabled *bool `json:"isAutoScalingEnabled,omitempty"` + IsAutoScalingForStorageEnabled *bool `json:"isAutoScalingForStorageEnabled,omitempty"` + IsLocalDataGuardEnabled *bool `json:"isLocalDataGuardEnabled,omitempty"` + IsMtlsConnectionRequired *bool `json:"isMtlsConnectionRequired,omitempty"` + IsPreview *bool `json:"isPreview,omitempty"` + IsPreviewVersionWithServiceTermsAccepted *bool `json:"isPreviewVersionWithServiceTermsAccepted,omitempty"` + IsRemoteDataGuardEnabled *bool `json:"isRemoteDataGuardEnabled,omitempty"` + LicenseModel *LicenseModel `json:"licenseModel,omitempty"` + LifecycleDetails *string `json:"lifecycleDetails,omitempty"` + LifecycleState *AutonomousDatabaseLifecycleState `json:"lifecycleState,omitempty"` + LocalAdgAutoFailoverMaxDataLossLimit *int64 `json:"localAdgAutoFailoverMaxDataLossLimit,omitempty"` + LocalDisasterRecoveryType *DisasterRecoveryType `json:"localDisasterRecoveryType,omitempty"` + LocalStandbyDb *AutonomousDatabaseStandbySummary `json:"localStandbyDb,omitempty"` + LongTermBackupSchedule *LongTermBackUpScheduleDetails `json:"longTermBackupSchedule,omitempty"` + MemoryPerOracleComputeUnitInGbs *int64 `json:"memoryPerOracleComputeUnitInGbs,omitempty"` + NcharacterSet *string `json:"ncharacterSet,omitempty"` + NextLongTermBackupTimeStamp *string `json:"nextLongTermBackupTimeStamp,omitempty"` + OciURL *string `json:"ociUrl,omitempty"` + Ocid *string `json:"ocid,omitempty"` + OpenMode *OpenModeType `json:"openMode,omitempty"` + OperationsInsightsStatus *OperationsInsightsStatusType `json:"operationsInsightsStatus,omitempty"` + PeerDbId *string `json:"peerDbId,omitempty"` + PeerDbIds *[]string `json:"peerDbIds,omitempty"` + PermissionLevel *PermissionLevelType `json:"permissionLevel,omitempty"` + PrivateEndpoint *string `json:"privateEndpoint,omitempty"` + PrivateEndpointIP *string `json:"privateEndpointIp,omitempty"` + PrivateEndpointLabel *string `json:"privateEndpointLabel,omitempty"` + ProvisionableCPUs *[]int64 `json:"provisionableCpus,omitempty"` + ProvisioningState *AzureResourceProvisioningState `json:"provisioningState,omitempty"` + Role *RoleType `json:"role,omitempty"` + ScheduledOperations *ScheduledOperationsType `json:"scheduledOperations,omitempty"` + ServiceConsoleURL *string `json:"serviceConsoleUrl,omitempty"` + SqlWebDeveloperURL *string `json:"sqlWebDeveloperUrl,omitempty"` + SubnetId *string `json:"subnetId,omitempty"` + SupportedRegionsToCloneTo *[]string `json:"supportedRegionsToCloneTo,omitempty"` + TimeCreated *string `json:"timeCreated,omitempty"` + TimeDataGuardRoleChanged *string `json:"timeDataGuardRoleChanged,omitempty"` + TimeDeletionOfFreeAutonomousDatabase *string `json:"timeDeletionOfFreeAutonomousDatabase,omitempty"` + TimeLocalDataGuardEnabled *string `json:"timeLocalDataGuardEnabled,omitempty"` + TimeMaintenanceBegin *string `json:"timeMaintenanceBegin,omitempty"` + TimeMaintenanceEnd *string `json:"timeMaintenanceEnd,omitempty"` + TimeOfLastFailover *string `json:"timeOfLastFailover,omitempty"` + TimeOfLastRefresh *string `json:"timeOfLastRefresh,omitempty"` + TimeOfLastRefreshPoint *string `json:"timeOfLastRefreshPoint,omitempty"` + TimeOfLastSwitchover *string `json:"timeOfLastSwitchover,omitempty"` + TimeReclamationOfFreeAutonomousDatabase *string `json:"timeReclamationOfFreeAutonomousDatabase,omitempty"` + UsedDataStorageSizeInGbs *int64 `json:"usedDataStorageSizeInGbs,omitempty"` + UsedDataStorageSizeInTbs *int64 `json:"usedDataStorageSizeInTbs,omitempty"` + VnetId *string `json:"vnetId,omitempty"` + WhitelistedIPs *[]string `json:"whitelistedIps,omitempty"` +} + +func (s AutonomousDatabaseProperties) AutonomousDatabaseBaseProperties() BaseAutonomousDatabaseBasePropertiesImpl { + return BaseAutonomousDatabaseBasePropertiesImpl{ + ActualUsedDataStorageSizeInTbs: s.ActualUsedDataStorageSizeInTbs, + AdminPassword: s.AdminPassword, + AllocatedStorageSizeInTbs: s.AllocatedStorageSizeInTbs, + ApexDetails: s.ApexDetails, + AutonomousDatabaseId: s.AutonomousDatabaseId, + AutonomousMaintenanceScheduleType: s.AutonomousMaintenanceScheduleType, + AvailableUpgradeVersions: s.AvailableUpgradeVersions, + BackupRetentionPeriodInDays: s.BackupRetentionPeriodInDays, + CharacterSet: s.CharacterSet, + ComputeCount: s.ComputeCount, + ComputeModel: s.ComputeModel, + ConnectionStrings: s.ConnectionStrings, + ConnectionURLs: s.ConnectionURLs, + CpuCoreCount: s.CpuCoreCount, + CustomerContacts: s.CustomerContacts, + DataBaseType: s.DataBaseType, + DataSafeStatus: s.DataSafeStatus, + DataStorageSizeInGbs: s.DataStorageSizeInGbs, + DataStorageSizeInTbs: s.DataStorageSizeInTbs, + DatabaseEdition: s.DatabaseEdition, + DbVersion: s.DbVersion, + DbWorkload: s.DbWorkload, + DisplayName: s.DisplayName, + FailedDataRecoveryInSeconds: s.FailedDataRecoveryInSeconds, + InMemoryAreaInGbs: s.InMemoryAreaInGbs, + IsAutoScalingEnabled: s.IsAutoScalingEnabled, + IsAutoScalingForStorageEnabled: s.IsAutoScalingForStorageEnabled, + IsLocalDataGuardEnabled: s.IsLocalDataGuardEnabled, + IsMtlsConnectionRequired: s.IsMtlsConnectionRequired, + IsPreview: s.IsPreview, + IsPreviewVersionWithServiceTermsAccepted: s.IsPreviewVersionWithServiceTermsAccepted, + IsRemoteDataGuardEnabled: s.IsRemoteDataGuardEnabled, + LicenseModel: s.LicenseModel, + LifecycleDetails: s.LifecycleDetails, + LifecycleState: s.LifecycleState, + LocalAdgAutoFailoverMaxDataLossLimit: s.LocalAdgAutoFailoverMaxDataLossLimit, + LocalDisasterRecoveryType: s.LocalDisasterRecoveryType, + LocalStandbyDb: s.LocalStandbyDb, + LongTermBackupSchedule: s.LongTermBackupSchedule, + MemoryPerOracleComputeUnitInGbs: s.MemoryPerOracleComputeUnitInGbs, + NcharacterSet: s.NcharacterSet, + NextLongTermBackupTimeStamp: s.NextLongTermBackupTimeStamp, + OciURL: s.OciURL, + Ocid: s.Ocid, + OpenMode: s.OpenMode, + OperationsInsightsStatus: s.OperationsInsightsStatus, + PeerDbId: s.PeerDbId, + PeerDbIds: s.PeerDbIds, + PermissionLevel: s.PermissionLevel, + PrivateEndpoint: s.PrivateEndpoint, + PrivateEndpointIP: s.PrivateEndpointIP, + PrivateEndpointLabel: s.PrivateEndpointLabel, + ProvisionableCPUs: s.ProvisionableCPUs, + ProvisioningState: s.ProvisioningState, + Role: s.Role, + ScheduledOperations: s.ScheduledOperations, + ServiceConsoleURL: s.ServiceConsoleURL, + SqlWebDeveloperURL: s.SqlWebDeveloperURL, + SubnetId: s.SubnetId, + SupportedRegionsToCloneTo: s.SupportedRegionsToCloneTo, + TimeCreated: s.TimeCreated, + TimeDataGuardRoleChanged: s.TimeDataGuardRoleChanged, + TimeDeletionOfFreeAutonomousDatabase: s.TimeDeletionOfFreeAutonomousDatabase, + TimeLocalDataGuardEnabled: s.TimeLocalDataGuardEnabled, + TimeMaintenanceBegin: s.TimeMaintenanceBegin, + TimeMaintenanceEnd: s.TimeMaintenanceEnd, + TimeOfLastFailover: s.TimeOfLastFailover, + TimeOfLastRefresh: s.TimeOfLastRefresh, + TimeOfLastRefreshPoint: s.TimeOfLastRefreshPoint, + TimeOfLastSwitchover: s.TimeOfLastSwitchover, + TimeReclamationOfFreeAutonomousDatabase: s.TimeReclamationOfFreeAutonomousDatabase, + UsedDataStorageSizeInGbs: s.UsedDataStorageSizeInGbs, + UsedDataStorageSizeInTbs: s.UsedDataStorageSizeInTbs, + VnetId: s.VnetId, + WhitelistedIPs: s.WhitelistedIPs, + } +} + +func (o *AutonomousDatabaseProperties) GetNextLongTermBackupTimeStampAsTime() (*time.Time, error) { + if o.NextLongTermBackupTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.NextLongTermBackupTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *AutonomousDatabaseProperties) SetNextLongTermBackupTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.NextLongTermBackupTimeStamp = &formatted +} + +func (o *AutonomousDatabaseProperties) GetTimeCreatedAsTime() (*time.Time, error) { + if o.TimeCreated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeCreated, "2006-01-02T15:04:05Z07:00") +} + +func (o *AutonomousDatabaseProperties) SetTimeCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeCreated = &formatted +} + +func (o *AutonomousDatabaseProperties) GetTimeMaintenanceBeginAsTime() (*time.Time, error) { + if o.TimeMaintenanceBegin == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeMaintenanceBegin, "2006-01-02T15:04:05Z07:00") +} + +func (o *AutonomousDatabaseProperties) SetTimeMaintenanceBeginAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeMaintenanceBegin = &formatted +} + +func (o *AutonomousDatabaseProperties) GetTimeMaintenanceEndAsTime() (*time.Time, error) { + if o.TimeMaintenanceEnd == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeMaintenanceEnd, "2006-01-02T15:04:05Z07:00") +} + +func (o *AutonomousDatabaseProperties) SetTimeMaintenanceEndAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeMaintenanceEnd = &formatted +} + +var _ json.Marshaler = AutonomousDatabaseProperties{} + +func (s AutonomousDatabaseProperties) MarshalJSON() ([]byte, error) { + type wrapper AutonomousDatabaseProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling AutonomousDatabaseProperties: %+v", err) + } + + var decoded map[string]interface{} + if err = json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling AutonomousDatabaseProperties: %+v", err) + } + + decoded["dataBaseType"] = "Regular" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling AutonomousDatabaseProperties: %+v", err) + } + + return encoded, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasestandbysummary.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasestandbysummary.go new file mode 100644 index 000000000000..484d3578c682 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasestandbysummary.go @@ -0,0 +1,12 @@ +package autonomousdatabases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDatabaseStandbySummary struct { + LagTimeInSeconds *int64 `json:"lagTimeInSeconds,omitempty"` + LifecycleDetails *string `json:"lifecycleDetails,omitempty"` + LifecycleState *AutonomousDatabaseLifecycleState `json:"lifecycleState,omitempty"` + TimeDataGuardRoleChanged *string `json:"timeDataGuardRoleChanged,omitempty"` + TimeDisasterRecoveryRoleChanged *string `json:"timeDisasterRecoveryRoleChanged,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabaseupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabaseupdate.go new file mode 100644 index 000000000000..d4087756731f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabaseupdate.go @@ -0,0 +1,9 @@ +package autonomousdatabases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDatabaseUpdate struct { + Properties *AutonomousDatabaseUpdateProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabaseupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabaseupdateproperties.go new file mode 100644 index 000000000000..d3acaf868937 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabaseupdateproperties.go @@ -0,0 +1,30 @@ +package autonomousdatabases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDatabaseUpdateProperties struct { + AdminPassword *string `json:"adminPassword,omitempty"` + AutonomousMaintenanceScheduleType *AutonomousMaintenanceScheduleType `json:"autonomousMaintenanceScheduleType,omitempty"` + BackupRetentionPeriodInDays *int64 `json:"backupRetentionPeriodInDays,omitempty"` + ComputeCount *float64 `json:"computeCount,omitempty"` + CpuCoreCount *int64 `json:"cpuCoreCount,omitempty"` + CustomerContacts *[]CustomerContact `json:"customerContacts,omitempty"` + DataStorageSizeInGbs *int64 `json:"dataStorageSizeInGbs,omitempty"` + DataStorageSizeInTbs *int64 `json:"dataStorageSizeInTbs,omitempty"` + DatabaseEdition *DatabaseEditionType `json:"databaseEdition,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + IsAutoScalingEnabled *bool `json:"isAutoScalingEnabled,omitempty"` + IsAutoScalingForStorageEnabled *bool `json:"isAutoScalingForStorageEnabled,omitempty"` + IsLocalDataGuardEnabled *bool `json:"isLocalDataGuardEnabled,omitempty"` + IsMtlsConnectionRequired *bool `json:"isMtlsConnectionRequired,omitempty"` + LicenseModel *LicenseModel `json:"licenseModel,omitempty"` + LocalAdgAutoFailoverMaxDataLossLimit *int64 `json:"localAdgAutoFailoverMaxDataLossLimit,omitempty"` + LongTermBackupSchedule *LongTermBackUpScheduleDetails `json:"longTermBackupSchedule,omitempty"` + OpenMode *OpenModeType `json:"openMode,omitempty"` + PeerDbId *string `json:"peerDbId,omitempty"` + PermissionLevel *PermissionLevelType `json:"permissionLevel,omitempty"` + Role *RoleType `json:"role,omitempty"` + ScheduledOperations *ScheduledOperationsTypeUpdate `json:"scheduledOperations,omitempty"` + WhitelistedIPs *[]string `json:"whitelistedIps,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasewalletfile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasewalletfile.go new file mode 100644 index 000000000000..3db16ef5d70f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_autonomousdatabasewalletfile.go @@ -0,0 +1,8 @@ +package autonomousdatabases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDatabaseWalletFile struct { + WalletFiles string `json:"walletFiles"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_connectionstringtype.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_connectionstringtype.go new file mode 100644 index 000000000000..044b93601aad --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_connectionstringtype.go @@ -0,0 +1,13 @@ +package autonomousdatabases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectionStringType struct { + AllConnectionStrings *AllConnectionStringType `json:"allConnectionStrings,omitempty"` + Dedicated *string `json:"dedicated,omitempty"` + High *string `json:"high,omitempty"` + Low *string `json:"low,omitempty"` + Medium *string `json:"medium,omitempty"` + Profiles *[]ProfileType `json:"profiles,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_connectionurltype.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_connectionurltype.go new file mode 100644 index 000000000000..6e866fc0a093 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_connectionurltype.go @@ -0,0 +1,14 @@ +package autonomousdatabases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectionURLType struct { + ApexURL *string `json:"apexUrl,omitempty"` + DatabaseTransformsURL *string `json:"databaseTransformsUrl,omitempty"` + GraphStudioURL *string `json:"graphStudioUrl,omitempty"` + MachineLearningNotebookURL *string `json:"machineLearningNotebookUrl,omitempty"` + MongoDbURL *string `json:"mongoDbUrl,omitempty"` + OrdsURL *string `json:"ordsUrl,omitempty"` + SqlDevWebURL *string `json:"sqlDevWebUrl,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_customercontact.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_customercontact.go new file mode 100644 index 000000000000..f0cb840d6372 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_customercontact.go @@ -0,0 +1,8 @@ +package autonomousdatabases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CustomerContact struct { + Email string `json:"email"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_dayofweek.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_dayofweek.go new file mode 100644 index 000000000000..f3a881a70d0b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_dayofweek.go @@ -0,0 +1,8 @@ +package autonomousdatabases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DayOfWeek struct { + Name DayOfWeekName `json:"name"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_dayofweekupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_dayofweekupdate.go new file mode 100644 index 000000000000..3a2293955d2d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_dayofweekupdate.go @@ -0,0 +1,8 @@ +package autonomousdatabases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DayOfWeekUpdate struct { + Name *DayOfWeekName `json:"name,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_generateautonomousdatabasewalletdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_generateautonomousdatabasewalletdetails.go new file mode 100644 index 000000000000..1ac191ea68dc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_generateautonomousdatabasewalletdetails.go @@ -0,0 +1,10 @@ +package autonomousdatabases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GenerateAutonomousDatabaseWalletDetails struct { + GenerateType *GenerateType `json:"generateType,omitempty"` + IsRegional *bool `json:"isRegional,omitempty"` + Password string `json:"password"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_longtermbackupscheduledetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_longtermbackupscheduledetails.go new file mode 100644 index 000000000000..3219641f573b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_longtermbackupscheduledetails.go @@ -0,0 +1,29 @@ +package autonomousdatabases + +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 LongTermBackUpScheduleDetails struct { + IsDisabled *bool `json:"isDisabled,omitempty"` + RepeatCadence *RepeatCadenceType `json:"repeatCadence,omitempty"` + RetentionPeriodInDays *int64 `json:"retentionPeriodInDays,omitempty"` + TimeOfBackup *string `json:"timeOfBackup,omitempty"` +} + +func (o *LongTermBackUpScheduleDetails) GetTimeOfBackupAsTime() (*time.Time, error) { + if o.TimeOfBackup == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeOfBackup, "2006-01-02T15:04:05Z07:00") +} + +func (o *LongTermBackUpScheduleDetails) SetTimeOfBackupAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeOfBackup = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_peerdbdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_peerdbdetails.go new file mode 100644 index 000000000000..8d223d8e5050 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_peerdbdetails.go @@ -0,0 +1,8 @@ +package autonomousdatabases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PeerDbDetails struct { + PeerDbId *string `json:"peerDbId,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_profiletype.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_profiletype.go new file mode 100644 index 000000000000..23033b333c94 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_profiletype.go @@ -0,0 +1,16 @@ +package autonomousdatabases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ProfileType struct { + ConsumerGroup *ConsumerGroup `json:"consumerGroup,omitempty"` + DisplayName string `json:"displayName"` + HostFormat HostFormatType `json:"hostFormat"` + IsRegional *bool `json:"isRegional,omitempty"` + Protocol ProtocolType `json:"protocol"` + SessionMode SessionModeType `json:"sessionMode"` + SyntaxFormat SyntaxFormatType `json:"syntaxFormat"` + TlsAuthentication *TlsAuthenticationType `json:"tlsAuthentication,omitempty"` + Value string `json:"value"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_restoreautonomousdatabasedetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_restoreautonomousdatabasedetails.go new file mode 100644 index 000000000000..62563f3bd971 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_restoreautonomousdatabasedetails.go @@ -0,0 +1,23 @@ +package autonomousdatabases + +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 RestoreAutonomousDatabaseDetails struct { + Timestamp string `json:"timestamp"` +} + +func (o *RestoreAutonomousDatabaseDetails) GetTimestampAsTime() (*time.Time, error) { + return dates.ParseAsFormat(&o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *RestoreAutonomousDatabaseDetails) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_scheduledoperationstype.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_scheduledoperationstype.go new file mode 100644 index 000000000000..c8ddec8547e4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_scheduledoperationstype.go @@ -0,0 +1,10 @@ +package autonomousdatabases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScheduledOperationsType struct { + DayOfWeek DayOfWeek `json:"dayOfWeek"` + ScheduledStartTime *string `json:"scheduledStartTime,omitempty"` + ScheduledStopTime *string `json:"scheduledStopTime,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_scheduledoperationstypeupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_scheduledoperationstypeupdate.go new file mode 100644 index 000000000000..d0ce963fa635 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/model_scheduledoperationstypeupdate.go @@ -0,0 +1,10 @@ +package autonomousdatabases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScheduledOperationsTypeUpdate struct { + DayOfWeek *DayOfWeekUpdate `json:"dayOfWeek,omitempty"` + ScheduledStartTime *string `json:"scheduledStartTime,omitempty"` + ScheduledStopTime *string `json:"scheduledStopTime,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/predicates.go new file mode 100644 index 000000000000..30749532d68d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/predicates.go @@ -0,0 +1,32 @@ +package autonomousdatabases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDatabaseOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p AutonomousDatabaseOperationPredicate) Matches(input AutonomousDatabase) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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 +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/version.go new file mode 100644 index 000000000000..d25c25aa38bc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases/version.go @@ -0,0 +1,10 @@ +package autonomousdatabases + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-06-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/autonomousdatabases/2024-06-01" +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/README.md new file mode 100644 index 000000000000..861d8cf111da --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions` Documentation + +The `autonomousdatabaseversions` SDK allows for interaction with Azure Resource Manager `oracledatabase` (API Version `2024-06-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-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions" +``` + + +### Client Initialization + +```go +client := autonomousdatabaseversions.NewAutonomousDatabaseVersionsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `AutonomousDatabaseVersionsClient.Get` + +```go +ctx := context.TODO() +id := autonomousdatabaseversions.NewAutonomousDbVersionID("12345678-1234-9876-4563-123456789012", "locationName", "autonomousDbVersionName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AutonomousDatabaseVersionsClient.ListByLocation` + +```go +ctx := context.TODO() +id := autonomousdatabaseversions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") + +// alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination +items, err := client.ListByLocationComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/client.go new file mode 100644 index 000000000000..3325a3c3154f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/client.go @@ -0,0 +1,26 @@ +package autonomousdatabaseversions + +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 AutonomousDatabaseVersionsClient struct { + Client *resourcemanager.Client +} + +func NewAutonomousDatabaseVersionsClientWithBaseURI(sdkApi sdkEnv.Api) (*AutonomousDatabaseVersionsClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "autonomousdatabaseversions", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating AutonomousDatabaseVersionsClient: %+v", err) + } + + return &AutonomousDatabaseVersionsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/constants.go new file mode 100644 index 000000000000..f4d7200f6ed0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/constants.go @@ -0,0 +1,57 @@ +package autonomousdatabaseversions + +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 WorkloadType string + +const ( + WorkloadTypeAJD WorkloadType = "AJD" + WorkloadTypeAPEX WorkloadType = "APEX" + WorkloadTypeDW WorkloadType = "DW" + WorkloadTypeOLTP WorkloadType = "OLTP" +) + +func PossibleValuesForWorkloadType() []string { + return []string{ + string(WorkloadTypeAJD), + string(WorkloadTypeAPEX), + string(WorkloadTypeDW), + string(WorkloadTypeOLTP), + } +} + +func (s *WorkloadType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWorkloadType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWorkloadType(input string) (*WorkloadType, error) { + vals := map[string]WorkloadType{ + "ajd": WorkloadTypeAJD, + "apex": WorkloadTypeAPEX, + "dw": WorkloadTypeDW, + "oltp": WorkloadTypeOLTP, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WorkloadType(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_autonomousdbversion.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_autonomousdbversion.go new file mode 100644 index 000000000000..ffb6dbab6db8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_autonomousdbversion.go @@ -0,0 +1,130 @@ +package autonomousdatabaseversions + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&AutonomousDbVersionId{}) +} + +var _ resourceids.ResourceId = &AutonomousDbVersionId{} + +// AutonomousDbVersionId is a struct representing the Resource ID for a Autonomous Db Version +type AutonomousDbVersionId struct { + SubscriptionId string + LocationName string + AutonomousDbVersionName string +} + +// NewAutonomousDbVersionID returns a new AutonomousDbVersionId struct +func NewAutonomousDbVersionID(subscriptionId string, locationName string, autonomousDbVersionName string) AutonomousDbVersionId { + return AutonomousDbVersionId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + AutonomousDbVersionName: autonomousDbVersionName, + } +} + +// ParseAutonomousDbVersionID parses 'input' into a AutonomousDbVersionId +func ParseAutonomousDbVersionID(input string) (*AutonomousDbVersionId, error) { + parser := resourceids.NewParserFromResourceIdType(&AutonomousDbVersionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AutonomousDbVersionId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseAutonomousDbVersionIDInsensitively parses 'input' case-insensitively into a AutonomousDbVersionId +// note: this method should only be used for API response data and not user input +func ParseAutonomousDbVersionIDInsensitively(input string) (*AutonomousDbVersionId, error) { + parser := resourceids.NewParserFromResourceIdType(&AutonomousDbVersionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := AutonomousDbVersionId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *AutonomousDbVersionId) 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) + } + + if id.AutonomousDbVersionName, ok = input.Parsed["autonomousDbVersionName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "autonomousDbVersionName", input) + } + + return nil +} + +// ValidateAutonomousDbVersionID checks that 'input' can be parsed as a Autonomous Db Version ID +func ValidateAutonomousDbVersionID(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 := ParseAutonomousDbVersionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Autonomous Db Version ID +func (id AutonomousDbVersionId) ID() string { + fmtString := "/subscriptions/%s/providers/Oracle.Database/locations/%s/autonomousDbVersions/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName, id.AutonomousDbVersionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Autonomous Db Version ID +func (id AutonomousDbVersionId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + resourceids.StaticSegment("staticAutonomousDbVersions", "autonomousDbVersions", "autonomousDbVersions"), + resourceids.UserSpecifiedSegment("autonomousDbVersionName", "autonomousDbVersionName"), + } +} + +// String returns a human-readable description of this Autonomous Db Version ID +func (id AutonomousDbVersionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + fmt.Sprintf("Autonomous Db Version Name: %q", id.AutonomousDbVersionName), + } + return fmt.Sprintf("Autonomous Db Version (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_location.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_location.go new file mode 100644 index 000000000000..c084011e4561 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/id_location.go @@ -0,0 +1,121 @@ +package autonomousdatabaseversions + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&LocationId{}) +} + +var _ resourceids.ResourceId = &LocationId{} + +// LocationId is a struct representing the Resource ID for a Location +type LocationId struct { + SubscriptionId string + LocationName string +} + +// NewLocationID returns a new LocationId struct +func NewLocationID(subscriptionId string, locationName string) LocationId { + return LocationId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + } +} + +// ParseLocationID parses 'input' into a LocationId +func ParseLocationID(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseLocationIDInsensitively parses 'input' case-insensitively into a LocationId +// note: this method should only be used for API response data and not user input +func ParseLocationIDInsensitively(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *LocationId) 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 +} + +// ValidateLocationID checks that 'input' can be parsed as a Location ID +func ValidateLocationID(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 := ParseLocationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Location ID +func (id LocationId) ID() string { + fmtString := "/subscriptions/%s/providers/Oracle.Database/locations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Location ID +func (id LocationId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + } +} + +// String returns a human-readable description of this Location ID +func (id LocationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + } + return fmt.Sprintf("Location (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/method_get.go new file mode 100644 index 000000000000..33a2e2933ed1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/method_get.go @@ -0,0 +1,53 @@ +package autonomousdatabaseversions + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *AutonomousDbVersion +} + +// Get ... +func (c AutonomousDatabaseVersionsClient) Get(ctx context.Context, id AutonomousDbVersionId) (result GetOperationResponse, 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 AutonomousDbVersion + 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/oracledatabase/2024-06-01/autonomousdatabaseversions/method_listbylocation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/method_listbylocation.go new file mode 100644 index 000000000000..3568f7d2e003 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/method_listbylocation.go @@ -0,0 +1,105 @@ +package autonomousdatabaseversions + +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 ListByLocationOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]AutonomousDbVersion +} + +type ListByLocationCompleteResult struct { + LatestHttpResponse *http.Response + Items []AutonomousDbVersion +} + +type ListByLocationCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByLocationCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByLocation ... +func (c AutonomousDatabaseVersionsClient) ListByLocation(ctx context.Context, id LocationId) (result ListByLocationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByLocationCustomPager{}, + Path: fmt.Sprintf("%s/autonomousDbVersions", 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 *[]AutonomousDbVersion `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByLocationComplete retrieves all the results into a single object +func (c AutonomousDatabaseVersionsClient) ListByLocationComplete(ctx context.Context, id LocationId) (ListByLocationCompleteResult, error) { + return c.ListByLocationCompleteMatchingPredicate(ctx, id, AutonomousDbVersionOperationPredicate{}) +} + +// ListByLocationCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c AutonomousDatabaseVersionsClient) ListByLocationCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate AutonomousDbVersionOperationPredicate) (result ListByLocationCompleteResult, err error) { + items := make([]AutonomousDbVersion, 0) + + resp, err := c.ListByLocation(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListByLocationCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/model_autonomousdbversion.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/model_autonomousdbversion.go new file mode 100644 index 000000000000..d637e754ddfc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/model_autonomousdbversion.go @@ -0,0 +1,16 @@ +package autonomousdatabaseversions + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDbVersion struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *AutonomousDbVersionProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/model_autonomousdbversionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/model_autonomousdbversionproperties.go new file mode 100644 index 000000000000..0a7cad672e79 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/model_autonomousdbversionproperties.go @@ -0,0 +1,13 @@ +package autonomousdatabaseversions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDbVersionProperties struct { + DbWorkload *WorkloadType `json:"dbWorkload,omitempty"` + IsDefaultForFree *bool `json:"isDefaultForFree,omitempty"` + IsDefaultForPaid *bool `json:"isDefaultForPaid,omitempty"` + IsFreeTierEnabled *bool `json:"isFreeTierEnabled,omitempty"` + IsPaidEnabled *bool `json:"isPaidEnabled,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/predicates.go new file mode 100644 index 000000000000..87d67558b5f7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/predicates.go @@ -0,0 +1,27 @@ +package autonomousdatabaseversions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutonomousDbVersionOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p AutonomousDbVersionOperationPredicate) Matches(input AutonomousDbVersion) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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/oracledatabase/2024-06-01/autonomousdatabaseversions/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/version.go new file mode 100644 index 000000000000..1bb60856338c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions/version.go @@ -0,0 +1,10 @@ +package autonomousdatabaseversions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-06-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/autonomousdatabaseversions/2024-06-01" +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/client.go new file mode 100644 index 000000000000..779de7918c4e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/client.go @@ -0,0 +1,163 @@ +package v2024_06_01 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups" + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets" + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets" + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases" + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions" + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures" + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters" + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes" + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers" + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes" + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews" + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones" + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions" + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions" + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions" + "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +type Client struct { + AutonomousDatabaseBackups *autonomousdatabasebackups.AutonomousDatabaseBackupsClient + AutonomousDatabaseCharacterSets *autonomousdatabasecharactersets.AutonomousDatabaseCharacterSetsClient + AutonomousDatabaseNationalCharacterSets *autonomousdatabasenationalcharactersets.AutonomousDatabaseNationalCharacterSetsClient + AutonomousDatabaseVersions *autonomousdatabaseversions.AutonomousDatabaseVersionsClient + AutonomousDatabases *autonomousdatabases.AutonomousDatabasesClient + CloudExadataInfrastructures *cloudexadatainfrastructures.CloudExadataInfrastructuresClient + CloudVMClusters *cloudvmclusters.CloudVMClustersClient + DbNodes *dbnodes.DbNodesClient + DbServers *dbservers.DbServersClient + DbSystemShapes *dbsystemshapes.DbSystemShapesClient + DnsPrivateViews *dnsprivateviews.DnsPrivateViewsClient + DnsPrivateZones *dnsprivatezones.DnsPrivateZonesClient + GiVersions *giversions.GiVersionsClient + OracleSubscriptions *oraclesubscriptions.OracleSubscriptionsClient + SystemVersions *systemversions.SystemVersionsClient + VirtualNetworkAddresses *virtualnetworkaddresses.VirtualNetworkAddressesClient +} + +func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { + autonomousDatabaseBackupsClient, err := autonomousdatabasebackups.NewAutonomousDatabaseBackupsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building AutonomousDatabaseBackups client: %+v", err) + } + configureFunc(autonomousDatabaseBackupsClient.Client) + + autonomousDatabaseCharacterSetsClient, err := autonomousdatabasecharactersets.NewAutonomousDatabaseCharacterSetsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building AutonomousDatabaseCharacterSets client: %+v", err) + } + configureFunc(autonomousDatabaseCharacterSetsClient.Client) + + autonomousDatabaseNationalCharacterSetsClient, err := autonomousdatabasenationalcharactersets.NewAutonomousDatabaseNationalCharacterSetsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building AutonomousDatabaseNationalCharacterSets client: %+v", err) + } + configureFunc(autonomousDatabaseNationalCharacterSetsClient.Client) + + autonomousDatabaseVersionsClient, err := autonomousdatabaseversions.NewAutonomousDatabaseVersionsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building AutonomousDatabaseVersions client: %+v", err) + } + configureFunc(autonomousDatabaseVersionsClient.Client) + + autonomousDatabasesClient, err := autonomousdatabases.NewAutonomousDatabasesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building AutonomousDatabases client: %+v", err) + } + configureFunc(autonomousDatabasesClient.Client) + + cloudExadataInfrastructuresClient, err := cloudexadatainfrastructures.NewCloudExadataInfrastructuresClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building CloudExadataInfrastructures client: %+v", err) + } + configureFunc(cloudExadataInfrastructuresClient.Client) + + cloudVMClustersClient, err := cloudvmclusters.NewCloudVMClustersClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building CloudVMClusters client: %+v", err) + } + configureFunc(cloudVMClustersClient.Client) + + dbNodesClient, err := dbnodes.NewDbNodesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building DbNodes client: %+v", err) + } + configureFunc(dbNodesClient.Client) + + dbServersClient, err := dbservers.NewDbServersClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building DbServers client: %+v", err) + } + configureFunc(dbServersClient.Client) + + dbSystemShapesClient, err := dbsystemshapes.NewDbSystemShapesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building DbSystemShapes client: %+v", err) + } + configureFunc(dbSystemShapesClient.Client) + + dnsPrivateViewsClient, err := dnsprivateviews.NewDnsPrivateViewsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building DnsPrivateViews client: %+v", err) + } + configureFunc(dnsPrivateViewsClient.Client) + + dnsPrivateZonesClient, err := dnsprivatezones.NewDnsPrivateZonesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building DnsPrivateZones client: %+v", err) + } + configureFunc(dnsPrivateZonesClient.Client) + + giVersionsClient, err := giversions.NewGiVersionsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building GiVersions client: %+v", err) + } + configureFunc(giVersionsClient.Client) + + oracleSubscriptionsClient, err := oraclesubscriptions.NewOracleSubscriptionsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building OracleSubscriptions client: %+v", err) + } + configureFunc(oracleSubscriptionsClient.Client) + + systemVersionsClient, err := systemversions.NewSystemVersionsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building SystemVersions client: %+v", err) + } + configureFunc(systemVersionsClient.Client) + + virtualNetworkAddressesClient, err := virtualnetworkaddresses.NewVirtualNetworkAddressesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualNetworkAddresses client: %+v", err) + } + configureFunc(virtualNetworkAddressesClient.Client) + + return &Client{ + AutonomousDatabaseBackups: autonomousDatabaseBackupsClient, + AutonomousDatabaseCharacterSets: autonomousDatabaseCharacterSetsClient, + AutonomousDatabaseNationalCharacterSets: autonomousDatabaseNationalCharacterSetsClient, + AutonomousDatabaseVersions: autonomousDatabaseVersionsClient, + AutonomousDatabases: autonomousDatabasesClient, + CloudExadataInfrastructures: cloudExadataInfrastructuresClient, + CloudVMClusters: cloudVMClustersClient, + DbNodes: dbNodesClient, + DbServers: dbServersClient, + DbSystemShapes: dbSystemShapesClient, + DnsPrivateViews: dnsPrivateViewsClient, + DnsPrivateZones: dnsPrivateZonesClient, + GiVersions: giVersionsClient, + OracleSubscriptions: oracleSubscriptionsClient, + SystemVersions: systemVersionsClient, + VirtualNetworkAddresses: virtualNetworkAddressesClient, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/README.md new file mode 100644 index 000000000000..4ef8d6089e6a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/README.md @@ -0,0 +1,129 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures` Documentation + +The `cloudexadatainfrastructures` SDK allows for interaction with Azure Resource Manager `oracledatabase` (API Version `2024-06-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/oracledatabase/2024-06-01/cloudexadatainfrastructures" +``` + + +### Client Initialization + +```go +client := cloudexadatainfrastructures.NewCloudExadataInfrastructuresClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `CloudExadataInfrastructuresClient.AddStorageCapacity` + +```go +ctx := context.TODO() +id := cloudexadatainfrastructures.NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName") + +if err := client.AddStorageCapacityThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CloudExadataInfrastructuresClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := cloudexadatainfrastructures.NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName") + +payload := cloudexadatainfrastructures.CloudExadataInfrastructure{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CloudExadataInfrastructuresClient.Delete` + +```go +ctx := context.TODO() +id := cloudexadatainfrastructures.NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CloudExadataInfrastructuresClient.Get` + +```go +ctx := context.TODO() +id := cloudexadatainfrastructures.NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CloudExadataInfrastructuresClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.ListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `CloudExadataInfrastructuresClient.ListBySubscription` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `CloudExadataInfrastructuresClient.Update` + +```go +ctx := context.TODO() +id := cloudexadatainfrastructures.NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName") + +payload := cloudexadatainfrastructures.CloudExadataInfrastructureUpdate{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/client.go new file mode 100644 index 000000000000..b730c46ae8bb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/client.go @@ -0,0 +1,26 @@ +package cloudexadatainfrastructures + +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 CloudExadataInfrastructuresClient struct { + Client *resourcemanager.Client +} + +func NewCloudExadataInfrastructuresClientWithBaseURI(sdkApi sdkEnv.Api) (*CloudExadataInfrastructuresClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "cloudexadatainfrastructures", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating CloudExadataInfrastructuresClient: %+v", err) + } + + return &CloudExadataInfrastructuresClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/constants.go new file mode 100644 index 000000000000..1baad8c6fddb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/constants.go @@ -0,0 +1,322 @@ +package cloudexadatainfrastructures + +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 AzureResourceProvisioningState string + +const ( + AzureResourceProvisioningStateCanceled AzureResourceProvisioningState = "Canceled" + AzureResourceProvisioningStateFailed AzureResourceProvisioningState = "Failed" + AzureResourceProvisioningStateProvisioning AzureResourceProvisioningState = "Provisioning" + AzureResourceProvisioningStateSucceeded AzureResourceProvisioningState = "Succeeded" +) + +func PossibleValuesForAzureResourceProvisioningState() []string { + return []string{ + string(AzureResourceProvisioningStateCanceled), + string(AzureResourceProvisioningStateFailed), + string(AzureResourceProvisioningStateProvisioning), + string(AzureResourceProvisioningStateSucceeded), + } +} + +func (s *AzureResourceProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureResourceProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureResourceProvisioningState(input string) (*AzureResourceProvisioningState, error) { + vals := map[string]AzureResourceProvisioningState{ + "canceled": AzureResourceProvisioningStateCanceled, + "failed": AzureResourceProvisioningStateFailed, + "provisioning": AzureResourceProvisioningStateProvisioning, + "succeeded": AzureResourceProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureResourceProvisioningState(input) + return &out, nil +} + +type CloudExadataInfrastructureLifecycleState string + +const ( + CloudExadataInfrastructureLifecycleStateAvailable CloudExadataInfrastructureLifecycleState = "Available" + CloudExadataInfrastructureLifecycleStateFailed CloudExadataInfrastructureLifecycleState = "Failed" + CloudExadataInfrastructureLifecycleStateMaintenanceInProgress CloudExadataInfrastructureLifecycleState = "MaintenanceInProgress" + CloudExadataInfrastructureLifecycleStateProvisioning CloudExadataInfrastructureLifecycleState = "Provisioning" + CloudExadataInfrastructureLifecycleStateTerminated CloudExadataInfrastructureLifecycleState = "Terminated" + CloudExadataInfrastructureLifecycleStateTerminating CloudExadataInfrastructureLifecycleState = "Terminating" + CloudExadataInfrastructureLifecycleStateUpdating CloudExadataInfrastructureLifecycleState = "Updating" +) + +func PossibleValuesForCloudExadataInfrastructureLifecycleState() []string { + return []string{ + string(CloudExadataInfrastructureLifecycleStateAvailable), + string(CloudExadataInfrastructureLifecycleStateFailed), + string(CloudExadataInfrastructureLifecycleStateMaintenanceInProgress), + string(CloudExadataInfrastructureLifecycleStateProvisioning), + string(CloudExadataInfrastructureLifecycleStateTerminated), + string(CloudExadataInfrastructureLifecycleStateTerminating), + string(CloudExadataInfrastructureLifecycleStateUpdating), + } +} + +func (s *CloudExadataInfrastructureLifecycleState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCloudExadataInfrastructureLifecycleState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCloudExadataInfrastructureLifecycleState(input string) (*CloudExadataInfrastructureLifecycleState, error) { + vals := map[string]CloudExadataInfrastructureLifecycleState{ + "available": CloudExadataInfrastructureLifecycleStateAvailable, + "failed": CloudExadataInfrastructureLifecycleStateFailed, + "maintenanceinprogress": CloudExadataInfrastructureLifecycleStateMaintenanceInProgress, + "provisioning": CloudExadataInfrastructureLifecycleStateProvisioning, + "terminated": CloudExadataInfrastructureLifecycleStateTerminated, + "terminating": CloudExadataInfrastructureLifecycleStateTerminating, + "updating": CloudExadataInfrastructureLifecycleStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CloudExadataInfrastructureLifecycleState(input) + return &out, nil +} + +type DayOfWeekName string + +const ( + DayOfWeekNameFriday DayOfWeekName = "Friday" + DayOfWeekNameMonday DayOfWeekName = "Monday" + DayOfWeekNameSaturday DayOfWeekName = "Saturday" + DayOfWeekNameSunday DayOfWeekName = "Sunday" + DayOfWeekNameThursday DayOfWeekName = "Thursday" + DayOfWeekNameTuesday DayOfWeekName = "Tuesday" + DayOfWeekNameWednesday DayOfWeekName = "Wednesday" +) + +func PossibleValuesForDayOfWeekName() []string { + return []string{ + string(DayOfWeekNameFriday), + string(DayOfWeekNameMonday), + string(DayOfWeekNameSaturday), + string(DayOfWeekNameSunday), + string(DayOfWeekNameThursday), + string(DayOfWeekNameTuesday), + string(DayOfWeekNameWednesday), + } +} + +func (s *DayOfWeekName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDayOfWeekName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDayOfWeekName(input string) (*DayOfWeekName, error) { + vals := map[string]DayOfWeekName{ + "friday": DayOfWeekNameFriday, + "monday": DayOfWeekNameMonday, + "saturday": DayOfWeekNameSaturday, + "sunday": DayOfWeekNameSunday, + "thursday": DayOfWeekNameThursday, + "tuesday": DayOfWeekNameTuesday, + "wednesday": DayOfWeekNameWednesday, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DayOfWeekName(input) + return &out, nil +} + +type MonthName string + +const ( + MonthNameApril MonthName = "April" + MonthNameAugust MonthName = "August" + MonthNameDecember MonthName = "December" + MonthNameFebruary MonthName = "February" + MonthNameJanuary MonthName = "January" + MonthNameJuly MonthName = "July" + MonthNameJune MonthName = "June" + MonthNameMarch MonthName = "March" + MonthNameMay MonthName = "May" + MonthNameNovember MonthName = "November" + MonthNameOctober MonthName = "October" + MonthNameSeptember MonthName = "September" +) + +func PossibleValuesForMonthName() []string { + return []string{ + string(MonthNameApril), + string(MonthNameAugust), + string(MonthNameDecember), + string(MonthNameFebruary), + string(MonthNameJanuary), + string(MonthNameJuly), + string(MonthNameJune), + string(MonthNameMarch), + string(MonthNameMay), + string(MonthNameNovember), + string(MonthNameOctober), + string(MonthNameSeptember), + } +} + +func (s *MonthName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMonthName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMonthName(input string) (*MonthName, error) { + vals := map[string]MonthName{ + "april": MonthNameApril, + "august": MonthNameAugust, + "december": MonthNameDecember, + "february": MonthNameFebruary, + "january": MonthNameJanuary, + "july": MonthNameJuly, + "june": MonthNameJune, + "march": MonthNameMarch, + "may": MonthNameMay, + "november": MonthNameNovember, + "october": MonthNameOctober, + "september": MonthNameSeptember, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MonthName(input) + return &out, nil +} + +type PatchingMode string + +const ( + PatchingModeNonRolling PatchingMode = "NonRolling" + PatchingModeRolling PatchingMode = "Rolling" +) + +func PossibleValuesForPatchingMode() []string { + return []string{ + string(PatchingModeNonRolling), + string(PatchingModeRolling), + } +} + +func (s *PatchingMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePatchingMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePatchingMode(input string) (*PatchingMode, error) { + vals := map[string]PatchingMode{ + "nonrolling": PatchingModeNonRolling, + "rolling": PatchingModeRolling, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PatchingMode(input) + return &out, nil +} + +type Preference string + +const ( + PreferenceCustomPreference Preference = "CustomPreference" + PreferenceNoPreference Preference = "NoPreference" +) + +func PossibleValuesForPreference() []string { + return []string{ + string(PreferenceCustomPreference), + string(PreferenceNoPreference), + } +} + +func (s *Preference) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePreference(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePreference(input string) (*Preference, error) { + vals := map[string]Preference{ + "custompreference": PreferenceCustomPreference, + "nopreference": PreferenceNoPreference, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Preference(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/id_cloudexadatainfrastructure.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/id_cloudexadatainfrastructure.go new file mode 100644 index 000000000000..df189438489b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/id_cloudexadatainfrastructure.go @@ -0,0 +1,130 @@ +package cloudexadatainfrastructures + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&CloudExadataInfrastructureId{}) +} + +var _ resourceids.ResourceId = &CloudExadataInfrastructureId{} + +// CloudExadataInfrastructureId is a struct representing the Resource ID for a Cloud Exadata Infrastructure +type CloudExadataInfrastructureId struct { + SubscriptionId string + ResourceGroupName string + CloudExadataInfrastructureName string +} + +// NewCloudExadataInfrastructureID returns a new CloudExadataInfrastructureId struct +func NewCloudExadataInfrastructureID(subscriptionId string, resourceGroupName string, cloudExadataInfrastructureName string) CloudExadataInfrastructureId { + return CloudExadataInfrastructureId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + CloudExadataInfrastructureName: cloudExadataInfrastructureName, + } +} + +// ParseCloudExadataInfrastructureID parses 'input' into a CloudExadataInfrastructureId +func ParseCloudExadataInfrastructureID(input string) (*CloudExadataInfrastructureId, error) { + parser := resourceids.NewParserFromResourceIdType(&CloudExadataInfrastructureId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CloudExadataInfrastructureId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseCloudExadataInfrastructureIDInsensitively parses 'input' case-insensitively into a CloudExadataInfrastructureId +// note: this method should only be used for API response data and not user input +func ParseCloudExadataInfrastructureIDInsensitively(input string) (*CloudExadataInfrastructureId, error) { + parser := resourceids.NewParserFromResourceIdType(&CloudExadataInfrastructureId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CloudExadataInfrastructureId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *CloudExadataInfrastructureId) 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.CloudExadataInfrastructureName, ok = input.Parsed["cloudExadataInfrastructureName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "cloudExadataInfrastructureName", input) + } + + return nil +} + +// ValidateCloudExadataInfrastructureID checks that 'input' can be parsed as a Cloud Exadata Infrastructure ID +func ValidateCloudExadataInfrastructureID(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 := ParseCloudExadataInfrastructureID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Cloud Exadata Infrastructure ID +func (id CloudExadataInfrastructureId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Oracle.Database/cloudExadataInfrastructures/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudExadataInfrastructureName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Cloud Exadata Infrastructure ID +func (id CloudExadataInfrastructureId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticCloudExadataInfrastructures", "cloudExadataInfrastructures", "cloudExadataInfrastructures"), + resourceids.UserSpecifiedSegment("cloudExadataInfrastructureName", "cloudExadataInfrastructureName"), + } +} + +// String returns a human-readable description of this Cloud Exadata Infrastructure ID +func (id CloudExadataInfrastructureId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Cloud Exadata Infrastructure Name: %q", id.CloudExadataInfrastructureName), + } + return fmt.Sprintf("Cloud Exadata Infrastructure (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_addstoragecapacity.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_addstoragecapacity.go new file mode 100644 index 000000000000..7b5bda2d476a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_addstoragecapacity.go @@ -0,0 +1,71 @@ +package cloudexadatainfrastructures + +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 AddStorageCapacityOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *CloudExadataInfrastructure +} + +// AddStorageCapacity ... +func (c CloudExadataInfrastructuresClient) AddStorageCapacity(ctx context.Context, id CloudExadataInfrastructureId) (result AddStorageCapacityOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/addStorageCapacity", 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 +} + +// AddStorageCapacityThenPoll performs AddStorageCapacity then polls until it's completed +func (c CloudExadataInfrastructuresClient) AddStorageCapacityThenPoll(ctx context.Context, id CloudExadataInfrastructureId) error { + result, err := c.AddStorageCapacity(ctx, id) + if err != nil { + return fmt.Errorf("performing AddStorageCapacity: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after AddStorageCapacity: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_createorupdate.go new file mode 100644 index 000000000000..75af32ddc646 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_createorupdate.go @@ -0,0 +1,75 @@ +package cloudexadatainfrastructures + +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 CreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *CloudExadataInfrastructure +} + +// CreateOrUpdate ... +func (c CloudExadataInfrastructuresClient) CreateOrUpdate(ctx context.Context, id CloudExadataInfrastructureId, input CloudExadataInfrastructure) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + 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 +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c CloudExadataInfrastructuresClient) CreateOrUpdateThenPoll(ctx context.Context, id CloudExadataInfrastructureId, input CloudExadataInfrastructure) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_delete.go new file mode 100644 index 000000000000..f8032ba6b03a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_delete.go @@ -0,0 +1,70 @@ +package cloudexadatainfrastructures + +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 DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c CloudExadataInfrastructuresClient) Delete(ctx context.Context, id CloudExadataInfrastructureId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + 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 +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c CloudExadataInfrastructuresClient) DeleteThenPoll(ctx context.Context, id CloudExadataInfrastructureId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_get.go new file mode 100644 index 000000000000..fc119da3dd97 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_get.go @@ -0,0 +1,53 @@ +package cloudexadatainfrastructures + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *CloudExadataInfrastructure +} + +// Get ... +func (c CloudExadataInfrastructuresClient) Get(ctx context.Context, id CloudExadataInfrastructureId) (result GetOperationResponse, 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 CloudExadataInfrastructure + 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/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_listbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_listbyresourcegroup.go new file mode 100644 index 000000000000..2143b1109597 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_listbyresourcegroup.go @@ -0,0 +1,106 @@ +package cloudexadatainfrastructures + +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 ListByResourceGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]CloudExadataInfrastructure +} + +type ListByResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []CloudExadataInfrastructure +} + +type ListByResourceGroupCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByResourceGroupCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByResourceGroup ... +func (c CloudExadataInfrastructuresClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ListByResourceGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByResourceGroupCustomPager{}, + Path: fmt.Sprintf("%s/providers/Oracle.Database/cloudExadataInfrastructures", 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 *[]CloudExadataInfrastructure `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByResourceGroupComplete retrieves all the results into a single object +func (c CloudExadataInfrastructuresClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, CloudExadataInfrastructureOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c CloudExadataInfrastructuresClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate CloudExadataInfrastructureOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]CloudExadataInfrastructure, 0) + + resp, err := c.ListByResourceGroup(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListByResourceGroupCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_listbysubscription.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_listbysubscription.go new file mode 100644 index 000000000000..a6d4a182303e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_listbysubscription.go @@ -0,0 +1,106 @@ +package cloudexadatainfrastructures + +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 ListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]CloudExadataInfrastructure +} + +type ListBySubscriptionCompleteResult struct { + LatestHttpResponse *http.Response + Items []CloudExadataInfrastructure +} + +type ListBySubscriptionCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListBySubscriptionCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListBySubscription ... +func (c CloudExadataInfrastructuresClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListBySubscriptionCustomPager{}, + Path: fmt.Sprintf("%s/providers/Oracle.Database/cloudExadataInfrastructures", 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 *[]CloudExadataInfrastructure `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListBySubscriptionComplete retrieves all the results into a single object +func (c CloudExadataInfrastructuresClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { + return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, CloudExadataInfrastructureOperationPredicate{}) +} + +// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c CloudExadataInfrastructuresClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate CloudExadataInfrastructureOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { + items := make([]CloudExadataInfrastructure, 0) + + resp, err := c.ListBySubscription(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListBySubscriptionCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_update.go new file mode 100644 index 000000000000..54e2aa254c5c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/method_update.go @@ -0,0 +1,75 @@ +package cloudexadatainfrastructures + +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 UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *CloudExadataInfrastructure +} + +// Update ... +func (c CloudExadataInfrastructuresClient) Update(ctx context.Context, id CloudExadataInfrastructureId, input CloudExadataInfrastructureUpdate) (result UpdateOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c CloudExadataInfrastructuresClient) UpdateThenPoll(ctx context.Context, id CloudExadataInfrastructureId, input CloudExadataInfrastructureUpdate) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_cloudexadatainfrastructure.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_cloudexadatainfrastructure.go new file mode 100644 index 000000000000..93f4463e84f0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_cloudexadatainfrastructure.go @@ -0,0 +1,20 @@ +package cloudexadatainfrastructures + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" + "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 CloudExadataInfrastructure struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *CloudExadataInfrastructureProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` + Zones zones.Schema `json:"zones"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_cloudexadatainfrastructureproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_cloudexadatainfrastructureproperties.go new file mode 100644 index 000000000000..1886cf2282b2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_cloudexadatainfrastructureproperties.go @@ -0,0 +1,38 @@ +package cloudexadatainfrastructures + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudExadataInfrastructureProperties struct { + ActivatedStorageCount *int64 `json:"activatedStorageCount,omitempty"` + AdditionalStorageCount *int64 `json:"additionalStorageCount,omitempty"` + AvailableStorageSizeInGbs *int64 `json:"availableStorageSizeInGbs,omitempty"` + ComputeCount *int64 `json:"computeCount,omitempty"` + CpuCount *int64 `json:"cpuCount,omitempty"` + CustomerContacts *[]CustomerContact `json:"customerContacts,omitempty"` + DataStorageSizeInTbs *float64 `json:"dataStorageSizeInTbs,omitempty"` + DbNodeStorageSizeInGbs *int64 `json:"dbNodeStorageSizeInGbs,omitempty"` + DbServerVersion *string `json:"dbServerVersion,omitempty"` + DisplayName string `json:"displayName"` + EstimatedPatchingTime *EstimatedPatchingTime `json:"estimatedPatchingTime,omitempty"` + LastMaintenanceRunId *string `json:"lastMaintenanceRunId,omitempty"` + LifecycleDetails *string `json:"lifecycleDetails,omitempty"` + LifecycleState *CloudExadataInfrastructureLifecycleState `json:"lifecycleState,omitempty"` + MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` + MaxCPUCount *int64 `json:"maxCpuCount,omitempty"` + MaxDataStorageInTbs *float64 `json:"maxDataStorageInTbs,omitempty"` + MaxDbNodeStorageSizeInGbs *int64 `json:"maxDbNodeStorageSizeInGbs,omitempty"` + MaxMemoryInGbs *int64 `json:"maxMemoryInGbs,omitempty"` + MemorySizeInGbs *int64 `json:"memorySizeInGbs,omitempty"` + MonthlyDbServerVersion *string `json:"monthlyDbServerVersion,omitempty"` + MonthlyStorageServerVersion *string `json:"monthlyStorageServerVersion,omitempty"` + NextMaintenanceRunId *string `json:"nextMaintenanceRunId,omitempty"` + OciURL *string `json:"ociUrl,omitempty"` + Ocid *string `json:"ocid,omitempty"` + ProvisioningState *AzureResourceProvisioningState `json:"provisioningState,omitempty"` + Shape string `json:"shape"` + StorageCount *int64 `json:"storageCount,omitempty"` + StorageServerVersion *string `json:"storageServerVersion,omitempty"` + TimeCreated *string `json:"timeCreated,omitempty"` + TotalStorageSizeInGbs *int64 `json:"totalStorageSizeInGbs,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_cloudexadatainfrastructureupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_cloudexadatainfrastructureupdate.go new file mode 100644 index 000000000000..606eb24be431 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_cloudexadatainfrastructureupdate.go @@ -0,0 +1,14 @@ +package cloudexadatainfrastructures + +import ( + "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 CloudExadataInfrastructureUpdate struct { + Properties *CloudExadataInfrastructureUpdateProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Zones *zones.Schema `json:"zones,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_cloudexadatainfrastructureupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_cloudexadatainfrastructureupdateproperties.go new file mode 100644 index 000000000000..d18c7da0d018 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_cloudexadatainfrastructureupdateproperties.go @@ -0,0 +1,12 @@ +package cloudexadatainfrastructures + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudExadataInfrastructureUpdateProperties struct { + ComputeCount *int64 `json:"computeCount,omitempty"` + CustomerContacts *[]CustomerContact `json:"customerContacts,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` + StorageCount *int64 `json:"storageCount,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_customercontact.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_customercontact.go new file mode 100644 index 000000000000..ab32a4c955da --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_customercontact.go @@ -0,0 +1,8 @@ +package cloudexadatainfrastructures + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CustomerContact struct { + Email string `json:"email"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_dayofweek.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_dayofweek.go new file mode 100644 index 000000000000..0df53b97a8f3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_dayofweek.go @@ -0,0 +1,8 @@ +package cloudexadatainfrastructures + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DayOfWeek struct { + Name DayOfWeekName `json:"name"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_estimatedpatchingtime.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_estimatedpatchingtime.go new file mode 100644 index 000000000000..52cd0d6fa9e2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_estimatedpatchingtime.go @@ -0,0 +1,11 @@ +package cloudexadatainfrastructures + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EstimatedPatchingTime struct { + EstimatedDbServerPatchingTime *int64 `json:"estimatedDbServerPatchingTime,omitempty"` + EstimatedNetworkSwitchesPatchingTime *int64 `json:"estimatedNetworkSwitchesPatchingTime,omitempty"` + EstimatedStorageServerPatchingTime *int64 `json:"estimatedStorageServerPatchingTime,omitempty"` + TotalEstimatedPatchingTime *int64 `json:"totalEstimatedPatchingTime,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_maintenancewindow.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_maintenancewindow.go new file mode 100644 index 000000000000..b9d485dcf628 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_maintenancewindow.go @@ -0,0 +1,17 @@ +package cloudexadatainfrastructures + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MaintenanceWindow struct { + CustomActionTimeoutInMins *int64 `json:"customActionTimeoutInMins,omitempty"` + DaysOfWeek *[]DayOfWeek `json:"daysOfWeek,omitempty"` + HoursOfDay *[]int64 `json:"hoursOfDay,omitempty"` + IsCustomActionTimeoutEnabled *bool `json:"isCustomActionTimeoutEnabled,omitempty"` + IsMonthlyPatchingEnabled *bool `json:"isMonthlyPatchingEnabled,omitempty"` + LeadTimeInWeeks *int64 `json:"leadTimeInWeeks,omitempty"` + Months *[]Month `json:"months,omitempty"` + PatchingMode *PatchingMode `json:"patchingMode,omitempty"` + Preference *Preference `json:"preference,omitempty"` + WeeksOfMonth *[]int64 `json:"weeksOfMonth,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_month.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_month.go new file mode 100644 index 000000000000..9c0b630b8afa --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/model_month.go @@ -0,0 +1,8 @@ +package cloudexadatainfrastructures + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Month struct { + Name MonthName `json:"name"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/predicates.go new file mode 100644 index 000000000000..f34f99354072 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/predicates.go @@ -0,0 +1,32 @@ +package cloudexadatainfrastructures + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudExadataInfrastructureOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p CloudExadataInfrastructureOperationPredicate) Matches(input CloudExadataInfrastructure) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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 +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/version.go new file mode 100644 index 000000000000..a0c5358b422d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures/version.go @@ -0,0 +1,10 @@ +package cloudexadatainfrastructures + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-06-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/cloudexadatainfrastructures/2024-06-01" +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/README.md new file mode 100644 index 000000000000..bf98f9e5d736 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/README.md @@ -0,0 +1,172 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters` Documentation + +The `cloudvmclusters` SDK allows for interaction with Azure Resource Manager `oracledatabase` (API Version `2024-06-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/oracledatabase/2024-06-01/cloudvmclusters" +``` + + +### Client Initialization + +```go +client := cloudvmclusters.NewCloudVMClustersClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `CloudVMClustersClient.AddVMs` + +```go +ctx := context.TODO() +id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") + +payload := cloudvmclusters.AddRemoveDbNode{ + // ... +} + + +if err := client.AddVMsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CloudVMClustersClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") + +payload := cloudvmclusters.CloudVMCluster{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CloudVMClustersClient.Delete` + +```go +ctx := context.TODO() +id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CloudVMClustersClient.Get` + +```go +ctx := context.TODO() +id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CloudVMClustersClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.ListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `CloudVMClustersClient.ListBySubscription` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `CloudVMClustersClient.ListPrivateIPAddresses` + +```go +ctx := context.TODO() +id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") + +payload := cloudvmclusters.PrivateIPAddressesFilter{ + // ... +} + + +read, err := client.ListPrivateIPAddresses(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CloudVMClustersClient.RemoveVMs` + +```go +ctx := context.TODO() +id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") + +payload := cloudvmclusters.AddRemoveDbNode{ + // ... +} + + +if err := client.RemoveVMsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CloudVMClustersClient.Update` + +```go +ctx := context.TODO() +id := cloudvmclusters.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") + +payload := cloudvmclusters.CloudVMClusterUpdate{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/client.go new file mode 100644 index 000000000000..8686d91ee78f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/client.go @@ -0,0 +1,26 @@ +package cloudvmclusters + +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 CloudVMClustersClient struct { + Client *resourcemanager.Client +} + +func NewCloudVMClustersClientWithBaseURI(sdkApi sdkEnv.Api) (*CloudVMClustersClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "cloudvmclusters", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating CloudVMClustersClient: %+v", err) + } + + return &CloudVMClustersClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/constants.go new file mode 100644 index 000000000000..5315231510dc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/constants.go @@ -0,0 +1,295 @@ +package cloudvmclusters + +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 AzureResourceProvisioningState string + +const ( + AzureResourceProvisioningStateCanceled AzureResourceProvisioningState = "Canceled" + AzureResourceProvisioningStateFailed AzureResourceProvisioningState = "Failed" + AzureResourceProvisioningStateProvisioning AzureResourceProvisioningState = "Provisioning" + AzureResourceProvisioningStateSucceeded AzureResourceProvisioningState = "Succeeded" +) + +func PossibleValuesForAzureResourceProvisioningState() []string { + return []string{ + string(AzureResourceProvisioningStateCanceled), + string(AzureResourceProvisioningStateFailed), + string(AzureResourceProvisioningStateProvisioning), + string(AzureResourceProvisioningStateSucceeded), + } +} + +func (s *AzureResourceProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureResourceProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureResourceProvisioningState(input string) (*AzureResourceProvisioningState, error) { + vals := map[string]AzureResourceProvisioningState{ + "canceled": AzureResourceProvisioningStateCanceled, + "failed": AzureResourceProvisioningStateFailed, + "provisioning": AzureResourceProvisioningStateProvisioning, + "succeeded": AzureResourceProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureResourceProvisioningState(input) + return &out, nil +} + +type CloudVMClusterLifecycleState string + +const ( + CloudVMClusterLifecycleStateAvailable CloudVMClusterLifecycleState = "Available" + CloudVMClusterLifecycleStateFailed CloudVMClusterLifecycleState = "Failed" + CloudVMClusterLifecycleStateMaintenanceInProgress CloudVMClusterLifecycleState = "MaintenanceInProgress" + CloudVMClusterLifecycleStateProvisioning CloudVMClusterLifecycleState = "Provisioning" + CloudVMClusterLifecycleStateTerminated CloudVMClusterLifecycleState = "Terminated" + CloudVMClusterLifecycleStateTerminating CloudVMClusterLifecycleState = "Terminating" + CloudVMClusterLifecycleStateUpdating CloudVMClusterLifecycleState = "Updating" +) + +func PossibleValuesForCloudVMClusterLifecycleState() []string { + return []string{ + string(CloudVMClusterLifecycleStateAvailable), + string(CloudVMClusterLifecycleStateFailed), + string(CloudVMClusterLifecycleStateMaintenanceInProgress), + string(CloudVMClusterLifecycleStateProvisioning), + string(CloudVMClusterLifecycleStateTerminated), + string(CloudVMClusterLifecycleStateTerminating), + string(CloudVMClusterLifecycleStateUpdating), + } +} + +func (s *CloudVMClusterLifecycleState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCloudVMClusterLifecycleState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCloudVMClusterLifecycleState(input string) (*CloudVMClusterLifecycleState, error) { + vals := map[string]CloudVMClusterLifecycleState{ + "available": CloudVMClusterLifecycleStateAvailable, + "failed": CloudVMClusterLifecycleStateFailed, + "maintenanceinprogress": CloudVMClusterLifecycleStateMaintenanceInProgress, + "provisioning": CloudVMClusterLifecycleStateProvisioning, + "terminated": CloudVMClusterLifecycleStateTerminated, + "terminating": CloudVMClusterLifecycleStateTerminating, + "updating": CloudVMClusterLifecycleStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CloudVMClusterLifecycleState(input) + return &out, nil +} + +type DiskRedundancy string + +const ( + DiskRedundancyHigh DiskRedundancy = "High" + DiskRedundancyNormal DiskRedundancy = "Normal" +) + +func PossibleValuesForDiskRedundancy() []string { + return []string{ + string(DiskRedundancyHigh), + string(DiskRedundancyNormal), + } +} + +func (s *DiskRedundancy) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDiskRedundancy(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDiskRedundancy(input string) (*DiskRedundancy, error) { + vals := map[string]DiskRedundancy{ + "high": DiskRedundancyHigh, + "normal": DiskRedundancyNormal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiskRedundancy(input) + return &out, nil +} + +type IormLifecycleState string + +const ( + IormLifecycleStateBootStrapping IormLifecycleState = "BootStrapping" + IormLifecycleStateDisabled IormLifecycleState = "Disabled" + IormLifecycleStateEnabled IormLifecycleState = "Enabled" + IormLifecycleStateFailed IormLifecycleState = "Failed" + IormLifecycleStateUpdating IormLifecycleState = "Updating" +) + +func PossibleValuesForIormLifecycleState() []string { + return []string{ + string(IormLifecycleStateBootStrapping), + string(IormLifecycleStateDisabled), + string(IormLifecycleStateEnabled), + string(IormLifecycleStateFailed), + string(IormLifecycleStateUpdating), + } +} + +func (s *IormLifecycleState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIormLifecycleState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIormLifecycleState(input string) (*IormLifecycleState, error) { + vals := map[string]IormLifecycleState{ + "bootstrapping": IormLifecycleStateBootStrapping, + "disabled": IormLifecycleStateDisabled, + "enabled": IormLifecycleStateEnabled, + "failed": IormLifecycleStateFailed, + "updating": IormLifecycleStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IormLifecycleState(input) + return &out, nil +} + +type LicenseModel string + +const ( + LicenseModelBringYourOwnLicense LicenseModel = "BringYourOwnLicense" + LicenseModelLicenseIncluded LicenseModel = "LicenseIncluded" +) + +func PossibleValuesForLicenseModel() []string { + return []string{ + string(LicenseModelBringYourOwnLicense), + string(LicenseModelLicenseIncluded), + } +} + +func (s *LicenseModel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLicenseModel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLicenseModel(input string) (*LicenseModel, error) { + vals := map[string]LicenseModel{ + "bringyourownlicense": LicenseModelBringYourOwnLicense, + "licenseincluded": LicenseModelLicenseIncluded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LicenseModel(input) + return &out, nil +} + +type Objective string + +const ( + ObjectiveAuto Objective = "Auto" + ObjectiveBalanced Objective = "Balanced" + ObjectiveBasic Objective = "Basic" + ObjectiveHighThroughput Objective = "HighThroughput" + ObjectiveLowLatency Objective = "LowLatency" +) + +func PossibleValuesForObjective() []string { + return []string{ + string(ObjectiveAuto), + string(ObjectiveBalanced), + string(ObjectiveBasic), + string(ObjectiveHighThroughput), + string(ObjectiveLowLatency), + } +} + +func (s *Objective) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseObjective(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseObjective(input string) (*Objective, error) { + vals := map[string]Objective{ + "auto": ObjectiveAuto, + "balanced": ObjectiveBalanced, + "basic": ObjectiveBasic, + "highthroughput": ObjectiveHighThroughput, + "lowlatency": ObjectiveLowLatency, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Objective(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/id_cloudvmcluster.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/id_cloudvmcluster.go new file mode 100644 index 000000000000..45457dbb4a3f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/id_cloudvmcluster.go @@ -0,0 +1,130 @@ +package cloudvmclusters + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&CloudVMClusterId{}) +} + +var _ resourceids.ResourceId = &CloudVMClusterId{} + +// CloudVMClusterId is a struct representing the Resource ID for a Cloud V M Cluster +type CloudVMClusterId struct { + SubscriptionId string + ResourceGroupName string + CloudVmClusterName string +} + +// NewCloudVMClusterID returns a new CloudVMClusterId struct +func NewCloudVMClusterID(subscriptionId string, resourceGroupName string, cloudVmClusterName string) CloudVMClusterId { + return CloudVMClusterId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + CloudVmClusterName: cloudVmClusterName, + } +} + +// ParseCloudVMClusterID parses 'input' into a CloudVMClusterId +func ParseCloudVMClusterID(input string) (*CloudVMClusterId, error) { + parser := resourceids.NewParserFromResourceIdType(&CloudVMClusterId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CloudVMClusterId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseCloudVMClusterIDInsensitively parses 'input' case-insensitively into a CloudVMClusterId +// note: this method should only be used for API response data and not user input +func ParseCloudVMClusterIDInsensitively(input string) (*CloudVMClusterId, error) { + parser := resourceids.NewParserFromResourceIdType(&CloudVMClusterId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CloudVMClusterId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *CloudVMClusterId) 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.CloudVmClusterName, ok = input.Parsed["cloudVmClusterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "cloudVmClusterName", input) + } + + return nil +} + +// ValidateCloudVMClusterID checks that 'input' can be parsed as a Cloud V M Cluster ID +func ValidateCloudVMClusterID(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 := ParseCloudVMClusterID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Cloud V M Cluster ID +func (id CloudVMClusterId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Oracle.Database/cloudVmClusters/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudVmClusterName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Cloud V M Cluster ID +func (id CloudVMClusterId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticCloudVmClusters", "cloudVmClusters", "cloudVmClusters"), + resourceids.UserSpecifiedSegment("cloudVmClusterName", "cloudVmClusterName"), + } +} + +// String returns a human-readable description of this Cloud V M Cluster ID +func (id CloudVMClusterId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Cloud Vm Cluster Name: %q", id.CloudVmClusterName), + } + return fmt.Sprintf("Cloud V M Cluster (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_addvms.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_addvms.go new file mode 100644 index 000000000000..f83b1419e295 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_addvms.go @@ -0,0 +1,75 @@ +package cloudvmclusters + +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 AddVMsOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *CloudVMCluster +} + +// AddVMs ... +func (c CloudVMClustersClient) AddVMs(ctx context.Context, id CloudVMClusterId, input AddRemoveDbNode) (result AddVMsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/addVms", 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 +} + +// AddVMsThenPoll performs AddVMs then polls until it's completed +func (c CloudVMClustersClient) AddVMsThenPoll(ctx context.Context, id CloudVMClusterId, input AddRemoveDbNode) error { + result, err := c.AddVMs(ctx, id, input) + if err != nil { + return fmt.Errorf("performing AddVMs: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after AddVMs: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_createorupdate.go new file mode 100644 index 000000000000..d4006bf71a37 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_createorupdate.go @@ -0,0 +1,75 @@ +package cloudvmclusters + +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 CreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *CloudVMCluster +} + +// CreateOrUpdate ... +func (c CloudVMClustersClient) CreateOrUpdate(ctx context.Context, id CloudVMClusterId, input CloudVMCluster) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + 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 +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c CloudVMClustersClient) CreateOrUpdateThenPoll(ctx context.Context, id CloudVMClusterId, input CloudVMCluster) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_delete.go new file mode 100644 index 000000000000..d8297753935c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_delete.go @@ -0,0 +1,70 @@ +package cloudvmclusters + +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 DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c CloudVMClustersClient) Delete(ctx context.Context, id CloudVMClusterId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + 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 +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c CloudVMClustersClient) DeleteThenPoll(ctx context.Context, id CloudVMClusterId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_get.go new file mode 100644 index 000000000000..c12e24493113 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_get.go @@ -0,0 +1,53 @@ +package cloudvmclusters + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *CloudVMCluster +} + +// Get ... +func (c CloudVMClustersClient) Get(ctx context.Context, id CloudVMClusterId) (result GetOperationResponse, 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 CloudVMCluster + 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/oracledatabase/2024-06-01/cloudvmclusters/method_listbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_listbyresourcegroup.go new file mode 100644 index 000000000000..c6f023cd9174 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_listbyresourcegroup.go @@ -0,0 +1,106 @@ +package cloudvmclusters + +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 ListByResourceGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]CloudVMCluster +} + +type ListByResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []CloudVMCluster +} + +type ListByResourceGroupCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByResourceGroupCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByResourceGroup ... +func (c CloudVMClustersClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ListByResourceGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByResourceGroupCustomPager{}, + Path: fmt.Sprintf("%s/providers/Oracle.Database/cloudVmClusters", 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 *[]CloudVMCluster `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByResourceGroupComplete retrieves all the results into a single object +func (c CloudVMClustersClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, CloudVMClusterOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c CloudVMClustersClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate CloudVMClusterOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]CloudVMCluster, 0) + + resp, err := c.ListByResourceGroup(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListByResourceGroupCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_listbysubscription.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_listbysubscription.go new file mode 100644 index 000000000000..dfd4dafe7340 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_listbysubscription.go @@ -0,0 +1,106 @@ +package cloudvmclusters + +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 ListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]CloudVMCluster +} + +type ListBySubscriptionCompleteResult struct { + LatestHttpResponse *http.Response + Items []CloudVMCluster +} + +type ListBySubscriptionCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListBySubscriptionCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListBySubscription ... +func (c CloudVMClustersClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListBySubscriptionCustomPager{}, + Path: fmt.Sprintf("%s/providers/Oracle.Database/cloudVmClusters", 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 *[]CloudVMCluster `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListBySubscriptionComplete retrieves all the results into a single object +func (c CloudVMClustersClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { + return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, CloudVMClusterOperationPredicate{}) +} + +// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c CloudVMClustersClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate CloudVMClusterOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { + items := make([]CloudVMCluster, 0) + + resp, err := c.ListBySubscription(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListBySubscriptionCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_listprivateipaddresses.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_listprivateipaddresses.go new file mode 100644 index 000000000000..3cb61c584375 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_listprivateipaddresses.go @@ -0,0 +1,58 @@ +package cloudvmclusters + +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 ListPrivateIPAddressesOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]PrivateIPAddressProperties +} + +// ListPrivateIPAddresses ... +func (c CloudVMClustersClient) ListPrivateIPAddresses(ctx context.Context, id CloudVMClusterId, input PrivateIPAddressesFilter) (result ListPrivateIPAddressesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listPrivateIpAddresses", 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 []PrivateIPAddressProperties + 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/oracledatabase/2024-06-01/cloudvmclusters/method_removevms.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_removevms.go new file mode 100644 index 000000000000..6b285c4817a3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_removevms.go @@ -0,0 +1,75 @@ +package cloudvmclusters + +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 RemoveVMsOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *CloudVMCluster +} + +// RemoveVMs ... +func (c CloudVMClustersClient) RemoveVMs(ctx context.Context, id CloudVMClusterId, input AddRemoveDbNode) (result RemoveVMsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/removeVms", 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 +} + +// RemoveVMsThenPoll performs RemoveVMs then polls until it's completed +func (c CloudVMClustersClient) RemoveVMsThenPoll(ctx context.Context, id CloudVMClusterId, input AddRemoveDbNode) error { + result, err := c.RemoveVMs(ctx, id, input) + if err != nil { + return fmt.Errorf("performing RemoveVMs: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after RemoveVMs: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_update.go new file mode 100644 index 000000000000..b629960e83da --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/method_update.go @@ -0,0 +1,75 @@ +package cloudvmclusters + +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 UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *CloudVMCluster +} + +// Update ... +func (c CloudVMClustersClient) Update(ctx context.Context, id CloudVMClusterId, input CloudVMClusterUpdate) (result UpdateOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c CloudVMClustersClient) UpdateThenPoll(ctx context.Context, id CloudVMClusterId, input CloudVMClusterUpdate) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_addremovedbnode.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_addremovedbnode.go new file mode 100644 index 000000000000..4339e88ab717 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_addremovedbnode.go @@ -0,0 +1,8 @@ +package cloudvmclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AddRemoveDbNode struct { + DbServers []string `json:"dbServers"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_cloudvmcluster.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_cloudvmcluster.go new file mode 100644 index 000000000000..794313d5e119 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_cloudvmcluster.go @@ -0,0 +1,18 @@ +package cloudvmclusters + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudVMCluster struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *CloudVMClusterProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,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/oracledatabase/2024-06-01/cloudvmclusters/model_cloudvmclusterproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_cloudvmclusterproperties.go new file mode 100644 index 000000000000..78eab72444b6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_cloudvmclusterproperties.go @@ -0,0 +1,73 @@ +package cloudvmclusters + +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 CloudVMClusterProperties struct { + BackupSubnetCidr *string `json:"backupSubnetCidr,omitempty"` + CloudExadataInfrastructureId string `json:"cloudExadataInfrastructureId"` + ClusterName *string `json:"clusterName,omitempty"` + CompartmentId *string `json:"compartmentId,omitempty"` + ComputeNodes *[]string `json:"computeNodes,omitempty"` + CpuCoreCount int64 `json:"cpuCoreCount"` + DataCollectionOptions *DataCollectionOptions `json:"dataCollectionOptions,omitempty"` + DataStoragePercentage *int64 `json:"dataStoragePercentage,omitempty"` + DataStorageSizeInTbs *float64 `json:"dataStorageSizeInTbs,omitempty"` + DbNodeStorageSizeInGbs *int64 `json:"dbNodeStorageSizeInGbs,omitempty"` + DbServers *[]string `json:"dbServers,omitempty"` + DiskRedundancy *DiskRedundancy `json:"diskRedundancy,omitempty"` + DisplayName string `json:"displayName"` + Domain *string `json:"domain,omitempty"` + GiVersion string `json:"giVersion"` + Hostname string `json:"hostname"` + IormConfigCache *ExadataIormConfig `json:"iormConfigCache,omitempty"` + IsLocalBackupEnabled *bool `json:"isLocalBackupEnabled,omitempty"` + IsSparseDiskgroupEnabled *bool `json:"isSparseDiskgroupEnabled,omitempty"` + LastUpdateHistoryEntryId *string `json:"lastUpdateHistoryEntryId,omitempty"` + LicenseModel *LicenseModel `json:"licenseModel,omitempty"` + LifecycleDetails *string `json:"lifecycleDetails,omitempty"` + LifecycleState *CloudVMClusterLifecycleState `json:"lifecycleState,omitempty"` + ListenerPort *int64 `json:"listenerPort,omitempty"` + MemorySizeInGbs *int64 `json:"memorySizeInGbs,omitempty"` + NodeCount *int64 `json:"nodeCount,omitempty"` + NsgCidrs *[]NsgCidr `json:"nsgCidrs,omitempty"` + NsgURL *string `json:"nsgUrl,omitempty"` + OciURL *string `json:"ociUrl,omitempty"` + Ocid *string `json:"ocid,omitempty"` + OcpuCount *float64 `json:"ocpuCount,omitempty"` + ProvisioningState *AzureResourceProvisioningState `json:"provisioningState,omitempty"` + ScanDnsName *string `json:"scanDnsName,omitempty"` + ScanDnsRecordId *string `json:"scanDnsRecordId,omitempty"` + ScanIPIds *[]string `json:"scanIpIds,omitempty"` + ScanListenerPortTcp *int64 `json:"scanListenerPortTcp,omitempty"` + ScanListenerPortTcpSsl *int64 `json:"scanListenerPortTcpSsl,omitempty"` + Shape *string `json:"shape,omitempty"` + SshPublicKeys []string `json:"sshPublicKeys"` + StorageSizeInGbs *int64 `json:"storageSizeInGbs,omitempty"` + SubnetId string `json:"subnetId"` + SubnetOcid *string `json:"subnetOcid,omitempty"` + SystemVersion *string `json:"systemVersion,omitempty"` + TimeCreated *string `json:"timeCreated,omitempty"` + TimeZone *string `json:"timeZone,omitempty"` + VipIds *[]string `json:"vipIds,omitempty"` + VnetId string `json:"vnetId"` + ZoneId *string `json:"zoneId,omitempty"` +} + +func (o *CloudVMClusterProperties) GetTimeCreatedAsTime() (*time.Time, error) { + if o.TimeCreated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeCreated, "2006-01-02T15:04:05Z07:00") +} + +func (o *CloudVMClusterProperties) SetTimeCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeCreated = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_cloudvmclusterupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_cloudvmclusterupdate.go new file mode 100644 index 000000000000..9c45a82caab1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_cloudvmclusterupdate.go @@ -0,0 +1,9 @@ +package cloudvmclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudVMClusterUpdate struct { + Properties *CloudVMClusterUpdateProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_cloudvmclusterupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_cloudvmclusterupdateproperties.go new file mode 100644 index 000000000000..b6499789da89 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_cloudvmclusterupdateproperties.go @@ -0,0 +1,18 @@ +package cloudvmclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudVMClusterUpdateProperties struct { + ComputeNodes *[]string `json:"computeNodes,omitempty"` + CpuCoreCount *int64 `json:"cpuCoreCount,omitempty"` + DataCollectionOptions *DataCollectionOptions `json:"dataCollectionOptions,omitempty"` + DataStorageSizeInTbs *float64 `json:"dataStorageSizeInTbs,omitempty"` + DbNodeStorageSizeInGbs *int64 `json:"dbNodeStorageSizeInGbs,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + LicenseModel *LicenseModel `json:"licenseModel,omitempty"` + MemorySizeInGbs *int64 `json:"memorySizeInGbs,omitempty"` + OcpuCount *float64 `json:"ocpuCount,omitempty"` + SshPublicKeys *[]string `json:"sshPublicKeys,omitempty"` + StorageSizeInGbs *int64 `json:"storageSizeInGbs,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_datacollectionoptions.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_datacollectionoptions.go new file mode 100644 index 000000000000..df3ddfd596d8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_datacollectionoptions.go @@ -0,0 +1,10 @@ +package cloudvmclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DataCollectionOptions struct { + IsDiagnosticsEventsEnabled *bool `json:"isDiagnosticsEventsEnabled,omitempty"` + IsHealthMonitoringEnabled *bool `json:"isHealthMonitoringEnabled,omitempty"` + IsIncidentLogsEnabled *bool `json:"isIncidentLogsEnabled,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_dbiormconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_dbiormconfig.go new file mode 100644 index 000000000000..3ec47756c259 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_dbiormconfig.go @@ -0,0 +1,10 @@ +package cloudvmclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DbIormConfig struct { + DbName *string `json:"dbName,omitempty"` + FlashCacheLimit *string `json:"flashCacheLimit,omitempty"` + Share *int64 `json:"share,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_exadataiormconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_exadataiormconfig.go new file mode 100644 index 000000000000..07899f1e94da --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_exadataiormconfig.go @@ -0,0 +1,11 @@ +package cloudvmclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExadataIormConfig struct { + DbPlans *[]DbIormConfig `json:"dbPlans,omitempty"` + LifecycleDetails *string `json:"lifecycleDetails,omitempty"` + LifecycleState *IormLifecycleState `json:"lifecycleState,omitempty"` + Objective *Objective `json:"objective,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_nsgcidr.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_nsgcidr.go new file mode 100644 index 000000000000..7123fc5a165b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_nsgcidr.go @@ -0,0 +1,9 @@ +package cloudvmclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NsgCidr struct { + DestinationPortRange *PortRange `json:"destinationPortRange,omitempty"` + Source string `json:"source"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_portrange.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_portrange.go new file mode 100644 index 000000000000..a3906443e6af --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_portrange.go @@ -0,0 +1,9 @@ +package cloudvmclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PortRange struct { + Max int64 `json:"max"` + Min int64 `json:"min"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_privateipaddressesfilter.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_privateipaddressesfilter.go new file mode 100644 index 000000000000..4986845bb03f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_privateipaddressesfilter.go @@ -0,0 +1,9 @@ +package cloudvmclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateIPAddressesFilter struct { + SubnetId string `json:"subnetId"` + VnicId string `json:"vnicId"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_privateipaddressproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_privateipaddressproperties.go new file mode 100644 index 000000000000..35ac2a7af423 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/model_privateipaddressproperties.go @@ -0,0 +1,12 @@ +package cloudvmclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PrivateIPAddressProperties struct { + DisplayName string `json:"displayName"` + HostnameLabel string `json:"hostnameLabel"` + IPAddress string `json:"ipAddress"` + Ocid string `json:"ocid"` + SubnetId string `json:"subnetId"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/predicates.go new file mode 100644 index 000000000000..174e49c11caf --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/predicates.go @@ -0,0 +1,32 @@ +package cloudvmclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudVMClusterOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p CloudVMClusterOperationPredicate) Matches(input CloudVMCluster) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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 +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/version.go new file mode 100644 index 000000000000..22b5c23989ea --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters/version.go @@ -0,0 +1,10 @@ +package cloudvmclusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-06-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/cloudvmclusters/2024-06-01" +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/README.md new file mode 100644 index 000000000000..85970d8b53af --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/README.md @@ -0,0 +1,70 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes` Documentation + +The `dbnodes` SDK allows for interaction with Azure Resource Manager `oracledatabase` (API Version `2024-06-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-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes" +``` + + +### Client Initialization + +```go +client := dbnodes.NewDbNodesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `DbNodesClient.Action` + +```go +ctx := context.TODO() +id := dbnodes.NewDbNodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName", "dbNodeName") + +payload := dbnodes.DbNodeAction{ + // ... +} + + +if err := client.ActionThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `DbNodesClient.Get` + +```go +ctx := context.TODO() +id := dbnodes.NewDbNodeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName", "dbNodeName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DbNodesClient.ListByCloudVMCluster` + +```go +ctx := context.TODO() +id := dbnodes.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") + +// alternatively `client.ListByCloudVMCluster(ctx, id)` can be used to do batched pagination +items, err := client.ListByCloudVMClusterComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/client.go new file mode 100644 index 000000000000..bce691a3f42a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/client.go @@ -0,0 +1,26 @@ +package dbnodes + +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 DbNodesClient struct { + Client *resourcemanager.Client +} + +func NewDbNodesClientWithBaseURI(sdkApi sdkEnv.Api) (*DbNodesClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "dbnodes", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating DbNodesClient: %+v", err) + } + + return &DbNodesClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/constants.go new file mode 100644 index 000000000000..f0304b7d9619 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/constants.go @@ -0,0 +1,201 @@ +package dbnodes + +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 DbNodeActionEnum string + +const ( + DbNodeActionEnumReset DbNodeActionEnum = "Reset" + DbNodeActionEnumSoftReset DbNodeActionEnum = "SoftReset" + DbNodeActionEnumStart DbNodeActionEnum = "Start" + DbNodeActionEnumStop DbNodeActionEnum = "Stop" +) + +func PossibleValuesForDbNodeActionEnum() []string { + return []string{ + string(DbNodeActionEnumReset), + string(DbNodeActionEnumSoftReset), + string(DbNodeActionEnumStart), + string(DbNodeActionEnumStop), + } +} + +func (s *DbNodeActionEnum) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDbNodeActionEnum(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDbNodeActionEnum(input string) (*DbNodeActionEnum, error) { + vals := map[string]DbNodeActionEnum{ + "reset": DbNodeActionEnumReset, + "softreset": DbNodeActionEnumSoftReset, + "start": DbNodeActionEnumStart, + "stop": DbNodeActionEnumStop, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DbNodeActionEnum(input) + return &out, nil +} + +type DbNodeMaintenanceType string + +const ( + DbNodeMaintenanceTypeVMdbRebootMigration DbNodeMaintenanceType = "VmdbRebootMigration" +) + +func PossibleValuesForDbNodeMaintenanceType() []string { + return []string{ + string(DbNodeMaintenanceTypeVMdbRebootMigration), + } +} + +func (s *DbNodeMaintenanceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDbNodeMaintenanceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDbNodeMaintenanceType(input string) (*DbNodeMaintenanceType, error) { + vals := map[string]DbNodeMaintenanceType{ + "vmdbrebootmigration": DbNodeMaintenanceTypeVMdbRebootMigration, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DbNodeMaintenanceType(input) + return &out, nil +} + +type DbNodeProvisioningState string + +const ( + DbNodeProvisioningStateAvailable DbNodeProvisioningState = "Available" + DbNodeProvisioningStateFailed DbNodeProvisioningState = "Failed" + DbNodeProvisioningStateProvisioning DbNodeProvisioningState = "Provisioning" + DbNodeProvisioningStateStarting DbNodeProvisioningState = "Starting" + DbNodeProvisioningStateStopped DbNodeProvisioningState = "Stopped" + DbNodeProvisioningStateStopping DbNodeProvisioningState = "Stopping" + DbNodeProvisioningStateTerminated DbNodeProvisioningState = "Terminated" + DbNodeProvisioningStateTerminating DbNodeProvisioningState = "Terminating" + DbNodeProvisioningStateUpdating DbNodeProvisioningState = "Updating" +) + +func PossibleValuesForDbNodeProvisioningState() []string { + return []string{ + string(DbNodeProvisioningStateAvailable), + string(DbNodeProvisioningStateFailed), + string(DbNodeProvisioningStateProvisioning), + string(DbNodeProvisioningStateStarting), + string(DbNodeProvisioningStateStopped), + string(DbNodeProvisioningStateStopping), + string(DbNodeProvisioningStateTerminated), + string(DbNodeProvisioningStateTerminating), + string(DbNodeProvisioningStateUpdating), + } +} + +func (s *DbNodeProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDbNodeProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDbNodeProvisioningState(input string) (*DbNodeProvisioningState, error) { + vals := map[string]DbNodeProvisioningState{ + "available": DbNodeProvisioningStateAvailable, + "failed": DbNodeProvisioningStateFailed, + "provisioning": DbNodeProvisioningStateProvisioning, + "starting": DbNodeProvisioningStateStarting, + "stopped": DbNodeProvisioningStateStopped, + "stopping": DbNodeProvisioningStateStopping, + "terminated": DbNodeProvisioningStateTerminated, + "terminating": DbNodeProvisioningStateTerminating, + "updating": DbNodeProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DbNodeProvisioningState(input) + return &out, nil +} + +type ResourceProvisioningState string + +const ( + ResourceProvisioningStateCanceled ResourceProvisioningState = "Canceled" + ResourceProvisioningStateFailed ResourceProvisioningState = "Failed" + ResourceProvisioningStateSucceeded ResourceProvisioningState = "Succeeded" +) + +func PossibleValuesForResourceProvisioningState() []string { + return []string{ + string(ResourceProvisioningStateCanceled), + string(ResourceProvisioningStateFailed), + string(ResourceProvisioningStateSucceeded), + } +} + +func (s *ResourceProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResourceProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResourceProvisioningState(input string) (*ResourceProvisioningState, error) { + vals := map[string]ResourceProvisioningState{ + "canceled": ResourceProvisioningStateCanceled, + "failed": ResourceProvisioningStateFailed, + "succeeded": ResourceProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResourceProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/id_cloudvmcluster.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/id_cloudvmcluster.go new file mode 100644 index 000000000000..cd3b68803c26 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/id_cloudvmcluster.go @@ -0,0 +1,130 @@ +package dbnodes + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&CloudVMClusterId{}) +} + +var _ resourceids.ResourceId = &CloudVMClusterId{} + +// CloudVMClusterId is a struct representing the Resource ID for a Cloud V M Cluster +type CloudVMClusterId struct { + SubscriptionId string + ResourceGroupName string + CloudVmClusterName string +} + +// NewCloudVMClusterID returns a new CloudVMClusterId struct +func NewCloudVMClusterID(subscriptionId string, resourceGroupName string, cloudVmClusterName string) CloudVMClusterId { + return CloudVMClusterId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + CloudVmClusterName: cloudVmClusterName, + } +} + +// ParseCloudVMClusterID parses 'input' into a CloudVMClusterId +func ParseCloudVMClusterID(input string) (*CloudVMClusterId, error) { + parser := resourceids.NewParserFromResourceIdType(&CloudVMClusterId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CloudVMClusterId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseCloudVMClusterIDInsensitively parses 'input' case-insensitively into a CloudVMClusterId +// note: this method should only be used for API response data and not user input +func ParseCloudVMClusterIDInsensitively(input string) (*CloudVMClusterId, error) { + parser := resourceids.NewParserFromResourceIdType(&CloudVMClusterId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CloudVMClusterId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *CloudVMClusterId) 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.CloudVmClusterName, ok = input.Parsed["cloudVmClusterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "cloudVmClusterName", input) + } + + return nil +} + +// ValidateCloudVMClusterID checks that 'input' can be parsed as a Cloud V M Cluster ID +func ValidateCloudVMClusterID(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 := ParseCloudVMClusterID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Cloud V M Cluster ID +func (id CloudVMClusterId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Oracle.Database/cloudVmClusters/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudVmClusterName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Cloud V M Cluster ID +func (id CloudVMClusterId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticCloudVmClusters", "cloudVmClusters", "cloudVmClusters"), + resourceids.UserSpecifiedSegment("cloudVmClusterName", "cloudVmClusterName"), + } +} + +// String returns a human-readable description of this Cloud V M Cluster ID +func (id CloudVMClusterId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Cloud Vm Cluster Name: %q", id.CloudVmClusterName), + } + return fmt.Sprintf("Cloud V M Cluster (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/id_dbnode.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/id_dbnode.go new file mode 100644 index 000000000000..ad7d9c0f4157 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/id_dbnode.go @@ -0,0 +1,139 @@ +package dbnodes + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&DbNodeId{}) +} + +var _ resourceids.ResourceId = &DbNodeId{} + +// DbNodeId is a struct representing the Resource ID for a Db Node +type DbNodeId struct { + SubscriptionId string + ResourceGroupName string + CloudVmClusterName string + DbNodeName string +} + +// NewDbNodeID returns a new DbNodeId struct +func NewDbNodeID(subscriptionId string, resourceGroupName string, cloudVmClusterName string, dbNodeName string) DbNodeId { + return DbNodeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + CloudVmClusterName: cloudVmClusterName, + DbNodeName: dbNodeName, + } +} + +// ParseDbNodeID parses 'input' into a DbNodeId +func ParseDbNodeID(input string) (*DbNodeId, error) { + parser := resourceids.NewParserFromResourceIdType(&DbNodeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DbNodeId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseDbNodeIDInsensitively parses 'input' case-insensitively into a DbNodeId +// note: this method should only be used for API response data and not user input +func ParseDbNodeIDInsensitively(input string) (*DbNodeId, error) { + parser := resourceids.NewParserFromResourceIdType(&DbNodeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DbNodeId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *DbNodeId) 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.CloudVmClusterName, ok = input.Parsed["cloudVmClusterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "cloudVmClusterName", input) + } + + if id.DbNodeName, ok = input.Parsed["dbNodeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "dbNodeName", input) + } + + return nil +} + +// ValidateDbNodeID checks that 'input' can be parsed as a Db Node ID +func ValidateDbNodeID(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 := ParseDbNodeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Db Node ID +func (id DbNodeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Oracle.Database/cloudVmClusters/%s/dbNodes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudVmClusterName, id.DbNodeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Db Node ID +func (id DbNodeId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticCloudVmClusters", "cloudVmClusters", "cloudVmClusters"), + resourceids.UserSpecifiedSegment("cloudVmClusterName", "cloudVmClusterName"), + resourceids.StaticSegment("staticDbNodes", "dbNodes", "dbNodes"), + resourceids.UserSpecifiedSegment("dbNodeName", "dbNodeName"), + } +} + +// String returns a human-readable description of this Db Node ID +func (id DbNodeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Cloud Vm Cluster Name: %q", id.CloudVmClusterName), + fmt.Sprintf("Db Node Name: %q", id.DbNodeName), + } + return fmt.Sprintf("Db Node (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/method_action.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/method_action.go new file mode 100644 index 000000000000..5183df9c35c7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/method_action.go @@ -0,0 +1,75 @@ +package dbnodes + +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 ActionOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *DbNode +} + +// Action ... +func (c DbNodesClient) Action(ctx context.Context, id DbNodeId, input DbNodeAction) (result ActionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/action", 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 +} + +// ActionThenPoll performs Action then polls until it's completed +func (c DbNodesClient) ActionThenPoll(ctx context.Context, id DbNodeId, input DbNodeAction) error { + result, err := c.Action(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Action: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Action: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/method_get.go new file mode 100644 index 000000000000..eeac598cb9ce --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/method_get.go @@ -0,0 +1,53 @@ +package dbnodes + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DbNode +} + +// Get ... +func (c DbNodesClient) Get(ctx context.Context, id DbNodeId) (result GetOperationResponse, 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 DbNode + 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/oracledatabase/2024-06-01/dbnodes/method_listbycloudvmcluster.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/method_listbycloudvmcluster.go new file mode 100644 index 000000000000..f610bea1c1d4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/method_listbycloudvmcluster.go @@ -0,0 +1,105 @@ +package dbnodes + +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 ListByCloudVMClusterOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]DbNode +} + +type ListByCloudVMClusterCompleteResult struct { + LatestHttpResponse *http.Response + Items []DbNode +} + +type ListByCloudVMClusterCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByCloudVMClusterCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByCloudVMCluster ... +func (c DbNodesClient) ListByCloudVMCluster(ctx context.Context, id CloudVMClusterId) (result ListByCloudVMClusterOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByCloudVMClusterCustomPager{}, + Path: fmt.Sprintf("%s/dbNodes", 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 *[]DbNode `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByCloudVMClusterComplete retrieves all the results into a single object +func (c DbNodesClient) ListByCloudVMClusterComplete(ctx context.Context, id CloudVMClusterId) (ListByCloudVMClusterCompleteResult, error) { + return c.ListByCloudVMClusterCompleteMatchingPredicate(ctx, id, DbNodeOperationPredicate{}) +} + +// ListByCloudVMClusterCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c DbNodesClient) ListByCloudVMClusterCompleteMatchingPredicate(ctx context.Context, id CloudVMClusterId, predicate DbNodeOperationPredicate) (result ListByCloudVMClusterCompleteResult, err error) { + items := make([]DbNode, 0) + + resp, err := c.ListByCloudVMCluster(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListByCloudVMClusterCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/model_dbnode.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/model_dbnode.go new file mode 100644 index 000000000000..fb43a32d89f7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/model_dbnode.go @@ -0,0 +1,16 @@ +package dbnodes + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DbNode struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *DbNodeProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/model_dbnodeaction.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/model_dbnodeaction.go new file mode 100644 index 000000000000..c73027704e88 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/model_dbnodeaction.go @@ -0,0 +1,8 @@ +package dbnodes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DbNodeAction struct { + Action DbNodeActionEnum `json:"action"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/model_dbnodeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/model_dbnodeproperties.go new file mode 100644 index 000000000000..57c6546805b9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/model_dbnodeproperties.go @@ -0,0 +1,72 @@ +package dbnodes + +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 DbNodeProperties struct { + AdditionalDetails *string `json:"additionalDetails,omitempty"` + BackupIPId *string `json:"backupIpId,omitempty"` + BackupVnic2Id *string `json:"backupVnic2Id,omitempty"` + BackupVnicId *string `json:"backupVnicId,omitempty"` + CpuCoreCount *int64 `json:"cpuCoreCount,omitempty"` + DbNodeStorageSizeInGbs *int64 `json:"dbNodeStorageSizeInGbs,omitempty"` + DbServerId *string `json:"dbServerId,omitempty"` + DbSystemId *string `json:"dbSystemId,omitempty"` + FaultDomain *string `json:"faultDomain,omitempty"` + HostIPId *string `json:"hostIpId,omitempty"` + Hostname *string `json:"hostname,omitempty"` + LifecycleDetails *string `json:"lifecycleDetails,omitempty"` + LifecycleState *DbNodeProvisioningState `json:"lifecycleState,omitempty"` + MaintenanceType *DbNodeMaintenanceType `json:"maintenanceType,omitempty"` + MemorySizeInGbs *int64 `json:"memorySizeInGbs,omitempty"` + Ocid *string `json:"ocid,omitempty"` + ProvisioningState *ResourceProvisioningState `json:"provisioningState,omitempty"` + SoftwareStorageSizeInGb *int64 `json:"softwareStorageSizeInGb,omitempty"` + TimeCreated *string `json:"timeCreated,omitempty"` + TimeMaintenanceWindowEnd *string `json:"timeMaintenanceWindowEnd,omitempty"` + TimeMaintenanceWindowStart *string `json:"timeMaintenanceWindowStart,omitempty"` + Vnic2Id *string `json:"vnic2Id,omitempty"` + VnicId *string `json:"vnicId,omitempty"` +} + +func (o *DbNodeProperties) GetTimeCreatedAsTime() (*time.Time, error) { + if o.TimeCreated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeCreated, "2006-01-02T15:04:05Z07:00") +} + +func (o *DbNodeProperties) SetTimeCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeCreated = &formatted +} + +func (o *DbNodeProperties) GetTimeMaintenanceWindowEndAsTime() (*time.Time, error) { + if o.TimeMaintenanceWindowEnd == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeMaintenanceWindowEnd, "2006-01-02T15:04:05Z07:00") +} + +func (o *DbNodeProperties) SetTimeMaintenanceWindowEndAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeMaintenanceWindowEnd = &formatted +} + +func (o *DbNodeProperties) GetTimeMaintenanceWindowStartAsTime() (*time.Time, error) { + if o.TimeMaintenanceWindowStart == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeMaintenanceWindowStart, "2006-01-02T15:04:05Z07:00") +} + +func (o *DbNodeProperties) SetTimeMaintenanceWindowStartAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeMaintenanceWindowStart = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/predicates.go new file mode 100644 index 000000000000..d8b48325d587 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/predicates.go @@ -0,0 +1,27 @@ +package dbnodes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DbNodeOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p DbNodeOperationPredicate) Matches(input DbNode) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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/oracledatabase/2024-06-01/dbnodes/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/version.go new file mode 100644 index 000000000000..499e439e0194 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes/version.go @@ -0,0 +1,10 @@ +package dbnodes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-06-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/dbnodes/2024-06-01" +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/README.md new file mode 100644 index 000000000000..3e36e006caba --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers` Documentation + +The `dbservers` SDK allows for interaction with Azure Resource Manager `oracledatabase` (API Version `2024-06-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-sdk/resource-manager/oracledatabase/2024-06-01/dbservers" +``` + + +### Client Initialization + +```go +client := dbservers.NewDbServersClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `DbServersClient.Get` + +```go +ctx := context.TODO() +id := dbservers.NewDbServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName", "dbServerName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DbServersClient.ListByCloudExadataInfrastructure` + +```go +ctx := context.TODO() +id := dbservers.NewCloudExadataInfrastructureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudExadataInfrastructureName") + +// alternatively `client.ListByCloudExadataInfrastructure(ctx, id)` can be used to do batched pagination +items, err := client.ListByCloudExadataInfrastructureComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/client.go new file mode 100644 index 000000000000..29a4e148e487 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/client.go @@ -0,0 +1,26 @@ +package dbservers + +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 DbServersClient struct { + Client *resourcemanager.Client +} + +func NewDbServersClientWithBaseURI(sdkApi sdkEnv.Api) (*DbServersClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "dbservers", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating DbServersClient: %+v", err) + } + + return &DbServersClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/constants.go new file mode 100644 index 000000000000..16d6ef78fb2e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/constants.go @@ -0,0 +1,154 @@ +package dbservers + +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 DbServerPatchingStatus string + +const ( + DbServerPatchingStatusComplete DbServerPatchingStatus = "Complete" + DbServerPatchingStatusFailed DbServerPatchingStatus = "Failed" + DbServerPatchingStatusMaintenanceInProgress DbServerPatchingStatus = "MaintenanceInProgress" + DbServerPatchingStatusScheduled DbServerPatchingStatus = "Scheduled" +) + +func PossibleValuesForDbServerPatchingStatus() []string { + return []string{ + string(DbServerPatchingStatusComplete), + string(DbServerPatchingStatusFailed), + string(DbServerPatchingStatusMaintenanceInProgress), + string(DbServerPatchingStatusScheduled), + } +} + +func (s *DbServerPatchingStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDbServerPatchingStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDbServerPatchingStatus(input string) (*DbServerPatchingStatus, error) { + vals := map[string]DbServerPatchingStatus{ + "complete": DbServerPatchingStatusComplete, + "failed": DbServerPatchingStatusFailed, + "maintenanceinprogress": DbServerPatchingStatusMaintenanceInProgress, + "scheduled": DbServerPatchingStatusScheduled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DbServerPatchingStatus(input) + return &out, nil +} + +type DbServerProvisioningState string + +const ( + DbServerProvisioningStateAvailable DbServerProvisioningState = "Available" + DbServerProvisioningStateCreating DbServerProvisioningState = "Creating" + DbServerProvisioningStateDeleted DbServerProvisioningState = "Deleted" + DbServerProvisioningStateDeleting DbServerProvisioningState = "Deleting" + DbServerProvisioningStateMaintenanceInProgress DbServerProvisioningState = "MaintenanceInProgress" + DbServerProvisioningStateUnavailable DbServerProvisioningState = "Unavailable" +) + +func PossibleValuesForDbServerProvisioningState() []string { + return []string{ + string(DbServerProvisioningStateAvailable), + string(DbServerProvisioningStateCreating), + string(DbServerProvisioningStateDeleted), + string(DbServerProvisioningStateDeleting), + string(DbServerProvisioningStateMaintenanceInProgress), + string(DbServerProvisioningStateUnavailable), + } +} + +func (s *DbServerProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDbServerProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDbServerProvisioningState(input string) (*DbServerProvisioningState, error) { + vals := map[string]DbServerProvisioningState{ + "available": DbServerProvisioningStateAvailable, + "creating": DbServerProvisioningStateCreating, + "deleted": DbServerProvisioningStateDeleted, + "deleting": DbServerProvisioningStateDeleting, + "maintenanceinprogress": DbServerProvisioningStateMaintenanceInProgress, + "unavailable": DbServerProvisioningStateUnavailable, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DbServerProvisioningState(input) + return &out, nil +} + +type ResourceProvisioningState string + +const ( + ResourceProvisioningStateCanceled ResourceProvisioningState = "Canceled" + ResourceProvisioningStateFailed ResourceProvisioningState = "Failed" + ResourceProvisioningStateSucceeded ResourceProvisioningState = "Succeeded" +) + +func PossibleValuesForResourceProvisioningState() []string { + return []string{ + string(ResourceProvisioningStateCanceled), + string(ResourceProvisioningStateFailed), + string(ResourceProvisioningStateSucceeded), + } +} + +func (s *ResourceProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResourceProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResourceProvisioningState(input string) (*ResourceProvisioningState, error) { + vals := map[string]ResourceProvisioningState{ + "canceled": ResourceProvisioningStateCanceled, + "failed": ResourceProvisioningStateFailed, + "succeeded": ResourceProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResourceProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/id_cloudexadatainfrastructure.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/id_cloudexadatainfrastructure.go new file mode 100644 index 000000000000..1a0d2eda3729 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/id_cloudexadatainfrastructure.go @@ -0,0 +1,130 @@ +package dbservers + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&CloudExadataInfrastructureId{}) +} + +var _ resourceids.ResourceId = &CloudExadataInfrastructureId{} + +// CloudExadataInfrastructureId is a struct representing the Resource ID for a Cloud Exadata Infrastructure +type CloudExadataInfrastructureId struct { + SubscriptionId string + ResourceGroupName string + CloudExadataInfrastructureName string +} + +// NewCloudExadataInfrastructureID returns a new CloudExadataInfrastructureId struct +func NewCloudExadataInfrastructureID(subscriptionId string, resourceGroupName string, cloudExadataInfrastructureName string) CloudExadataInfrastructureId { + return CloudExadataInfrastructureId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + CloudExadataInfrastructureName: cloudExadataInfrastructureName, + } +} + +// ParseCloudExadataInfrastructureID parses 'input' into a CloudExadataInfrastructureId +func ParseCloudExadataInfrastructureID(input string) (*CloudExadataInfrastructureId, error) { + parser := resourceids.NewParserFromResourceIdType(&CloudExadataInfrastructureId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CloudExadataInfrastructureId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseCloudExadataInfrastructureIDInsensitively parses 'input' case-insensitively into a CloudExadataInfrastructureId +// note: this method should only be used for API response data and not user input +func ParseCloudExadataInfrastructureIDInsensitively(input string) (*CloudExadataInfrastructureId, error) { + parser := resourceids.NewParserFromResourceIdType(&CloudExadataInfrastructureId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CloudExadataInfrastructureId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *CloudExadataInfrastructureId) 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.CloudExadataInfrastructureName, ok = input.Parsed["cloudExadataInfrastructureName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "cloudExadataInfrastructureName", input) + } + + return nil +} + +// ValidateCloudExadataInfrastructureID checks that 'input' can be parsed as a Cloud Exadata Infrastructure ID +func ValidateCloudExadataInfrastructureID(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 := ParseCloudExadataInfrastructureID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Cloud Exadata Infrastructure ID +func (id CloudExadataInfrastructureId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Oracle.Database/cloudExadataInfrastructures/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudExadataInfrastructureName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Cloud Exadata Infrastructure ID +func (id CloudExadataInfrastructureId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticCloudExadataInfrastructures", "cloudExadataInfrastructures", "cloudExadataInfrastructures"), + resourceids.UserSpecifiedSegment("cloudExadataInfrastructureName", "cloudExadataInfrastructureName"), + } +} + +// String returns a human-readable description of this Cloud Exadata Infrastructure ID +func (id CloudExadataInfrastructureId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Cloud Exadata Infrastructure Name: %q", id.CloudExadataInfrastructureName), + } + return fmt.Sprintf("Cloud Exadata Infrastructure (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/id_dbserver.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/id_dbserver.go new file mode 100644 index 000000000000..d8e6ee908f45 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/id_dbserver.go @@ -0,0 +1,139 @@ +package dbservers + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&DbServerId{}) +} + +var _ resourceids.ResourceId = &DbServerId{} + +// DbServerId is a struct representing the Resource ID for a Db Server +type DbServerId struct { + SubscriptionId string + ResourceGroupName string + CloudExadataInfrastructureName string + DbServerName string +} + +// NewDbServerID returns a new DbServerId struct +func NewDbServerID(subscriptionId string, resourceGroupName string, cloudExadataInfrastructureName string, dbServerName string) DbServerId { + return DbServerId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + CloudExadataInfrastructureName: cloudExadataInfrastructureName, + DbServerName: dbServerName, + } +} + +// ParseDbServerID parses 'input' into a DbServerId +func ParseDbServerID(input string) (*DbServerId, error) { + parser := resourceids.NewParserFromResourceIdType(&DbServerId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DbServerId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseDbServerIDInsensitively parses 'input' case-insensitively into a DbServerId +// note: this method should only be used for API response data and not user input +func ParseDbServerIDInsensitively(input string) (*DbServerId, error) { + parser := resourceids.NewParserFromResourceIdType(&DbServerId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DbServerId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *DbServerId) 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.CloudExadataInfrastructureName, ok = input.Parsed["cloudExadataInfrastructureName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "cloudExadataInfrastructureName", input) + } + + if id.DbServerName, ok = input.Parsed["dbServerName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "dbServerName", input) + } + + return nil +} + +// ValidateDbServerID checks that 'input' can be parsed as a Db Server ID +func ValidateDbServerID(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 := ParseDbServerID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Db Server ID +func (id DbServerId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Oracle.Database/cloudExadataInfrastructures/%s/dbServers/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudExadataInfrastructureName, id.DbServerName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Db Server ID +func (id DbServerId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticCloudExadataInfrastructures", "cloudExadataInfrastructures", "cloudExadataInfrastructures"), + resourceids.UserSpecifiedSegment("cloudExadataInfrastructureName", "cloudExadataInfrastructureName"), + resourceids.StaticSegment("staticDbServers", "dbServers", "dbServers"), + resourceids.UserSpecifiedSegment("dbServerName", "dbServerName"), + } +} + +// String returns a human-readable description of this Db Server ID +func (id DbServerId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Cloud Exadata Infrastructure Name: %q", id.CloudExadataInfrastructureName), + fmt.Sprintf("Db Server Name: %q", id.DbServerName), + } + return fmt.Sprintf("Db Server (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/method_get.go new file mode 100644 index 000000000000..2a0abdf7d6d3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/method_get.go @@ -0,0 +1,53 @@ +package dbservers + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DbServer +} + +// Get ... +func (c DbServersClient) Get(ctx context.Context, id DbServerId) (result GetOperationResponse, 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 DbServer + 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/oracledatabase/2024-06-01/dbservers/method_listbycloudexadatainfrastructure.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/method_listbycloudexadatainfrastructure.go new file mode 100644 index 000000000000..7440cdef40af --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/method_listbycloudexadatainfrastructure.go @@ -0,0 +1,105 @@ +package dbservers + +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 ListByCloudExadataInfrastructureOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]DbServer +} + +type ListByCloudExadataInfrastructureCompleteResult struct { + LatestHttpResponse *http.Response + Items []DbServer +} + +type ListByCloudExadataInfrastructureCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByCloudExadataInfrastructureCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByCloudExadataInfrastructure ... +func (c DbServersClient) ListByCloudExadataInfrastructure(ctx context.Context, id CloudExadataInfrastructureId) (result ListByCloudExadataInfrastructureOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByCloudExadataInfrastructureCustomPager{}, + Path: fmt.Sprintf("%s/dbServers", 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 *[]DbServer `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByCloudExadataInfrastructureComplete retrieves all the results into a single object +func (c DbServersClient) ListByCloudExadataInfrastructureComplete(ctx context.Context, id CloudExadataInfrastructureId) (ListByCloudExadataInfrastructureCompleteResult, error) { + return c.ListByCloudExadataInfrastructureCompleteMatchingPredicate(ctx, id, DbServerOperationPredicate{}) +} + +// ListByCloudExadataInfrastructureCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c DbServersClient) ListByCloudExadataInfrastructureCompleteMatchingPredicate(ctx context.Context, id CloudExadataInfrastructureId, predicate DbServerOperationPredicate) (result ListByCloudExadataInfrastructureCompleteResult, err error) { + items := make([]DbServer, 0) + + resp, err := c.ListByCloudExadataInfrastructure(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListByCloudExadataInfrastructureCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/model_dbserver.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/model_dbserver.go new file mode 100644 index 000000000000..a88571f86139 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/model_dbserver.go @@ -0,0 +1,16 @@ +package dbservers + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DbServer struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *DbServerProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/model_dbserverpatchingdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/model_dbserverpatchingdetails.go new file mode 100644 index 000000000000..5bb65512c64a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/model_dbserverpatchingdetails.go @@ -0,0 +1,41 @@ +package dbservers + +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 DbServerPatchingDetails struct { + EstimatedPatchDuration *int64 `json:"estimatedPatchDuration,omitempty"` + PatchingStatus *DbServerPatchingStatus `json:"patchingStatus,omitempty"` + TimePatchingEnded *string `json:"timePatchingEnded,omitempty"` + TimePatchingStarted *string `json:"timePatchingStarted,omitempty"` +} + +func (o *DbServerPatchingDetails) GetTimePatchingEndedAsTime() (*time.Time, error) { + if o.TimePatchingEnded == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimePatchingEnded, "2006-01-02T15:04:05Z07:00") +} + +func (o *DbServerPatchingDetails) SetTimePatchingEndedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimePatchingEnded = &formatted +} + +func (o *DbServerPatchingDetails) GetTimePatchingStartedAsTime() (*time.Time, error) { + if o.TimePatchingStarted == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimePatchingStarted, "2006-01-02T15:04:05Z07:00") +} + +func (o *DbServerPatchingDetails) SetTimePatchingStartedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimePatchingStarted = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/model_dbserverproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/model_dbserverproperties.go new file mode 100644 index 000000000000..39df4cede8cc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/model_dbserverproperties.go @@ -0,0 +1,45 @@ +package dbservers + +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 DbServerProperties struct { + AutonomousVMClusterIds *[]string `json:"autonomousVmClusterIds,omitempty"` + AutonomousVirtualMachineIds *[]string `json:"autonomousVirtualMachineIds,omitempty"` + CompartmentId *string `json:"compartmentId,omitempty"` + CpuCoreCount *int64 `json:"cpuCoreCount,omitempty"` + DbNodeIds *[]string `json:"dbNodeIds,omitempty"` + DbNodeStorageSizeInGbs *int64 `json:"dbNodeStorageSizeInGbs,omitempty"` + DbServerPatchingDetails *DbServerPatchingDetails `json:"dbServerPatchingDetails,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + ExadataInfrastructureId *string `json:"exadataInfrastructureId,omitempty"` + LifecycleDetails *string `json:"lifecycleDetails,omitempty"` + LifecycleState *DbServerProvisioningState `json:"lifecycleState,omitempty"` + MaxCPUCount *int64 `json:"maxCpuCount,omitempty"` + MaxDbNodeStorageInGbs *int64 `json:"maxDbNodeStorageInGbs,omitempty"` + MaxMemoryInGbs *int64 `json:"maxMemoryInGbs,omitempty"` + MemorySizeInGbs *int64 `json:"memorySizeInGbs,omitempty"` + Ocid *string `json:"ocid,omitempty"` + ProvisioningState *ResourceProvisioningState `json:"provisioningState,omitempty"` + Shape *string `json:"shape,omitempty"` + TimeCreated *string `json:"timeCreated,omitempty"` + VMClusterIds *[]string `json:"vmClusterIds,omitempty"` +} + +func (o *DbServerProperties) GetTimeCreatedAsTime() (*time.Time, error) { + if o.TimeCreated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeCreated, "2006-01-02T15:04:05Z07:00") +} + +func (o *DbServerProperties) SetTimeCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeCreated = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/predicates.go new file mode 100644 index 000000000000..dfcc35d7ef63 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/predicates.go @@ -0,0 +1,27 @@ +package dbservers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DbServerOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p DbServerOperationPredicate) Matches(input DbServer) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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/oracledatabase/2024-06-01/dbservers/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/version.go new file mode 100644 index 000000000000..3bab629a73b4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers/version.go @@ -0,0 +1,10 @@ +package dbservers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-06-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/dbservers/2024-06-01" +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/README.md new file mode 100644 index 000000000000..9f85e3128247 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes` Documentation + +The `dbsystemshapes` SDK allows for interaction with Azure Resource Manager `oracledatabase` (API Version `2024-06-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-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes" +``` + + +### Client Initialization + +```go +client := dbsystemshapes.NewDbSystemShapesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `DbSystemShapesClient.Get` + +```go +ctx := context.TODO() +id := dbsystemshapes.NewDbSystemShapeID("12345678-1234-9876-4563-123456789012", "locationName", "dbSystemShapeName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DbSystemShapesClient.ListByLocation` + +```go +ctx := context.TODO() +id := dbsystemshapes.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") + +// alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination +items, err := client.ListByLocationComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/client.go new file mode 100644 index 000000000000..82bf6b4be585 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/client.go @@ -0,0 +1,26 @@ +package dbsystemshapes + +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 DbSystemShapesClient struct { + Client *resourcemanager.Client +} + +func NewDbSystemShapesClientWithBaseURI(sdkApi sdkEnv.Api) (*DbSystemShapesClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "dbsystemshapes", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating DbSystemShapesClient: %+v", err) + } + + return &DbSystemShapesClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_dbsystemshape.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_dbsystemshape.go new file mode 100644 index 000000000000..1215665cae7c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_dbsystemshape.go @@ -0,0 +1,130 @@ +package dbsystemshapes + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&DbSystemShapeId{}) +} + +var _ resourceids.ResourceId = &DbSystemShapeId{} + +// DbSystemShapeId is a struct representing the Resource ID for a Db System Shape +type DbSystemShapeId struct { + SubscriptionId string + LocationName string + DbSystemShapeName string +} + +// NewDbSystemShapeID returns a new DbSystemShapeId struct +func NewDbSystemShapeID(subscriptionId string, locationName string, dbSystemShapeName string) DbSystemShapeId { + return DbSystemShapeId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + DbSystemShapeName: dbSystemShapeName, + } +} + +// ParseDbSystemShapeID parses 'input' into a DbSystemShapeId +func ParseDbSystemShapeID(input string) (*DbSystemShapeId, error) { + parser := resourceids.NewParserFromResourceIdType(&DbSystemShapeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DbSystemShapeId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseDbSystemShapeIDInsensitively parses 'input' case-insensitively into a DbSystemShapeId +// note: this method should only be used for API response data and not user input +func ParseDbSystemShapeIDInsensitively(input string) (*DbSystemShapeId, error) { + parser := resourceids.NewParserFromResourceIdType(&DbSystemShapeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DbSystemShapeId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *DbSystemShapeId) 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) + } + + if id.DbSystemShapeName, ok = input.Parsed["dbSystemShapeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "dbSystemShapeName", input) + } + + return nil +} + +// ValidateDbSystemShapeID checks that 'input' can be parsed as a Db System Shape ID +func ValidateDbSystemShapeID(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 := ParseDbSystemShapeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Db System Shape ID +func (id DbSystemShapeId) ID() string { + fmtString := "/subscriptions/%s/providers/Oracle.Database/locations/%s/dbSystemShapes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName, id.DbSystemShapeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Db System Shape ID +func (id DbSystemShapeId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + resourceids.StaticSegment("staticDbSystemShapes", "dbSystemShapes", "dbSystemShapes"), + resourceids.UserSpecifiedSegment("dbSystemShapeName", "dbSystemShapeName"), + } +} + +// String returns a human-readable description of this Db System Shape ID +func (id DbSystemShapeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + fmt.Sprintf("Db System Shape Name: %q", id.DbSystemShapeName), + } + return fmt.Sprintf("Db System Shape (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_location.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_location.go new file mode 100644 index 000000000000..56e5e6d1a135 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/id_location.go @@ -0,0 +1,121 @@ +package dbsystemshapes + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&LocationId{}) +} + +var _ resourceids.ResourceId = &LocationId{} + +// LocationId is a struct representing the Resource ID for a Location +type LocationId struct { + SubscriptionId string + LocationName string +} + +// NewLocationID returns a new LocationId struct +func NewLocationID(subscriptionId string, locationName string) LocationId { + return LocationId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + } +} + +// ParseLocationID parses 'input' into a LocationId +func ParseLocationID(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseLocationIDInsensitively parses 'input' case-insensitively into a LocationId +// note: this method should only be used for API response data and not user input +func ParseLocationIDInsensitively(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *LocationId) 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 +} + +// ValidateLocationID checks that 'input' can be parsed as a Location ID +func ValidateLocationID(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 := ParseLocationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Location ID +func (id LocationId) ID() string { + fmtString := "/subscriptions/%s/providers/Oracle.Database/locations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Location ID +func (id LocationId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + } +} + +// String returns a human-readable description of this Location ID +func (id LocationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + } + return fmt.Sprintf("Location (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/method_get.go new file mode 100644 index 000000000000..3d30b9db9fcc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/method_get.go @@ -0,0 +1,53 @@ +package dbsystemshapes + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DbSystemShape +} + +// Get ... +func (c DbSystemShapesClient) Get(ctx context.Context, id DbSystemShapeId) (result GetOperationResponse, 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 DbSystemShape + 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/oracledatabase/2024-06-01/dbsystemshapes/method_listbylocation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/method_listbylocation.go new file mode 100644 index 000000000000..c96b27700321 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/method_listbylocation.go @@ -0,0 +1,105 @@ +package dbsystemshapes + +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 ListByLocationOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]DbSystemShape +} + +type ListByLocationCompleteResult struct { + LatestHttpResponse *http.Response + Items []DbSystemShape +} + +type ListByLocationCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByLocationCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByLocation ... +func (c DbSystemShapesClient) ListByLocation(ctx context.Context, id LocationId) (result ListByLocationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByLocationCustomPager{}, + Path: fmt.Sprintf("%s/dbSystemShapes", 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 *[]DbSystemShape `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByLocationComplete retrieves all the results into a single object +func (c DbSystemShapesClient) ListByLocationComplete(ctx context.Context, id LocationId) (ListByLocationCompleteResult, error) { + return c.ListByLocationCompleteMatchingPredicate(ctx, id, DbSystemShapeOperationPredicate{}) +} + +// ListByLocationCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c DbSystemShapesClient) ListByLocationCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate DbSystemShapeOperationPredicate) (result ListByLocationCompleteResult, err error) { + items := make([]DbSystemShape, 0) + + resp, err := c.ListByLocation(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListByLocationCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/model_dbsystemshape.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/model_dbsystemshape.go new file mode 100644 index 000000000000..698136573519 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/model_dbsystemshape.go @@ -0,0 +1,16 @@ +package dbsystemshapes + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DbSystemShape struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *DbSystemShapeProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/model_dbsystemshapeproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/model_dbsystemshapeproperties.go new file mode 100644 index 000000000000..a7642317091f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/model_dbsystemshapeproperties.go @@ -0,0 +1,27 @@ +package dbsystemshapes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DbSystemShapeProperties struct { + AvailableCoreCount *int64 `json:"availableCoreCount,omitempty"` + AvailableCoreCountPerNode *int64 `json:"availableCoreCountPerNode,omitempty"` + AvailableDataStorageInTbs *int64 `json:"availableDataStorageInTbs,omitempty"` + AvailableDataStoragePerServerInTbs *float64 `json:"availableDataStoragePerServerInTbs,omitempty"` + AvailableDbNodePerNodeInGbs *int64 `json:"availableDbNodePerNodeInGbs,omitempty"` + AvailableDbNodeStorageInGbs *int64 `json:"availableDbNodeStorageInGbs,omitempty"` + AvailableMemoryInGbs *int64 `json:"availableMemoryInGbs,omitempty"` + AvailableMemoryPerNodeInGbs *int64 `json:"availableMemoryPerNodeInGbs,omitempty"` + CoreCountIncrement *int64 `json:"coreCountIncrement,omitempty"` + MaxStorageCount *int64 `json:"maxStorageCount,omitempty"` + MaximumNodeCount *int64 `json:"maximumNodeCount,omitempty"` + MinCoreCountPerNode *int64 `json:"minCoreCountPerNode,omitempty"` + MinDataStorageInTbs *int64 `json:"minDataStorageInTbs,omitempty"` + MinDbNodeStoragePerNodeInGbs *int64 `json:"minDbNodeStoragePerNodeInGbs,omitempty"` + MinMemoryPerNodeInGbs *int64 `json:"minMemoryPerNodeInGbs,omitempty"` + MinStorageCount *int64 `json:"minStorageCount,omitempty"` + MinimumCoreCount *int64 `json:"minimumCoreCount,omitempty"` + MinimumNodeCount *int64 `json:"minimumNodeCount,omitempty"` + RuntimeMinimumCoreCount *int64 `json:"runtimeMinimumCoreCount,omitempty"` + ShapeFamily *string `json:"shapeFamily,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/predicates.go new file mode 100644 index 000000000000..34452fe4cf66 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/predicates.go @@ -0,0 +1,27 @@ +package dbsystemshapes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DbSystemShapeOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p DbSystemShapeOperationPredicate) Matches(input DbSystemShape) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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/oracledatabase/2024-06-01/dbsystemshapes/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/version.go new file mode 100644 index 000000000000..9f5c5fd85452 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes/version.go @@ -0,0 +1,10 @@ +package dbsystemshapes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-06-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/dbsystemshapes/2024-06-01" +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/README.md new file mode 100644 index 000000000000..35c7040b7db2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews` Documentation + +The `dnsprivateviews` SDK allows for interaction with Azure Resource Manager `oracledatabase` (API Version `2024-06-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-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews" +``` + + +### Client Initialization + +```go +client := dnsprivateviews.NewDnsPrivateViewsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `DnsPrivateViewsClient.Get` + +```go +ctx := context.TODO() +id := dnsprivateviews.NewDnsPrivateViewID("12345678-1234-9876-4563-123456789012", "locationName", "dnsPrivateViewName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DnsPrivateViewsClient.ListByLocation` + +```go +ctx := context.TODO() +id := dnsprivateviews.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") + +// alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination +items, err := client.ListByLocationComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/client.go new file mode 100644 index 000000000000..85e60c22dc91 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/client.go @@ -0,0 +1,26 @@ +package dnsprivateviews + +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 DnsPrivateViewsClient struct { + Client *resourcemanager.Client +} + +func NewDnsPrivateViewsClientWithBaseURI(sdkApi sdkEnv.Api) (*DnsPrivateViewsClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "dnsprivateviews", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating DnsPrivateViewsClient: %+v", err) + } + + return &DnsPrivateViewsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/constants.go new file mode 100644 index 000000000000..2dbb8a48f9ef --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/constants.go @@ -0,0 +1,101 @@ +package dnsprivateviews + +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 DnsPrivateViewsLifecycleState string + +const ( + DnsPrivateViewsLifecycleStateActive DnsPrivateViewsLifecycleState = "Active" + DnsPrivateViewsLifecycleStateDeleted DnsPrivateViewsLifecycleState = "Deleted" + DnsPrivateViewsLifecycleStateDeleting DnsPrivateViewsLifecycleState = "Deleting" + DnsPrivateViewsLifecycleStateUpdating DnsPrivateViewsLifecycleState = "Updating" +) + +func PossibleValuesForDnsPrivateViewsLifecycleState() []string { + return []string{ + string(DnsPrivateViewsLifecycleStateActive), + string(DnsPrivateViewsLifecycleStateDeleted), + string(DnsPrivateViewsLifecycleStateDeleting), + string(DnsPrivateViewsLifecycleStateUpdating), + } +} + +func (s *DnsPrivateViewsLifecycleState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDnsPrivateViewsLifecycleState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDnsPrivateViewsLifecycleState(input string) (*DnsPrivateViewsLifecycleState, error) { + vals := map[string]DnsPrivateViewsLifecycleState{ + "active": DnsPrivateViewsLifecycleStateActive, + "deleted": DnsPrivateViewsLifecycleStateDeleted, + "deleting": DnsPrivateViewsLifecycleStateDeleting, + "updating": DnsPrivateViewsLifecycleStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DnsPrivateViewsLifecycleState(input) + return &out, nil +} + +type ResourceProvisioningState string + +const ( + ResourceProvisioningStateCanceled ResourceProvisioningState = "Canceled" + ResourceProvisioningStateFailed ResourceProvisioningState = "Failed" + ResourceProvisioningStateSucceeded ResourceProvisioningState = "Succeeded" +) + +func PossibleValuesForResourceProvisioningState() []string { + return []string{ + string(ResourceProvisioningStateCanceled), + string(ResourceProvisioningStateFailed), + string(ResourceProvisioningStateSucceeded), + } +} + +func (s *ResourceProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResourceProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResourceProvisioningState(input string) (*ResourceProvisioningState, error) { + vals := map[string]ResourceProvisioningState{ + "canceled": ResourceProvisioningStateCanceled, + "failed": ResourceProvisioningStateFailed, + "succeeded": ResourceProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResourceProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_dnsprivateview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_dnsprivateview.go new file mode 100644 index 000000000000..a2434fd5825f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_dnsprivateview.go @@ -0,0 +1,130 @@ +package dnsprivateviews + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&DnsPrivateViewId{}) +} + +var _ resourceids.ResourceId = &DnsPrivateViewId{} + +// DnsPrivateViewId is a struct representing the Resource ID for a Dns Private View +type DnsPrivateViewId struct { + SubscriptionId string + LocationName string + DnsPrivateViewName string +} + +// NewDnsPrivateViewID returns a new DnsPrivateViewId struct +func NewDnsPrivateViewID(subscriptionId string, locationName string, dnsPrivateViewName string) DnsPrivateViewId { + return DnsPrivateViewId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + DnsPrivateViewName: dnsPrivateViewName, + } +} + +// ParseDnsPrivateViewID parses 'input' into a DnsPrivateViewId +func ParseDnsPrivateViewID(input string) (*DnsPrivateViewId, error) { + parser := resourceids.NewParserFromResourceIdType(&DnsPrivateViewId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DnsPrivateViewId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseDnsPrivateViewIDInsensitively parses 'input' case-insensitively into a DnsPrivateViewId +// note: this method should only be used for API response data and not user input +func ParseDnsPrivateViewIDInsensitively(input string) (*DnsPrivateViewId, error) { + parser := resourceids.NewParserFromResourceIdType(&DnsPrivateViewId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DnsPrivateViewId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *DnsPrivateViewId) 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) + } + + if id.DnsPrivateViewName, ok = input.Parsed["dnsPrivateViewName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "dnsPrivateViewName", input) + } + + return nil +} + +// ValidateDnsPrivateViewID checks that 'input' can be parsed as a Dns Private View ID +func ValidateDnsPrivateViewID(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 := ParseDnsPrivateViewID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Dns Private View ID +func (id DnsPrivateViewId) ID() string { + fmtString := "/subscriptions/%s/providers/Oracle.Database/locations/%s/dnsPrivateViews/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName, id.DnsPrivateViewName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Dns Private View ID +func (id DnsPrivateViewId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + resourceids.StaticSegment("staticDnsPrivateViews", "dnsPrivateViews", "dnsPrivateViews"), + resourceids.UserSpecifiedSegment("dnsPrivateViewName", "dnsPrivateViewName"), + } +} + +// String returns a human-readable description of this Dns Private View ID +func (id DnsPrivateViewId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + fmt.Sprintf("Dns Private View Name: %q", id.DnsPrivateViewName), + } + return fmt.Sprintf("Dns Private View (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_location.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_location.go new file mode 100644 index 000000000000..8224f875a870 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/id_location.go @@ -0,0 +1,121 @@ +package dnsprivateviews + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&LocationId{}) +} + +var _ resourceids.ResourceId = &LocationId{} + +// LocationId is a struct representing the Resource ID for a Location +type LocationId struct { + SubscriptionId string + LocationName string +} + +// NewLocationID returns a new LocationId struct +func NewLocationID(subscriptionId string, locationName string) LocationId { + return LocationId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + } +} + +// ParseLocationID parses 'input' into a LocationId +func ParseLocationID(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseLocationIDInsensitively parses 'input' case-insensitively into a LocationId +// note: this method should only be used for API response data and not user input +func ParseLocationIDInsensitively(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *LocationId) 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 +} + +// ValidateLocationID checks that 'input' can be parsed as a Location ID +func ValidateLocationID(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 := ParseLocationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Location ID +func (id LocationId) ID() string { + fmtString := "/subscriptions/%s/providers/Oracle.Database/locations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Location ID +func (id LocationId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + } +} + +// String returns a human-readable description of this Location ID +func (id LocationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + } + return fmt.Sprintf("Location (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/method_get.go new file mode 100644 index 000000000000..81ad40dd47f9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/method_get.go @@ -0,0 +1,53 @@ +package dnsprivateviews + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DnsPrivateView +} + +// Get ... +func (c DnsPrivateViewsClient) Get(ctx context.Context, id DnsPrivateViewId) (result GetOperationResponse, 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 DnsPrivateView + 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/oracledatabase/2024-06-01/dnsprivateviews/method_listbylocation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/method_listbylocation.go new file mode 100644 index 000000000000..a0a0c8227706 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/method_listbylocation.go @@ -0,0 +1,105 @@ +package dnsprivateviews + +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 ListByLocationOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]DnsPrivateView +} + +type ListByLocationCompleteResult struct { + LatestHttpResponse *http.Response + Items []DnsPrivateView +} + +type ListByLocationCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByLocationCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByLocation ... +func (c DnsPrivateViewsClient) ListByLocation(ctx context.Context, id LocationId) (result ListByLocationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByLocationCustomPager{}, + Path: fmt.Sprintf("%s/dnsPrivateViews", 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 *[]DnsPrivateView `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByLocationComplete retrieves all the results into a single object +func (c DnsPrivateViewsClient) ListByLocationComplete(ctx context.Context, id LocationId) (ListByLocationCompleteResult, error) { + return c.ListByLocationCompleteMatchingPredicate(ctx, id, DnsPrivateViewOperationPredicate{}) +} + +// ListByLocationCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c DnsPrivateViewsClient) ListByLocationCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate DnsPrivateViewOperationPredicate) (result ListByLocationCompleteResult, err error) { + items := make([]DnsPrivateView, 0) + + resp, err := c.ListByLocation(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListByLocationCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/model_dnsprivateview.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/model_dnsprivateview.go new file mode 100644 index 000000000000..fbf51b79e0f9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/model_dnsprivateview.go @@ -0,0 +1,16 @@ +package dnsprivateviews + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsPrivateView struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *DnsPrivateViewProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/model_dnsprivateviewproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/model_dnsprivateviewproperties.go new file mode 100644 index 000000000000..40cd3cf0a934 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/model_dnsprivateviewproperties.go @@ -0,0 +1,45 @@ +package dnsprivateviews + +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 DnsPrivateViewProperties struct { + DisplayName *string `json:"displayName,omitempty"` + IsProtected *bool `json:"isProtected,omitempty"` + LifecycleState *DnsPrivateViewsLifecycleState `json:"lifecycleState,omitempty"` + Ocid *string `json:"ocid,omitempty"` + ProvisioningState *ResourceProvisioningState `json:"provisioningState,omitempty"` + Self *string `json:"self,omitempty"` + TimeCreated *string `json:"timeCreated,omitempty"` + TimeUpdated *string `json:"timeUpdated,omitempty"` +} + +func (o *DnsPrivateViewProperties) GetTimeCreatedAsTime() (*time.Time, error) { + if o.TimeCreated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeCreated, "2006-01-02T15:04:05Z07:00") +} + +func (o *DnsPrivateViewProperties) SetTimeCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeCreated = &formatted +} + +func (o *DnsPrivateViewProperties) GetTimeUpdatedAsTime() (*time.Time, error) { + if o.TimeUpdated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeUpdated, "2006-01-02T15:04:05Z07:00") +} + +func (o *DnsPrivateViewProperties) SetTimeUpdatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeUpdated = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/predicates.go new file mode 100644 index 000000000000..294303d391a6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/predicates.go @@ -0,0 +1,27 @@ +package dnsprivateviews + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsPrivateViewOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p DnsPrivateViewOperationPredicate) Matches(input DnsPrivateView) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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/oracledatabase/2024-06-01/dnsprivateviews/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/version.go new file mode 100644 index 000000000000..59cdb15f8049 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews/version.go @@ -0,0 +1,10 @@ +package dnsprivateviews + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-06-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/dnsprivateviews/2024-06-01" +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/README.md new file mode 100644 index 000000000000..c9a337f5f3da --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones` Documentation + +The `dnsprivatezones` SDK allows for interaction with Azure Resource Manager `oracledatabase` (API Version `2024-06-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-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones" +``` + + +### Client Initialization + +```go +client := dnsprivatezones.NewDnsPrivateZonesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `DnsPrivateZonesClient.Get` + +```go +ctx := context.TODO() +id := dnsprivatezones.NewDnsPrivateZoneID("12345678-1234-9876-4563-123456789012", "locationName", "dnsPrivateZoneName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DnsPrivateZonesClient.ListByLocation` + +```go +ctx := context.TODO() +id := dnsprivatezones.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") + +// alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination +items, err := client.ListByLocationComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/client.go new file mode 100644 index 000000000000..5596628406ee --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/client.go @@ -0,0 +1,26 @@ +package dnsprivatezones + +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 DnsPrivateZonesClient struct { + Client *resourcemanager.Client +} + +func NewDnsPrivateZonesClientWithBaseURI(sdkApi sdkEnv.Api) (*DnsPrivateZonesClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "dnsprivatezones", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating DnsPrivateZonesClient: %+v", err) + } + + return &DnsPrivateZonesClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/constants.go new file mode 100644 index 000000000000..e95028805465 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/constants.go @@ -0,0 +1,145 @@ +package dnsprivatezones + +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 DnsPrivateZonesLifecycleState string + +const ( + DnsPrivateZonesLifecycleStateActive DnsPrivateZonesLifecycleState = "Active" + DnsPrivateZonesLifecycleStateCreating DnsPrivateZonesLifecycleState = "Creating" + DnsPrivateZonesLifecycleStateDeleted DnsPrivateZonesLifecycleState = "Deleted" + DnsPrivateZonesLifecycleStateDeleting DnsPrivateZonesLifecycleState = "Deleting" + DnsPrivateZonesLifecycleStateUpdating DnsPrivateZonesLifecycleState = "Updating" +) + +func PossibleValuesForDnsPrivateZonesLifecycleState() []string { + return []string{ + string(DnsPrivateZonesLifecycleStateActive), + string(DnsPrivateZonesLifecycleStateCreating), + string(DnsPrivateZonesLifecycleStateDeleted), + string(DnsPrivateZonesLifecycleStateDeleting), + string(DnsPrivateZonesLifecycleStateUpdating), + } +} + +func (s *DnsPrivateZonesLifecycleState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDnsPrivateZonesLifecycleState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDnsPrivateZonesLifecycleState(input string) (*DnsPrivateZonesLifecycleState, error) { + vals := map[string]DnsPrivateZonesLifecycleState{ + "active": DnsPrivateZonesLifecycleStateActive, + "creating": DnsPrivateZonesLifecycleStateCreating, + "deleted": DnsPrivateZonesLifecycleStateDeleted, + "deleting": DnsPrivateZonesLifecycleStateDeleting, + "updating": DnsPrivateZonesLifecycleStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DnsPrivateZonesLifecycleState(input) + return &out, nil +} + +type ResourceProvisioningState string + +const ( + ResourceProvisioningStateCanceled ResourceProvisioningState = "Canceled" + ResourceProvisioningStateFailed ResourceProvisioningState = "Failed" + ResourceProvisioningStateSucceeded ResourceProvisioningState = "Succeeded" +) + +func PossibleValuesForResourceProvisioningState() []string { + return []string{ + string(ResourceProvisioningStateCanceled), + string(ResourceProvisioningStateFailed), + string(ResourceProvisioningStateSucceeded), + } +} + +func (s *ResourceProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResourceProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResourceProvisioningState(input string) (*ResourceProvisioningState, error) { + vals := map[string]ResourceProvisioningState{ + "canceled": ResourceProvisioningStateCanceled, + "failed": ResourceProvisioningStateFailed, + "succeeded": ResourceProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResourceProvisioningState(input) + return &out, nil +} + +type ZoneType string + +const ( + ZoneTypePrimary ZoneType = "Primary" + ZoneTypeSecondary ZoneType = "Secondary" +) + +func PossibleValuesForZoneType() []string { + return []string{ + string(ZoneTypePrimary), + string(ZoneTypeSecondary), + } +} + +func (s *ZoneType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseZoneType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseZoneType(input string) (*ZoneType, error) { + vals := map[string]ZoneType{ + "primary": ZoneTypePrimary, + "secondary": ZoneTypeSecondary, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ZoneType(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_dnsprivatezone.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_dnsprivatezone.go new file mode 100644 index 000000000000..436717fdeaf3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_dnsprivatezone.go @@ -0,0 +1,130 @@ +package dnsprivatezones + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&DnsPrivateZoneId{}) +} + +var _ resourceids.ResourceId = &DnsPrivateZoneId{} + +// DnsPrivateZoneId is a struct representing the Resource ID for a Dns Private Zone +type DnsPrivateZoneId struct { + SubscriptionId string + LocationName string + DnsPrivateZoneName string +} + +// NewDnsPrivateZoneID returns a new DnsPrivateZoneId struct +func NewDnsPrivateZoneID(subscriptionId string, locationName string, dnsPrivateZoneName string) DnsPrivateZoneId { + return DnsPrivateZoneId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + DnsPrivateZoneName: dnsPrivateZoneName, + } +} + +// ParseDnsPrivateZoneID parses 'input' into a DnsPrivateZoneId +func ParseDnsPrivateZoneID(input string) (*DnsPrivateZoneId, error) { + parser := resourceids.NewParserFromResourceIdType(&DnsPrivateZoneId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DnsPrivateZoneId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseDnsPrivateZoneIDInsensitively parses 'input' case-insensitively into a DnsPrivateZoneId +// note: this method should only be used for API response data and not user input +func ParseDnsPrivateZoneIDInsensitively(input string) (*DnsPrivateZoneId, error) { + parser := resourceids.NewParserFromResourceIdType(&DnsPrivateZoneId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DnsPrivateZoneId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *DnsPrivateZoneId) 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) + } + + if id.DnsPrivateZoneName, ok = input.Parsed["dnsPrivateZoneName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "dnsPrivateZoneName", input) + } + + return nil +} + +// ValidateDnsPrivateZoneID checks that 'input' can be parsed as a Dns Private Zone ID +func ValidateDnsPrivateZoneID(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 := ParseDnsPrivateZoneID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Dns Private Zone ID +func (id DnsPrivateZoneId) ID() string { + fmtString := "/subscriptions/%s/providers/Oracle.Database/locations/%s/dnsPrivateZones/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName, id.DnsPrivateZoneName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Dns Private Zone ID +func (id DnsPrivateZoneId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + resourceids.StaticSegment("staticDnsPrivateZones", "dnsPrivateZones", "dnsPrivateZones"), + resourceids.UserSpecifiedSegment("dnsPrivateZoneName", "dnsPrivateZoneName"), + } +} + +// String returns a human-readable description of this Dns Private Zone ID +func (id DnsPrivateZoneId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + fmt.Sprintf("Dns Private Zone Name: %q", id.DnsPrivateZoneName), + } + return fmt.Sprintf("Dns Private Zone (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_location.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_location.go new file mode 100644 index 000000000000..da99d928e822 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/id_location.go @@ -0,0 +1,121 @@ +package dnsprivatezones + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&LocationId{}) +} + +var _ resourceids.ResourceId = &LocationId{} + +// LocationId is a struct representing the Resource ID for a Location +type LocationId struct { + SubscriptionId string + LocationName string +} + +// NewLocationID returns a new LocationId struct +func NewLocationID(subscriptionId string, locationName string) LocationId { + return LocationId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + } +} + +// ParseLocationID parses 'input' into a LocationId +func ParseLocationID(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseLocationIDInsensitively parses 'input' case-insensitively into a LocationId +// note: this method should only be used for API response data and not user input +func ParseLocationIDInsensitively(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *LocationId) 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 +} + +// ValidateLocationID checks that 'input' can be parsed as a Location ID +func ValidateLocationID(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 := ParseLocationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Location ID +func (id LocationId) ID() string { + fmtString := "/subscriptions/%s/providers/Oracle.Database/locations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Location ID +func (id LocationId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + } +} + +// String returns a human-readable description of this Location ID +func (id LocationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + } + return fmt.Sprintf("Location (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/method_get.go new file mode 100644 index 000000000000..87277d0e9389 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/method_get.go @@ -0,0 +1,53 @@ +package dnsprivatezones + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DnsPrivateZone +} + +// Get ... +func (c DnsPrivateZonesClient) Get(ctx context.Context, id DnsPrivateZoneId) (result GetOperationResponse, 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 DnsPrivateZone + 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/oracledatabase/2024-06-01/dnsprivatezones/method_listbylocation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/method_listbylocation.go new file mode 100644 index 000000000000..a8f06fd1edc8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/method_listbylocation.go @@ -0,0 +1,105 @@ +package dnsprivatezones + +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 ListByLocationOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]DnsPrivateZone +} + +type ListByLocationCompleteResult struct { + LatestHttpResponse *http.Response + Items []DnsPrivateZone +} + +type ListByLocationCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByLocationCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByLocation ... +func (c DnsPrivateZonesClient) ListByLocation(ctx context.Context, id LocationId) (result ListByLocationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByLocationCustomPager{}, + Path: fmt.Sprintf("%s/dnsPrivateZones", 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 *[]DnsPrivateZone `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByLocationComplete retrieves all the results into a single object +func (c DnsPrivateZonesClient) ListByLocationComplete(ctx context.Context, id LocationId) (ListByLocationCompleteResult, error) { + return c.ListByLocationCompleteMatchingPredicate(ctx, id, DnsPrivateZoneOperationPredicate{}) +} + +// ListByLocationCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c DnsPrivateZonesClient) ListByLocationCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate DnsPrivateZoneOperationPredicate) (result ListByLocationCompleteResult, err error) { + items := make([]DnsPrivateZone, 0) + + resp, err := c.ListByLocation(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListByLocationCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/model_dnsprivatezone.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/model_dnsprivatezone.go new file mode 100644 index 000000000000..753c8a9c469f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/model_dnsprivatezone.go @@ -0,0 +1,16 @@ +package dnsprivatezones + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsPrivateZone struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *DnsPrivateZoneProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/model_dnsprivatezoneproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/model_dnsprivatezoneproperties.go new file mode 100644 index 000000000000..680bff102fe7 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/model_dnsprivatezoneproperties.go @@ -0,0 +1,35 @@ +package dnsprivatezones + +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 DnsPrivateZoneProperties struct { + IsProtected *bool `json:"isProtected,omitempty"` + LifecycleState *DnsPrivateZonesLifecycleState `json:"lifecycleState,omitempty"` + Ocid *string `json:"ocid,omitempty"` + ProvisioningState *ResourceProvisioningState `json:"provisioningState,omitempty"` + Self *string `json:"self,omitempty"` + Serial *int64 `json:"serial,omitempty"` + TimeCreated *string `json:"timeCreated,omitempty"` + Version *string `json:"version,omitempty"` + ViewId *string `json:"viewId,omitempty"` + ZoneType *ZoneType `json:"zoneType,omitempty"` +} + +func (o *DnsPrivateZoneProperties) GetTimeCreatedAsTime() (*time.Time, error) { + if o.TimeCreated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeCreated, "2006-01-02T15:04:05Z07:00") +} + +func (o *DnsPrivateZoneProperties) SetTimeCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeCreated = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/predicates.go new file mode 100644 index 000000000000..c135bf5afb15 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/predicates.go @@ -0,0 +1,27 @@ +package dnsprivatezones + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DnsPrivateZoneOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p DnsPrivateZoneOperationPredicate) Matches(input DnsPrivateZone) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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/oracledatabase/2024-06-01/dnsprivatezones/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/version.go new file mode 100644 index 000000000000..0446e971c7c6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones/version.go @@ -0,0 +1,10 @@ +package dnsprivatezones + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-06-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/dnsprivatezones/2024-06-01" +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/README.md new file mode 100644 index 000000000000..15af07d6a101 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions` Documentation + +The `giversions` SDK allows for interaction with Azure Resource Manager `oracledatabase` (API Version `2024-06-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-sdk/resource-manager/oracledatabase/2024-06-01/giversions" +``` + + +### Client Initialization + +```go +client := giversions.NewGiVersionsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `GiVersionsClient.Get` + +```go +ctx := context.TODO() +id := giversions.NewGiVersionID("12345678-1234-9876-4563-123456789012", "locationName", "giVersionName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `GiVersionsClient.ListByLocation` + +```go +ctx := context.TODO() +id := giversions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") + +// alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination +items, err := client.ListByLocationComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/client.go new file mode 100644 index 000000000000..a1da948c6926 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/client.go @@ -0,0 +1,26 @@ +package giversions + +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 GiVersionsClient struct { + Client *resourcemanager.Client +} + +func NewGiVersionsClientWithBaseURI(sdkApi sdkEnv.Api) (*GiVersionsClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "giversions", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating GiVersionsClient: %+v", err) + } + + return &GiVersionsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/id_giversion.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/id_giversion.go new file mode 100644 index 000000000000..8661556d4b3a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/id_giversion.go @@ -0,0 +1,130 @@ +package giversions + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&GiVersionId{}) +} + +var _ resourceids.ResourceId = &GiVersionId{} + +// GiVersionId is a struct representing the Resource ID for a Gi Version +type GiVersionId struct { + SubscriptionId string + LocationName string + GiVersionName string +} + +// NewGiVersionID returns a new GiVersionId struct +func NewGiVersionID(subscriptionId string, locationName string, giVersionName string) GiVersionId { + return GiVersionId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + GiVersionName: giVersionName, + } +} + +// ParseGiVersionID parses 'input' into a GiVersionId +func ParseGiVersionID(input string) (*GiVersionId, error) { + parser := resourceids.NewParserFromResourceIdType(&GiVersionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := GiVersionId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseGiVersionIDInsensitively parses 'input' case-insensitively into a GiVersionId +// note: this method should only be used for API response data and not user input +func ParseGiVersionIDInsensitively(input string) (*GiVersionId, error) { + parser := resourceids.NewParserFromResourceIdType(&GiVersionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := GiVersionId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *GiVersionId) 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) + } + + if id.GiVersionName, ok = input.Parsed["giVersionName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "giVersionName", input) + } + + return nil +} + +// ValidateGiVersionID checks that 'input' can be parsed as a Gi Version ID +func ValidateGiVersionID(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 := ParseGiVersionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Gi Version ID +func (id GiVersionId) ID() string { + fmtString := "/subscriptions/%s/providers/Oracle.Database/locations/%s/giVersions/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName, id.GiVersionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Gi Version ID +func (id GiVersionId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + resourceids.StaticSegment("staticGiVersions", "giVersions", "giVersions"), + resourceids.UserSpecifiedSegment("giVersionName", "giVersionName"), + } +} + +// String returns a human-readable description of this Gi Version ID +func (id GiVersionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + fmt.Sprintf("Gi Version Name: %q", id.GiVersionName), + } + return fmt.Sprintf("Gi Version (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/id_location.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/id_location.go new file mode 100644 index 000000000000..b69caafd254d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/id_location.go @@ -0,0 +1,121 @@ +package giversions + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&LocationId{}) +} + +var _ resourceids.ResourceId = &LocationId{} + +// LocationId is a struct representing the Resource ID for a Location +type LocationId struct { + SubscriptionId string + LocationName string +} + +// NewLocationID returns a new LocationId struct +func NewLocationID(subscriptionId string, locationName string) LocationId { + return LocationId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + } +} + +// ParseLocationID parses 'input' into a LocationId +func ParseLocationID(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseLocationIDInsensitively parses 'input' case-insensitively into a LocationId +// note: this method should only be used for API response data and not user input +func ParseLocationIDInsensitively(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *LocationId) 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 +} + +// ValidateLocationID checks that 'input' can be parsed as a Location ID +func ValidateLocationID(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 := ParseLocationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Location ID +func (id LocationId) ID() string { + fmtString := "/subscriptions/%s/providers/Oracle.Database/locations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Location ID +func (id LocationId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + } +} + +// String returns a human-readable description of this Location ID +func (id LocationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + } + return fmt.Sprintf("Location (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/method_get.go new file mode 100644 index 000000000000..57e20ced3e60 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/method_get.go @@ -0,0 +1,53 @@ +package giversions + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *GiVersion +} + +// Get ... +func (c GiVersionsClient) Get(ctx context.Context, id GiVersionId) (result GetOperationResponse, 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 GiVersion + 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/oracledatabase/2024-06-01/giversions/method_listbylocation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/method_listbylocation.go new file mode 100644 index 000000000000..b07237060bad --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/method_listbylocation.go @@ -0,0 +1,105 @@ +package giversions + +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 ListByLocationOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]GiVersion +} + +type ListByLocationCompleteResult struct { + LatestHttpResponse *http.Response + Items []GiVersion +} + +type ListByLocationCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByLocationCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByLocation ... +func (c GiVersionsClient) ListByLocation(ctx context.Context, id LocationId) (result ListByLocationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByLocationCustomPager{}, + Path: fmt.Sprintf("%s/giVersions", 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 *[]GiVersion `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByLocationComplete retrieves all the results into a single object +func (c GiVersionsClient) ListByLocationComplete(ctx context.Context, id LocationId) (ListByLocationCompleteResult, error) { + return c.ListByLocationCompleteMatchingPredicate(ctx, id, GiVersionOperationPredicate{}) +} + +// ListByLocationCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c GiVersionsClient) ListByLocationCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate GiVersionOperationPredicate) (result ListByLocationCompleteResult, err error) { + items := make([]GiVersion, 0) + + resp, err := c.ListByLocation(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListByLocationCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/model_giversion.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/model_giversion.go new file mode 100644 index 000000000000..a088d6eabc40 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/model_giversion.go @@ -0,0 +1,16 @@ +package giversions + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GiVersion struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *GiVersionProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/model_giversionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/model_giversionproperties.go new file mode 100644 index 000000000000..ca86e602826a --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/model_giversionproperties.go @@ -0,0 +1,8 @@ +package giversions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GiVersionProperties struct { + Version *string `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/predicates.go new file mode 100644 index 000000000000..1ffcef5ca0ef --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/predicates.go @@ -0,0 +1,27 @@ +package giversions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GiVersionOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p GiVersionOperationPredicate) Matches(input GiVersion) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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/oracledatabase/2024-06-01/giversions/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/version.go new file mode 100644 index 000000000000..74b2ba1ffe0e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions/version.go @@ -0,0 +1,10 @@ +package giversions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-06-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/giversions/2024-06-01" +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/README.md new file mode 100644 index 000000000000..743f180b57a1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/README.md @@ -0,0 +1,153 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions` Documentation + +The `oraclesubscriptions` SDK allows for interaction with Azure Resource Manager `oracledatabase` (API Version `2024-06-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/oracledatabase/2024-06-01/oraclesubscriptions" +``` + + +### Client Initialization + +```go +client := oraclesubscriptions.NewOracleSubscriptionsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `OracleSubscriptionsClient.AddAzureSubscriptions` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +payload := oraclesubscriptions.AzureSubscriptions{ + // ... +} + + +if err := client.AddAzureSubscriptionsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `OracleSubscriptionsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +payload := oraclesubscriptions.OracleSubscription{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `OracleSubscriptionsClient.Delete` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `OracleSubscriptionsClient.Get` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `OracleSubscriptionsClient.ListActivationLinks` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +if err := client.ListActivationLinksThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `OracleSubscriptionsClient.ListBySubscription` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `OracleSubscriptionsClient.ListCloudAccountDetails` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +if err := client.ListCloudAccountDetailsThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `OracleSubscriptionsClient.ListSaasSubscriptionDetails` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +if err := client.ListSaasSubscriptionDetailsThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `OracleSubscriptionsClient.Update` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +payload := oraclesubscriptions.OracleSubscriptionUpdate{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/client.go new file mode 100644 index 000000000000..d8c2438e5a22 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/client.go @@ -0,0 +1,26 @@ +package oraclesubscriptions + +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 OracleSubscriptionsClient struct { + Client *resourcemanager.Client +} + +func NewOracleSubscriptionsClientWithBaseURI(sdkApi sdkEnv.Api) (*OracleSubscriptionsClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "oraclesubscriptions", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating OracleSubscriptionsClient: %+v", err) + } + + return &OracleSubscriptionsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/constants.go new file mode 100644 index 000000000000..c13ecd3a48e3 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/constants.go @@ -0,0 +1,183 @@ +package oraclesubscriptions + +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 AddSubscriptionOperationState string + +const ( + AddSubscriptionOperationStateFailed AddSubscriptionOperationState = "Failed" + AddSubscriptionOperationStateSucceeded AddSubscriptionOperationState = "Succeeded" + AddSubscriptionOperationStateUpdating AddSubscriptionOperationState = "Updating" +) + +func PossibleValuesForAddSubscriptionOperationState() []string { + return []string{ + string(AddSubscriptionOperationStateFailed), + string(AddSubscriptionOperationStateSucceeded), + string(AddSubscriptionOperationStateUpdating), + } +} + +func (s *AddSubscriptionOperationState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAddSubscriptionOperationState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAddSubscriptionOperationState(input string) (*AddSubscriptionOperationState, error) { + vals := map[string]AddSubscriptionOperationState{ + "failed": AddSubscriptionOperationStateFailed, + "succeeded": AddSubscriptionOperationStateSucceeded, + "updating": AddSubscriptionOperationStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AddSubscriptionOperationState(input) + return &out, nil +} + +type CloudAccountProvisioningState string + +const ( + CloudAccountProvisioningStateAvailable CloudAccountProvisioningState = "Available" + CloudAccountProvisioningStatePending CloudAccountProvisioningState = "Pending" + CloudAccountProvisioningStateProvisioning CloudAccountProvisioningState = "Provisioning" +) + +func PossibleValuesForCloudAccountProvisioningState() []string { + return []string{ + string(CloudAccountProvisioningStateAvailable), + string(CloudAccountProvisioningStatePending), + string(CloudAccountProvisioningStateProvisioning), + } +} + +func (s *CloudAccountProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCloudAccountProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCloudAccountProvisioningState(input string) (*CloudAccountProvisioningState, error) { + vals := map[string]CloudAccountProvisioningState{ + "available": CloudAccountProvisioningStateAvailable, + "pending": CloudAccountProvisioningStatePending, + "provisioning": CloudAccountProvisioningStateProvisioning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CloudAccountProvisioningState(input) + return &out, nil +} + +type Intent string + +const ( + IntentReset Intent = "Reset" + IntentRetain Intent = "Retain" +) + +func PossibleValuesForIntent() []string { + return []string{ + string(IntentReset), + string(IntentRetain), + } +} + +func (s *Intent) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIntent(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIntent(input string) (*Intent, error) { + vals := map[string]Intent{ + "reset": IntentReset, + "retain": IntentRetain, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Intent(input) + return &out, nil +} + +type OracleSubscriptionProvisioningState string + +const ( + OracleSubscriptionProvisioningStateCanceled OracleSubscriptionProvisioningState = "Canceled" + OracleSubscriptionProvisioningStateFailed OracleSubscriptionProvisioningState = "Failed" + OracleSubscriptionProvisioningStateSucceeded OracleSubscriptionProvisioningState = "Succeeded" +) + +func PossibleValuesForOracleSubscriptionProvisioningState() []string { + return []string{ + string(OracleSubscriptionProvisioningStateCanceled), + string(OracleSubscriptionProvisioningStateFailed), + string(OracleSubscriptionProvisioningStateSucceeded), + } +} + +func (s *OracleSubscriptionProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOracleSubscriptionProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOracleSubscriptionProvisioningState(input string) (*OracleSubscriptionProvisioningState, error) { + vals := map[string]OracleSubscriptionProvisioningState{ + "canceled": OracleSubscriptionProvisioningStateCanceled, + "failed": OracleSubscriptionProvisioningStateFailed, + "succeeded": OracleSubscriptionProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OracleSubscriptionProvisioningState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_addazuresubscriptions.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_addazuresubscriptions.go new file mode 100644 index 000000000000..8b0208126797 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_addazuresubscriptions.go @@ -0,0 +1,74 @@ +package oraclesubscriptions + +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/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 AddAzureSubscriptionsOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// AddAzureSubscriptions ... +func (c OracleSubscriptionsClient) AddAzureSubscriptions(ctx context.Context, id commonids.SubscriptionId, input AzureSubscriptions) (result AddAzureSubscriptionsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/providers/Oracle.Database/oracleSubscriptions/default/addAzureSubscriptions", 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 +} + +// AddAzureSubscriptionsThenPoll performs AddAzureSubscriptions then polls until it's completed +func (c OracleSubscriptionsClient) AddAzureSubscriptionsThenPoll(ctx context.Context, id commonids.SubscriptionId, input AzureSubscriptions) error { + result, err := c.AddAzureSubscriptions(ctx, id, input) + if err != nil { + return fmt.Errorf("performing AddAzureSubscriptions: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after AddAzureSubscriptions: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_createorupdate.go new file mode 100644 index 000000000000..e40bd87996da --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_createorupdate.go @@ -0,0 +1,76 @@ +package oraclesubscriptions + +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/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 CreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *OracleSubscription +} + +// CreateOrUpdate ... +func (c OracleSubscriptionsClient) CreateOrUpdate(ctx context.Context, id commonids.SubscriptionId, input OracleSubscription) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/providers/Oracle.Database/oracleSubscriptions/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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c OracleSubscriptionsClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.SubscriptionId, input OracleSubscription) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_delete.go new file mode 100644 index 000000000000..3db5d26b956d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_delete.go @@ -0,0 +1,71 @@ +package oraclesubscriptions + +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/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 DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c OracleSubscriptionsClient) Delete(ctx context.Context, id commonids.SubscriptionId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: fmt.Sprintf("%s/providers/Oracle.Database/oracleSubscriptions/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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c OracleSubscriptionsClient) DeleteThenPoll(ctx context.Context, id commonids.SubscriptionId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_get.go new file mode 100644 index 000000000000..9a0b69856372 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_get.go @@ -0,0 +1,55 @@ +package oraclesubscriptions + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *OracleSubscription +} + +// Get ... +func (c OracleSubscriptionsClient) Get(ctx context.Context, id commonids.SubscriptionId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Oracle.Database/oracleSubscriptions/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 OracleSubscription + 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/oracledatabase/2024-06-01/oraclesubscriptions/method_listactivationlinks.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_listactivationlinks.go new file mode 100644 index 000000000000..2b8c6c5f589b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_listactivationlinks.go @@ -0,0 +1,72 @@ +package oraclesubscriptions + +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/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 ListActivationLinksOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *ActivationLinks +} + +// ListActivationLinks ... +func (c OracleSubscriptionsClient) ListActivationLinks(ctx context.Context, id commonids.SubscriptionId) (result ListActivationLinksOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/providers/Oracle.Database/oracleSubscriptions/default/listActivationLinks", 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 +} + +// ListActivationLinksThenPoll performs ListActivationLinks then polls until it's completed +func (c OracleSubscriptionsClient) ListActivationLinksThenPoll(ctx context.Context, id commonids.SubscriptionId) error { + result, err := c.ListActivationLinks(ctx, id) + if err != nil { + return fmt.Errorf("performing ListActivationLinks: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ListActivationLinks: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_listbysubscription.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_listbysubscription.go new file mode 100644 index 000000000000..0f79ddbf1f16 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_listbysubscription.go @@ -0,0 +1,106 @@ +package oraclesubscriptions + +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 ListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]OracleSubscription +} + +type ListBySubscriptionCompleteResult struct { + LatestHttpResponse *http.Response + Items []OracleSubscription +} + +type ListBySubscriptionCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListBySubscriptionCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListBySubscription ... +func (c OracleSubscriptionsClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListBySubscriptionCustomPager{}, + Path: fmt.Sprintf("%s/providers/Oracle.Database/oracleSubscriptions", 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 *[]OracleSubscription `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListBySubscriptionComplete retrieves all the results into a single object +func (c OracleSubscriptionsClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { + return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, OracleSubscriptionOperationPredicate{}) +} + +// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c OracleSubscriptionsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate OracleSubscriptionOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { + items := make([]OracleSubscription, 0) + + resp, err := c.ListBySubscription(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListBySubscriptionCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_listcloudaccountdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_listcloudaccountdetails.go new file mode 100644 index 000000000000..82e0fe4398f9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_listcloudaccountdetails.go @@ -0,0 +1,72 @@ +package oraclesubscriptions + +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/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 ListCloudAccountDetailsOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *CloudAccountDetails +} + +// ListCloudAccountDetails ... +func (c OracleSubscriptionsClient) ListCloudAccountDetails(ctx context.Context, id commonids.SubscriptionId) (result ListCloudAccountDetailsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/providers/Oracle.Database/oracleSubscriptions/default/listCloudAccountDetails", 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 +} + +// ListCloudAccountDetailsThenPoll performs ListCloudAccountDetails then polls until it's completed +func (c OracleSubscriptionsClient) ListCloudAccountDetailsThenPoll(ctx context.Context, id commonids.SubscriptionId) error { + result, err := c.ListCloudAccountDetails(ctx, id) + if err != nil { + return fmt.Errorf("performing ListCloudAccountDetails: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ListCloudAccountDetails: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_listsaassubscriptiondetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_listsaassubscriptiondetails.go new file mode 100644 index 000000000000..38a211cf7738 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_listsaassubscriptiondetails.go @@ -0,0 +1,72 @@ +package oraclesubscriptions + +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/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 ListSaasSubscriptionDetailsOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *SaasSubscriptionDetails +} + +// ListSaasSubscriptionDetails ... +func (c OracleSubscriptionsClient) ListSaasSubscriptionDetails(ctx context.Context, id commonids.SubscriptionId) (result ListSaasSubscriptionDetailsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/providers/Oracle.Database/oracleSubscriptions/default/listSaasSubscriptionDetails", 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 +} + +// ListSaasSubscriptionDetailsThenPoll performs ListSaasSubscriptionDetails then polls until it's completed +func (c OracleSubscriptionsClient) ListSaasSubscriptionDetailsThenPoll(ctx context.Context, id commonids.SubscriptionId) error { + result, err := c.ListSaasSubscriptionDetails(ctx, id) + if err != nil { + return fmt.Errorf("performing ListSaasSubscriptionDetails: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ListSaasSubscriptionDetails: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_update.go new file mode 100644 index 000000000000..d21b8bc8dd58 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/method_update.go @@ -0,0 +1,76 @@ +package oraclesubscriptions + +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/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 UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *OracleSubscription +} + +// Update ... +func (c OracleSubscriptionsClient) Update(ctx context.Context, id commonids.SubscriptionId, input OracleSubscriptionUpdate) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: fmt.Sprintf("%s/providers/Oracle.Database/oracleSubscriptions/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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c OracleSubscriptionsClient) UpdateThenPoll(ctx context.Context, id commonids.SubscriptionId, input OracleSubscriptionUpdate) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_activationlinks.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_activationlinks.go new file mode 100644 index 000000000000..45a6005a46b8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_activationlinks.go @@ -0,0 +1,9 @@ +package oraclesubscriptions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ActivationLinks struct { + ExistingCloudAccountActivationLink *string `json:"existingCloudAccountActivationLink,omitempty"` + NewCloudAccountActivationLink *string `json:"newCloudAccountActivationLink,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_azuresubscriptions.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_azuresubscriptions.go new file mode 100644 index 000000000000..d847d9891cb8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_azuresubscriptions.go @@ -0,0 +1,8 @@ +package oraclesubscriptions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AzureSubscriptions struct { + AzureSubscriptionIds []string `json:"azureSubscriptionIds"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_cloudaccountdetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_cloudaccountdetails.go new file mode 100644 index 000000000000..684d25dd96a5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_cloudaccountdetails.go @@ -0,0 +1,9 @@ +package oraclesubscriptions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CloudAccountDetails struct { + CloudAccountHomeRegion *string `json:"cloudAccountHomeRegion,omitempty"` + CloudAccountName *string `json:"cloudAccountName,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_oraclesubscription.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_oraclesubscription.go new file mode 100644 index 000000000000..f7128fc11f51 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_oraclesubscription.go @@ -0,0 +1,17 @@ +package oraclesubscriptions + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OracleSubscription struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Plan *Plan `json:"plan,omitempty"` + Properties *OracleSubscriptionProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_oraclesubscriptionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_oraclesubscriptionproperties.go new file mode 100644 index 000000000000..90b625b317c5 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_oraclesubscriptionproperties.go @@ -0,0 +1,17 @@ +package oraclesubscriptions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OracleSubscriptionProperties struct { + AddSubscriptionOperationState *AddSubscriptionOperationState `json:"addSubscriptionOperationState,omitempty"` + AzureSubscriptionIds *[]string `json:"azureSubscriptionIds,omitempty"` + CloudAccountId *string `json:"cloudAccountId,omitempty"` + CloudAccountState *CloudAccountProvisioningState `json:"cloudAccountState,omitempty"` + Intent *Intent `json:"intent,omitempty"` + LastOperationStatusDetail *string `json:"lastOperationStatusDetail,omitempty"` + ProductCode *string `json:"productCode,omitempty"` + ProvisioningState *OracleSubscriptionProvisioningState `json:"provisioningState,omitempty"` + SaasSubscriptionId *string `json:"saasSubscriptionId,omitempty"` + TermUnit *string `json:"termUnit,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_oraclesubscriptionupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_oraclesubscriptionupdate.go new file mode 100644 index 000000000000..c95a9cd5426b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_oraclesubscriptionupdate.go @@ -0,0 +1,9 @@ +package oraclesubscriptions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OracleSubscriptionUpdate struct { + Plan *PlanUpdate `json:"plan,omitempty"` + Properties *OracleSubscriptionUpdateProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_oraclesubscriptionupdateproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_oraclesubscriptionupdateproperties.go new file mode 100644 index 000000000000..d60eeb538217 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_oraclesubscriptionupdateproperties.go @@ -0,0 +1,9 @@ +package oraclesubscriptions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OracleSubscriptionUpdateProperties struct { + Intent *Intent `json:"intent,omitempty"` + ProductCode *string `json:"productCode,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_plan.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_plan.go new file mode 100644 index 000000000000..a34f477722ed --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_plan.go @@ -0,0 +1,12 @@ +package oraclesubscriptions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Plan struct { + Name string `json:"name"` + Product string `json:"product"` + PromotionCode *string `json:"promotionCode,omitempty"` + Publisher string `json:"publisher"` + Version *string `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_planupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_planupdate.go new file mode 100644 index 000000000000..e44262bea928 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_planupdate.go @@ -0,0 +1,12 @@ +package oraclesubscriptions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PlanUpdate 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/oracledatabase/2024-06-01/oraclesubscriptions/model_saassubscriptiondetails.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_saassubscriptiondetails.go new file mode 100644 index 000000000000..ac942a9834c1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/model_saassubscriptiondetails.go @@ -0,0 +1,37 @@ +package oraclesubscriptions + +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 SaasSubscriptionDetails struct { + Id *string `json:"id,omitempty"` + IsAutoRenew *bool `json:"isAutoRenew,omitempty"` + IsFreeTrial *bool `json:"isFreeTrial,omitempty"` + OfferId *string `json:"offerId,omitempty"` + PlanId *string `json:"planId,omitempty"` + PublisherId *string `json:"publisherId,omitempty"` + PurchaserEmailId *string `json:"purchaserEmailId,omitempty"` + PurchaserTenantId *string `json:"purchaserTenantId,omitempty"` + SaasSubscriptionStatus *string `json:"saasSubscriptionStatus,omitempty"` + SubscriptionName *string `json:"subscriptionName,omitempty"` + TermUnit *string `json:"termUnit,omitempty"` + TimeCreated *string `json:"timeCreated,omitempty"` +} + +func (o *SaasSubscriptionDetails) GetTimeCreatedAsTime() (*time.Time, error) { + if o.TimeCreated == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeCreated, "2006-01-02T15:04:05Z07:00") +} + +func (o *SaasSubscriptionDetails) SetTimeCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeCreated = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/predicates.go new file mode 100644 index 000000000000..c59c4fe93bcb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/predicates.go @@ -0,0 +1,27 @@ +package oraclesubscriptions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OracleSubscriptionOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p OracleSubscriptionOperationPredicate) Matches(input OracleSubscription) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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/oracledatabase/2024-06-01/oraclesubscriptions/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/version.go new file mode 100644 index 000000000000..0549bafa1ad0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions/version.go @@ -0,0 +1,10 @@ +package oraclesubscriptions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-06-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/oraclesubscriptions/2024-06-01" +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/README.md new file mode 100644 index 000000000000..f0ccb872fc48 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions` Documentation + +The `systemversions` SDK allows for interaction with Azure Resource Manager `oracledatabase` (API Version `2024-06-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-sdk/resource-manager/oracledatabase/2024-06-01/systemversions" +``` + + +### Client Initialization + +```go +client := systemversions.NewSystemVersionsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SystemVersionsClient.Get` + +```go +ctx := context.TODO() +id := systemversions.NewSystemVersionID("12345678-1234-9876-4563-123456789012", "locationName", "systemVersionName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SystemVersionsClient.ListByLocation` + +```go +ctx := context.TODO() +id := systemversions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationName") + +// alternatively `client.ListByLocation(ctx, id)` can be used to do batched pagination +items, err := client.ListByLocationComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/client.go new file mode 100644 index 000000000000..d040a83694fe --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/client.go @@ -0,0 +1,26 @@ +package systemversions + +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 SystemVersionsClient struct { + Client *resourcemanager.Client +} + +func NewSystemVersionsClientWithBaseURI(sdkApi sdkEnv.Api) (*SystemVersionsClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "systemversions", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating SystemVersionsClient: %+v", err) + } + + return &SystemVersionsClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/id_location.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/id_location.go new file mode 100644 index 000000000000..c56f67cb2c27 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/id_location.go @@ -0,0 +1,121 @@ +package systemversions + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&LocationId{}) +} + +var _ resourceids.ResourceId = &LocationId{} + +// LocationId is a struct representing the Resource ID for a Location +type LocationId struct { + SubscriptionId string + LocationName string +} + +// NewLocationID returns a new LocationId struct +func NewLocationID(subscriptionId string, locationName string) LocationId { + return LocationId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + } +} + +// ParseLocationID parses 'input' into a LocationId +func ParseLocationID(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseLocationIDInsensitively parses 'input' case-insensitively into a LocationId +// note: this method should only be used for API response data and not user input +func ParseLocationIDInsensitively(input string) (*LocationId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *LocationId) 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 +} + +// ValidateLocationID checks that 'input' can be parsed as a Location ID +func ValidateLocationID(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 := ParseLocationID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Location ID +func (id LocationId) ID() string { + fmtString := "/subscriptions/%s/providers/Oracle.Database/locations/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Location ID +func (id LocationId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + } +} + +// String returns a human-readable description of this Location ID +func (id LocationId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + } + return fmt.Sprintf("Location (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/id_systemversion.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/id_systemversion.go new file mode 100644 index 000000000000..b28b393451b4 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/id_systemversion.go @@ -0,0 +1,130 @@ +package systemversions + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&SystemVersionId{}) +} + +var _ resourceids.ResourceId = &SystemVersionId{} + +// SystemVersionId is a struct representing the Resource ID for a System Version +type SystemVersionId struct { + SubscriptionId string + LocationName string + SystemVersionName string +} + +// NewSystemVersionID returns a new SystemVersionId struct +func NewSystemVersionID(subscriptionId string, locationName string, systemVersionName string) SystemVersionId { + return SystemVersionId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + SystemVersionName: systemVersionName, + } +} + +// ParseSystemVersionID parses 'input' into a SystemVersionId +func ParseSystemVersionID(input string) (*SystemVersionId, error) { + parser := resourceids.NewParserFromResourceIdType(&SystemVersionId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := SystemVersionId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseSystemVersionIDInsensitively parses 'input' case-insensitively into a SystemVersionId +// note: this method should only be used for API response data and not user input +func ParseSystemVersionIDInsensitively(input string) (*SystemVersionId, error) { + parser := resourceids.NewParserFromResourceIdType(&SystemVersionId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := SystemVersionId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *SystemVersionId) 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) + } + + if id.SystemVersionName, ok = input.Parsed["systemVersionName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "systemVersionName", input) + } + + return nil +} + +// ValidateSystemVersionID checks that 'input' can be parsed as a System Version ID +func ValidateSystemVersionID(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 := ParseSystemVersionID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted System Version ID +func (id SystemVersionId) ID() string { + fmtString := "/subscriptions/%s/providers/Oracle.Database/locations/%s/systemVersions/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName, id.SystemVersionName) +} + +// Segments returns a slice of Resource ID Segments which comprise this System Version ID +func (id SystemVersionId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + resourceids.StaticSegment("staticSystemVersions", "systemVersions", "systemVersions"), + resourceids.UserSpecifiedSegment("systemVersionName", "systemVersionName"), + } +} + +// String returns a human-readable description of this System Version ID +func (id SystemVersionId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + fmt.Sprintf("System Version Name: %q", id.SystemVersionName), + } + return fmt.Sprintf("System Version (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/method_get.go new file mode 100644 index 000000000000..5c8b878c5709 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/method_get.go @@ -0,0 +1,53 @@ +package systemversions + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *SystemVersion +} + +// Get ... +func (c SystemVersionsClient) Get(ctx context.Context, id SystemVersionId) (result GetOperationResponse, 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 SystemVersion + 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/oracledatabase/2024-06-01/systemversions/method_listbylocation.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/method_listbylocation.go new file mode 100644 index 000000000000..f1250239c6d1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/method_listbylocation.go @@ -0,0 +1,105 @@ +package systemversions + +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 ListByLocationOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]SystemVersion +} + +type ListByLocationCompleteResult struct { + LatestHttpResponse *http.Response + Items []SystemVersion +} + +type ListByLocationCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByLocationCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByLocation ... +func (c SystemVersionsClient) ListByLocation(ctx context.Context, id LocationId) (result ListByLocationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByLocationCustomPager{}, + Path: fmt.Sprintf("%s/systemVersions", 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 *[]SystemVersion `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByLocationComplete retrieves all the results into a single object +func (c SystemVersionsClient) ListByLocationComplete(ctx context.Context, id LocationId) (ListByLocationCompleteResult, error) { + return c.ListByLocationCompleteMatchingPredicate(ctx, id, SystemVersionOperationPredicate{}) +} + +// ListByLocationCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c SystemVersionsClient) ListByLocationCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate SystemVersionOperationPredicate) (result ListByLocationCompleteResult, err error) { + items := make([]SystemVersion, 0) + + resp, err := c.ListByLocation(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListByLocationCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/model_systemversion.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/model_systemversion.go new file mode 100644 index 000000000000..dc4bb7d6d35e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/model_systemversion.go @@ -0,0 +1,16 @@ +package systemversions + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SystemVersion struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *SystemVersionProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/model_systemversionproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/model_systemversionproperties.go new file mode 100644 index 000000000000..5eda04761332 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/model_systemversionproperties.go @@ -0,0 +1,8 @@ +package systemversions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SystemVersionProperties struct { + SystemVersion *string `json:"systemVersion,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/predicates.go new file mode 100644 index 000000000000..d2d884b970c2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/predicates.go @@ -0,0 +1,27 @@ +package systemversions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SystemVersionOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p SystemVersionOperationPredicate) Matches(input SystemVersion) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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/oracledatabase/2024-06-01/systemversions/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/version.go new file mode 100644 index 000000000000..7d3a24794325 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions/version.go @@ -0,0 +1,10 @@ +package systemversions + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-06-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/systemversions/2024-06-01" +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/README.md new file mode 100644 index 000000000000..38c028c0648d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/README.md @@ -0,0 +1,82 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses` Documentation + +The `virtualnetworkaddresses` SDK allows for interaction with Azure Resource Manager `oracledatabase` (API Version `2024-06-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-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses" +``` + + +### Client Initialization + +```go +client := virtualnetworkaddresses.NewVirtualNetworkAddressesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualNetworkAddressesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualnetworkaddresses.NewVirtualNetworkAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName", "virtualNetworkAddressName") + +payload := virtualnetworkaddresses.VirtualNetworkAddress{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkAddressesClient.Delete` + +```go +ctx := context.TODO() +id := virtualnetworkaddresses.NewVirtualNetworkAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName", "virtualNetworkAddressName") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkAddressesClient.Get` + +```go +ctx := context.TODO() +id := virtualnetworkaddresses.NewVirtualNetworkAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName", "virtualNetworkAddressName") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualNetworkAddressesClient.ListByCloudVMCluster` + +```go +ctx := context.TODO() +id := virtualnetworkaddresses.NewCloudVMClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudVmClusterName") + +// alternatively `client.ListByCloudVMCluster(ctx, id)` can be used to do batched pagination +items, err := client.ListByCloudVMClusterComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/client.go new file mode 100644 index 000000000000..9255f195dc43 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/client.go @@ -0,0 +1,26 @@ +package virtualnetworkaddresses + +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 VirtualNetworkAddressesClient struct { + Client *resourcemanager.Client +} + +func NewVirtualNetworkAddressesClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualNetworkAddressesClient, error) { + client, err := resourcemanager.NewClient(sdkApi, "virtualnetworkaddresses", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating VirtualNetworkAddressesClient: %+v", err) + } + + return &VirtualNetworkAddressesClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/constants.go new file mode 100644 index 000000000000..67d5e6fa561b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/constants.go @@ -0,0 +1,107 @@ +package virtualnetworkaddresses + +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 AzureResourceProvisioningState string + +const ( + AzureResourceProvisioningStateCanceled AzureResourceProvisioningState = "Canceled" + AzureResourceProvisioningStateFailed AzureResourceProvisioningState = "Failed" + AzureResourceProvisioningStateProvisioning AzureResourceProvisioningState = "Provisioning" + AzureResourceProvisioningStateSucceeded AzureResourceProvisioningState = "Succeeded" +) + +func PossibleValuesForAzureResourceProvisioningState() []string { + return []string{ + string(AzureResourceProvisioningStateCanceled), + string(AzureResourceProvisioningStateFailed), + string(AzureResourceProvisioningStateProvisioning), + string(AzureResourceProvisioningStateSucceeded), + } +} + +func (s *AzureResourceProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureResourceProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureResourceProvisioningState(input string) (*AzureResourceProvisioningState, error) { + vals := map[string]AzureResourceProvisioningState{ + "canceled": AzureResourceProvisioningStateCanceled, + "failed": AzureResourceProvisioningStateFailed, + "provisioning": AzureResourceProvisioningStateProvisioning, + "succeeded": AzureResourceProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureResourceProvisioningState(input) + return &out, nil +} + +type VirtualNetworkAddressLifecycleState string + +const ( + VirtualNetworkAddressLifecycleStateAvailable VirtualNetworkAddressLifecycleState = "Available" + VirtualNetworkAddressLifecycleStateFailed VirtualNetworkAddressLifecycleState = "Failed" + VirtualNetworkAddressLifecycleStateProvisioning VirtualNetworkAddressLifecycleState = "Provisioning" + VirtualNetworkAddressLifecycleStateTerminated VirtualNetworkAddressLifecycleState = "Terminated" + VirtualNetworkAddressLifecycleStateTerminating VirtualNetworkAddressLifecycleState = "Terminating" +) + +func PossibleValuesForVirtualNetworkAddressLifecycleState() []string { + return []string{ + string(VirtualNetworkAddressLifecycleStateAvailable), + string(VirtualNetworkAddressLifecycleStateFailed), + string(VirtualNetworkAddressLifecycleStateProvisioning), + string(VirtualNetworkAddressLifecycleStateTerminated), + string(VirtualNetworkAddressLifecycleStateTerminating), + } +} + +func (s *VirtualNetworkAddressLifecycleState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkAddressLifecycleState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkAddressLifecycleState(input string) (*VirtualNetworkAddressLifecycleState, error) { + vals := map[string]VirtualNetworkAddressLifecycleState{ + "available": VirtualNetworkAddressLifecycleStateAvailable, + "failed": VirtualNetworkAddressLifecycleStateFailed, + "provisioning": VirtualNetworkAddressLifecycleStateProvisioning, + "terminated": VirtualNetworkAddressLifecycleStateTerminated, + "terminating": VirtualNetworkAddressLifecycleStateTerminating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkAddressLifecycleState(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_cloudvmcluster.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_cloudvmcluster.go new file mode 100644 index 000000000000..916b2f088484 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_cloudvmcluster.go @@ -0,0 +1,130 @@ +package virtualnetworkaddresses + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&CloudVMClusterId{}) +} + +var _ resourceids.ResourceId = &CloudVMClusterId{} + +// CloudVMClusterId is a struct representing the Resource ID for a Cloud V M Cluster +type CloudVMClusterId struct { + SubscriptionId string + ResourceGroupName string + CloudVmClusterName string +} + +// NewCloudVMClusterID returns a new CloudVMClusterId struct +func NewCloudVMClusterID(subscriptionId string, resourceGroupName string, cloudVmClusterName string) CloudVMClusterId { + return CloudVMClusterId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + CloudVmClusterName: cloudVmClusterName, + } +} + +// ParseCloudVMClusterID parses 'input' into a CloudVMClusterId +func ParseCloudVMClusterID(input string) (*CloudVMClusterId, error) { + parser := resourceids.NewParserFromResourceIdType(&CloudVMClusterId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CloudVMClusterId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseCloudVMClusterIDInsensitively parses 'input' case-insensitively into a CloudVMClusterId +// note: this method should only be used for API response data and not user input +func ParseCloudVMClusterIDInsensitively(input string) (*CloudVMClusterId, error) { + parser := resourceids.NewParserFromResourceIdType(&CloudVMClusterId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CloudVMClusterId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *CloudVMClusterId) 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.CloudVmClusterName, ok = input.Parsed["cloudVmClusterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "cloudVmClusterName", input) + } + + return nil +} + +// ValidateCloudVMClusterID checks that 'input' can be parsed as a Cloud V M Cluster ID +func ValidateCloudVMClusterID(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 := ParseCloudVMClusterID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Cloud V M Cluster ID +func (id CloudVMClusterId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Oracle.Database/cloudVmClusters/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudVmClusterName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Cloud V M Cluster ID +func (id CloudVMClusterId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticCloudVmClusters", "cloudVmClusters", "cloudVmClusters"), + resourceids.UserSpecifiedSegment("cloudVmClusterName", "cloudVmClusterName"), + } +} + +// String returns a human-readable description of this Cloud V M Cluster ID +func (id CloudVMClusterId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Cloud Vm Cluster Name: %q", id.CloudVmClusterName), + } + return fmt.Sprintf("Cloud V M Cluster (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_virtualnetworkaddress.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_virtualnetworkaddress.go new file mode 100644 index 000000000000..d2e41ecac8f0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/id_virtualnetworkaddress.go @@ -0,0 +1,139 @@ +package virtualnetworkaddresses + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/recaser" + "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. + +func init() { + recaser.RegisterResourceId(&VirtualNetworkAddressId{}) +} + +var _ resourceids.ResourceId = &VirtualNetworkAddressId{} + +// VirtualNetworkAddressId is a struct representing the Resource ID for a Virtual Network Address +type VirtualNetworkAddressId struct { + SubscriptionId string + ResourceGroupName string + CloudVmClusterName string + VirtualNetworkAddressName string +} + +// NewVirtualNetworkAddressID returns a new VirtualNetworkAddressId struct +func NewVirtualNetworkAddressID(subscriptionId string, resourceGroupName string, cloudVmClusterName string, virtualNetworkAddressName string) VirtualNetworkAddressId { + return VirtualNetworkAddressId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + CloudVmClusterName: cloudVmClusterName, + VirtualNetworkAddressName: virtualNetworkAddressName, + } +} + +// ParseVirtualNetworkAddressID parses 'input' into a VirtualNetworkAddressId +func ParseVirtualNetworkAddressID(input string) (*VirtualNetworkAddressId, error) { + parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkAddressId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VirtualNetworkAddressId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVirtualNetworkAddressIDInsensitively parses 'input' case-insensitively into a VirtualNetworkAddressId +// note: this method should only be used for API response data and not user input +func ParseVirtualNetworkAddressIDInsensitively(input string) (*VirtualNetworkAddressId, error) { + parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkAddressId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VirtualNetworkAddressId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VirtualNetworkAddressId) 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.CloudVmClusterName, ok = input.Parsed["cloudVmClusterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "cloudVmClusterName", input) + } + + if id.VirtualNetworkAddressName, ok = input.Parsed["virtualNetworkAddressName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkAddressName", input) + } + + return nil +} + +// ValidateVirtualNetworkAddressID checks that 'input' can be parsed as a Virtual Network Address ID +func ValidateVirtualNetworkAddressID(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 := ParseVirtualNetworkAddressID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Virtual Network Address ID +func (id VirtualNetworkAddressId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Oracle.Database/cloudVmClusters/%s/virtualNetworkAddresses/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudVmClusterName, id.VirtualNetworkAddressName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Virtual Network Address ID +func (id VirtualNetworkAddressId) 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("staticOracleDatabase", "Oracle.Database", "Oracle.Database"), + resourceids.StaticSegment("staticCloudVmClusters", "cloudVmClusters", "cloudVmClusters"), + resourceids.UserSpecifiedSegment("cloudVmClusterName", "cloudVmClusterName"), + resourceids.StaticSegment("staticVirtualNetworkAddresses", "virtualNetworkAddresses", "virtualNetworkAddresses"), + resourceids.UserSpecifiedSegment("virtualNetworkAddressName", "virtualNetworkAddressName"), + } +} + +// String returns a human-readable description of this Virtual Network Address ID +func (id VirtualNetworkAddressId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Cloud Vm Cluster Name: %q", id.CloudVmClusterName), + fmt.Sprintf("Virtual Network Address Name: %q", id.VirtualNetworkAddressName), + } + return fmt.Sprintf("Virtual Network Address (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/method_createorupdate.go new file mode 100644 index 000000000000..dd9d12a988dc --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/method_createorupdate.go @@ -0,0 +1,75 @@ +package virtualnetworkaddresses + +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 CreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *VirtualNetworkAddress +} + +// CreateOrUpdate ... +func (c VirtualNetworkAddressesClient) CreateOrUpdate(ctx context.Context, id VirtualNetworkAddressId, input VirtualNetworkAddress) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + 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 +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c VirtualNetworkAddressesClient) CreateOrUpdateThenPoll(ctx context.Context, id VirtualNetworkAddressId, input VirtualNetworkAddress) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/method_delete.go new file mode 100644 index 000000000000..0cbd45c96485 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/method_delete.go @@ -0,0 +1,70 @@ +package virtualnetworkaddresses + +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 DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c VirtualNetworkAddressesClient) Delete(ctx context.Context, id VirtualNetworkAddressId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + 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 +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c VirtualNetworkAddressesClient) DeleteThenPoll(ctx context.Context, id VirtualNetworkAddressId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/method_get.go new file mode 100644 index 000000000000..7d79f265d19b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/method_get.go @@ -0,0 +1,53 @@ +package virtualnetworkaddresses + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *VirtualNetworkAddress +} + +// Get ... +func (c VirtualNetworkAddressesClient) Get(ctx context.Context, id VirtualNetworkAddressId) (result GetOperationResponse, 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 VirtualNetworkAddress + 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/oracledatabase/2024-06-01/virtualnetworkaddresses/method_listbycloudvmcluster.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/method_listbycloudvmcluster.go new file mode 100644 index 000000000000..81eba745ec72 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/method_listbycloudvmcluster.go @@ -0,0 +1,105 @@ +package virtualnetworkaddresses + +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 ListByCloudVMClusterOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]VirtualNetworkAddress +} + +type ListByCloudVMClusterCompleteResult struct { + LatestHttpResponse *http.Response + Items []VirtualNetworkAddress +} + +type ListByCloudVMClusterCustomPager struct { + NextLink *odata.Link `json:"nextLink"` +} + +func (p *ListByCloudVMClusterCustomPager) NextPageLink() *odata.Link { + defer func() { + p.NextLink = nil + }() + + return p.NextLink +} + +// ListByCloudVMCluster ... +func (c VirtualNetworkAddressesClient) ListByCloudVMCluster(ctx context.Context, id CloudVMClusterId) (result ListByCloudVMClusterOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Pager: &ListByCloudVMClusterCustomPager{}, + Path: fmt.Sprintf("%s/virtualNetworkAddresses", 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 *[]VirtualNetworkAddress `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByCloudVMClusterComplete retrieves all the results into a single object +func (c VirtualNetworkAddressesClient) ListByCloudVMClusterComplete(ctx context.Context, id CloudVMClusterId) (ListByCloudVMClusterCompleteResult, error) { + return c.ListByCloudVMClusterCompleteMatchingPredicate(ctx, id, VirtualNetworkAddressOperationPredicate{}) +} + +// ListByCloudVMClusterCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VirtualNetworkAddressesClient) ListByCloudVMClusterCompleteMatchingPredicate(ctx context.Context, id CloudVMClusterId, predicate VirtualNetworkAddressOperationPredicate) (result ListByCloudVMClusterCompleteResult, err error) { + items := make([]VirtualNetworkAddress, 0) + + resp, err := c.ListByCloudVMCluster(ctx, id) + if err != nil { + result.LatestHttpResponse = resp.HttpResponse + 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 = ListByCloudVMClusterCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/model_virtualnetworkaddress.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/model_virtualnetworkaddress.go new file mode 100644 index 000000000000..2451c7ae562c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/model_virtualnetworkaddress.go @@ -0,0 +1,16 @@ +package virtualnetworkaddresses + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkAddress struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *VirtualNetworkAddressProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/model_virtualnetworkaddressproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/model_virtualnetworkaddressproperties.go new file mode 100644 index 000000000000..807d373de87e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/model_virtualnetworkaddressproperties.go @@ -0,0 +1,33 @@ +package virtualnetworkaddresses + +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 VirtualNetworkAddressProperties struct { + Domain *string `json:"domain,omitempty"` + IPAddress *string `json:"ipAddress,omitempty"` + LifecycleDetails *string `json:"lifecycleDetails,omitempty"` + LifecycleState *VirtualNetworkAddressLifecycleState `json:"lifecycleState,omitempty"` + Ocid *string `json:"ocid,omitempty"` + ProvisioningState *AzureResourceProvisioningState `json:"provisioningState,omitempty"` + TimeAssigned *string `json:"timeAssigned,omitempty"` + VMOcid *string `json:"vmOcid,omitempty"` +} + +func (o *VirtualNetworkAddressProperties) GetTimeAssignedAsTime() (*time.Time, error) { + if o.TimeAssigned == nil { + return nil, nil + } + return dates.ParseAsFormat(o.TimeAssigned, "2006-01-02T15:04:05Z07:00") +} + +func (o *VirtualNetworkAddressProperties) SetTimeAssignedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.TimeAssigned = &formatted +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/predicates.go new file mode 100644 index 000000000000..c0416c10a318 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/predicates.go @@ -0,0 +1,27 @@ +package virtualnetworkaddresses + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkAddressOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p VirtualNetworkAddressOperationPredicate) Matches(input VirtualNetworkAddress) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + 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/oracledatabase/2024-06-01/virtualnetworkaddresses/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/version.go new file mode 100644 index 000000000000..b0c754c29772 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/version.go @@ -0,0 +1,10 @@ +package virtualnetworkaddresses + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2024-06-01" + +func userAgent() string { + return "hashicorp/go-azure-sdk/virtualnetworkaddresses/2024-06-01" +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 07e696d6dd47..2b4b7c2b8c68 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -832,6 +832,23 @@ github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2022-10-0 github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2022-10-01/tables github.com/hashicorp/go-azure-sdk/resource-manager/operationalinsights/2022-10-01/workspaces github.com/hashicorp/go-azure-sdk/resource-manager/operationsmanagement/2015-11-01-preview/solution +github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01 +github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups +github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasecharactersets +github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabasenationalcharactersets +github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabases +github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/autonomousdatabaseversions +github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudexadatainfrastructures +github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/cloudvmclusters +github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbnodes +github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbservers +github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dbsystemshapes +github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivateviews +github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/dnsprivatezones +github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/giversions +github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/oraclesubscriptions +github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/systemversions +github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses github.com/hashicorp/go-azure-sdk/resource-manager/orbital/2022-11-01/contact github.com/hashicorp/go-azure-sdk/resource-manager/orbital/2022-11-01/contactprofile github.com/hashicorp/go-azure-sdk/resource-manager/orbital/2022-11-01/groundstation diff --git a/website/allowed-subcategories b/website/allowed-subcategories index 88d32c2f4c4d..76201e303d97 100644 --- a/website/allowed-subcategories +++ b/website/allowed-subcategories @@ -79,6 +79,7 @@ NetApp Network Network Function New Relic +Oracle Database Orbital Palo Alto Policy diff --git a/website/docs/5.0-upgrade-guide.html.markdown b/website/docs/5.0-upgrade-guide.html.markdown index 1313ed2d3a36..95b6939aaf1c 100644 --- a/website/docs/5.0-upgrade-guide.html.markdown +++ b/website/docs/5.0-upgrade-guide.html.markdown @@ -67,4 +67,4 @@ Please follow the format in the example below for listing breaking changes in da * The deprecated `example_old_property` property has been removed in favour of the `example_new_property` property. * The deprecated `example_property_with_no_replacement` property has been removed. -``` \ No newline at end of file +``` diff --git a/website/docs/d/oracledatabase_exadata_infrastructure.html.markdown b/website/docs/d/oracledatabase_exadata_infrastructure.html.markdown new file mode 100644 index 000000000000..f1527376c9a1 --- /dev/null +++ b/website/docs/d/oracledatabase_exadata_infrastructure.html.markdown @@ -0,0 +1,146 @@ +--- +subcategory: "Oracle Database" +layout: "azurerm" +page_title: "Azure Resource Manager: Data Source: azurerm_oracle_exadata_infrastructure" +description: |- + Gets information about an existing Exadata Infrastructure. +--- + +# Data Source: azurerm_oracle_exadata_infrastructure + +Use this data source to access information about an existing Exadata Infrastructure. + +## Example Usage + +```hcl +data "azurerm_oracle_exadata_infrastructure" "example" { + name = "existing" + resource_group_name = "existing" +} + +output "id" { + value = data.azurerm_oracle_exadata_infrastructure.example.id +} +``` + +## Arguments Reference + +The following arguments are supported: + +* `name` - (Required) The name of this Exadata Infrastructure. + +* `resource_group_name` - (Required) The name of the Resource Group where the Exadata Infrastructure exists. + +## Attributes Reference + +In addition to the Arguments listed above - the following Attributes are exported: + +* `id` - The ID of the Exadata Infrastructure. + +* `activated_storage_count` - The requested number of additional storage servers activated for the Exadata infrastructure. + +* `additional_storage_count` - The requested number of additional storage servers for the Exadata infrastructure. + +* `available_storage_size_in_gbs` - The available storage can be allocated to the cloud Exadata infrastructure resource, in gigabytes (GB). + +* `compute_count` - The number of compute servers for the cloud Exadata infrastructure. + +* `cpu_count` - The total number of CPU cores allocated. + +* `customer_contacts` - A `customer_contacts` block as defined below. + +* `data_storage_size_in_tbs` - Size, in terabytes, of the DATA disk group. + +* `db_node_storage_size_in_gbs` - The local node storage allocated in GBs. + +* `db_server_version` - The software version of the database servers (dom0) in the cloud Exadata infrastructure. Example: `20.1.15` + +* `display_name` - The user-friendly name for the cloud Exadata infrastructure resource. The name does not need to be unique. + +* `estimated_patching_time` - A `estimated_patching_time` block as defined below. + +* `last_maintenance_run_id` - The [OCID](https://docs.oracle.com/en-us/iaas/Content/General/Concepts/identifiers.htm) of the last maintenance run. + +* `lifecycle_details` - Additional information about the current lifecycle state. + +* `lifecycle_state` - CloudExadataInfrastructure lifecycle state. + +* `location` - The Azure Region where the Exadata Infrastructure exists. + +* `maintenance_window` - A `maintenance_window` block as defined below. + +* `max_cpu_count` - The total number of CPU cores available. + +* `max_data_storage_in_tbs` - The total available DATA disk group size. + +* `max_db_node_storage_size_in_gbs` - The total local node storage available in GBs. + +* `max_memory_in_gbs` - The total memory available in GBs. + +* `memory_size_in_gbs` - The memory allocated in GBs. + +* `monthly_db_server_version` - The monthly software version of the database servers (dom0) in the cloud Exadata infrastructure. Example: `20.1.15` + +* `monthly_storage_server_version` - The monthly software version of the storage servers (cells) in the cloud Exadata infrastructure. Example: `20.1.15` + +* `next_maintenance_run_id` - The [OCID](https://docs.oracle.com/en-us/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. + +* `oci_url` - The URL of the resource in the OCI console. + +* `ocid` - The [OCID](https://docs.oracle.com/en-us/iaas/Content/General/Concepts/identifiers.htm) of the Exadata infrastructure. + +* `provisioning_state` - CloudExadataInfrastructure provisioning state + +* `shape` - The model name of the cloud Exadata infrastructure resource. + +* `storage_count` - The number of storage servers for the cloud Exadata infrastructure. + +* `storage_server_version` - The software version of the storage servers (cells) in the Exadata infrastructure. Example: `20.1.15` + +* `system_data` - A `system_data` block as defined below. + +* `tags` - A mapping of tags assigned to the Exadata Infrastructure. + +* `time_created` - The date and time the cloud Exadata infrastructure resource was created. + +* `total_storage_size_in_gbs` - The total storage allocated to the cloud Exadata infrastructure resource, in gigabytes (GB). + +* `zones` - The Exadata infrastructure Azure zones. + +--- + +A `estimated_patching_time` block exports the following: + +* `estimated_db_server_patching_time` - The estimated time required in minutes for database server patching. + +* `estimated_network_switches_patching_time` - The estimated time required in minutes for network switch patching. + +* `estimated_storage_server_patching_time` - The estimated time required in minutes for storage server patching. + +* `total_estimated_patching_time` - The estimated total time required in minutes for all patching operations. + +--- + +A `maintenance_window` block exports the following: + +* `days_of_week` - Days during the week when maintenance should be performed. + +* `hours_of_day` - The window of hours during the day when maintenance should be performed. The window is a 4 hour slot. Valid values are: 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - 23:59 UTC + +* `lead_time_in_weeks` - Lead time window allows user to set a lead time to prepare for a down time. The lead time is in weeks and valid value is between 1 to 4. + +* `months` - A `months` block as defined below. + +* `patching_mode` - Cloud Exadata infrastructure node patching method, either `ROLLING` or `NONROLLING`. + +* `preference` - The maintenance window scheduling preference. + +* `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. + +--- + +## 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 Exadata Infrastructure. diff --git a/website/docs/r/oracledatabase_exadata_infrastructure.html.markdown b/website/docs/r/oracledatabase_exadata_infrastructure.html.markdown new file mode 100644 index 000000000000..debd4fa67153 --- /dev/null +++ b/website/docs/r/oracledatabase_exadata_infrastructure.html.markdown @@ -0,0 +1,100 @@ +--- +subcategory: "Oracle Database" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_oracle_exadata_infrastructure" +description: |- + Manages a Exadata Infrastructure. +--- + +# azurerm_oracle_exadata_infrastructure + +Manages a Exadata Infrastructure. + +## Example Usage + +```hcl +resource "azurerm_resource_group" "example" { + name = "example-resources" + location = "West Europe" +} + +resource "azurerm_oracle_exadata_infrastructure" "example" { + name = "example-exadata-infra" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location + zones = ["1"] + display_name = "example-exadata-infra" + storage_count = 3 + compute_count = 2 + shape = "Exadata.X9M" +} +``` + +## Arguments Reference + +The following arguments are supported: + +* `compute_count` - (Required) The number of compute servers for the cloud Exadata infrastructure. + +* `display_name` - (Required) The user-friendly name for the cloud Exadata infrastructure resource. The name does not need to be unique. + +* `location` - (Required) The Azure Region where the Exadata Infrastructure should exist. Changing this forces a new Exadata Infrastructure to be created. + +* `name` - (Required) The name which should be used for this Exadata Infrastructure. + +* `resource_group_name` - (Required) The name of the Resource Group where the Exadata Infrastructure should exist. + +* `shape` - (Required) The shape of the cloud Exadata infrastructure resource. + +* `storage_count` - (Required) The number of storage servers for the cloud Exadata infrastructure. + +* `zones` - (Required) CloudExadataInfrastructure zones. + +--- + +* `customer_contacts` - (Optional) The email address used by Oracle to send notifications regarding databases and infrastructure. + +* `maintenance_window` - (Optional) One or more `maintenance_window` blocks as defined below. + +* `tags` - (Optional) A mapping of tags which should be assigned to the Exadata Infrastructure. + +--- + +A `maintenance_window` block supports the following: + +* `days_of_week` - (Optional) Days during the week when maintenance should be performed. Valid values are: `0` - represents time slot `0:00 - 3:59 UTC - 4` - represents time slot `4:00 - 7:59 UTC - 8` - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot `20:00 - 23:59 UTC` + +* `hours_of_day` - (Optional) The window of hours during the day when maintenance should be performed. The window is a 4 hour slot. + +* `lead_time_in_weeks` - (Optional) Lead time window allows user to set a lead time to prepare for a down time. The lead time is in weeks and valid value is between `1` to `4`. + +* `months` - (Optional) Months during the year when maintenance should be performed. + +* `patching_mode` - (Optional) Cloud Exadata infrastructure node patching method, either `ROLLING` or `NONROLLING`. Default value is `ROLLING`. IMPORTANT: Non-rolling infrastructure patching involves system down time. See [Oracle-Managed Infrastructure Maintenance Updates](https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/examaintenance.htm#Oracle) for more information. + +* `preference` - (Optional) The maintenance window scheduling preference. + +* `weeks_of_month` - (Optional) Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. + +## Attributes Reference + +In addition to the Arguments listed above - the following Attributes are exported: + +* `id` - The ID of the Exadata Infrastructure. + +## 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 Exadata Infrastructure. +* `read` - (Defaults to 5 minutes) Used when retrieving the Exadata Infrastructure. +* `update` - (Defaults to 30 minutes) Used when updating the Exadata Infrastructure. +* `delete` - (Defaults to 30 minutes) Used when deleting the Exadata Infrastructure. + +## Import + +Exadata Infrastructures can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_oracle_exadata_infrastructure.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup/providers/Oracle.Database/cloudExadataInfrastructures/cloudExadataInfrastructures1 +```