diff --git a/resource-manager/chaosstudio/2025-01-01/targets/model_target.go b/resource-manager/chaosstudio/2025-01-01/targets/model_target.go index ecb3bf98595..8e6fcea1661 100644 --- a/resource-manager/chaosstudio/2025-01-01/targets/model_target.go +++ b/resource-manager/chaosstudio/2025-01-01/targets/model_target.go @@ -8,10 +8,10 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type Target struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *map[string]interface{} `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties map[string]interface{} `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` } diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/constants.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/constants.go index 58c8adcb593..edb054d133b 100644 --- a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/constants.go +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/constants.go @@ -9,6 +9,44 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AmazonRdsForOracleAuthenticationType string + +const ( + AmazonRdsForOracleAuthenticationTypeBasic AmazonRdsForOracleAuthenticationType = "Basic" +) + +func PossibleValuesForAmazonRdsForOracleAuthenticationType() []string { + return []string{ + string(AmazonRdsForOracleAuthenticationTypeBasic), + } +} + +func (s *AmazonRdsForOracleAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAmazonRdsForOracleAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAmazonRdsForOracleAuthenticationType(input string) (*AmazonRdsForOracleAuthenticationType, error) { + vals := map[string]AmazonRdsForOracleAuthenticationType{ + "basic": AmazonRdsForOracleAuthenticationTypeBasic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AmazonRdsForOracleAuthenticationType(input) + return &out, nil +} + type AmazonRdsForSqlAuthenticationType string const ( @@ -994,6 +1032,47 @@ func parseImpalaAuthenticationType(input string) (*ImpalaAuthenticationType, err return &out, nil } +type ImpalaThriftTransportProtocol string + +const ( + ImpalaThriftTransportProtocolBinary ImpalaThriftTransportProtocol = "Binary" + ImpalaThriftTransportProtocolHTTP ImpalaThriftTransportProtocol = "HTTP" +) + +func PossibleValuesForImpalaThriftTransportProtocol() []string { + return []string{ + string(ImpalaThriftTransportProtocolBinary), + string(ImpalaThriftTransportProtocolHTTP), + } +} + +func (s *ImpalaThriftTransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseImpalaThriftTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseImpalaThriftTransportProtocol(input string) (*ImpalaThriftTransportProtocol, error) { + vals := map[string]ImpalaThriftTransportProtocol{ + "binary": ImpalaThriftTransportProtocolBinary, + "http": ImpalaThriftTransportProtocolHTTP, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ImpalaThriftTransportProtocol(input) + return &out, nil +} + type IntegrationRuntimeEdition string const ( diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforlinkedservicetypeproperties.go index d3636b3d79c..41e80310fa4 100644 --- a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforlinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_amazonrdsforlinkedservicetypeproperties.go @@ -9,24 +9,66 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AmazonRdsForLinkedServiceTypeProperties struct { - ConnectionString interface{} `json:"connectionString"` - EncryptedCredential *string `json:"encryptedCredential,omitempty"` - Password SecretBase `json:"password"` + AuthenticationType *AmazonRdsForOracleAuthenticationType `json:"authenticationType,omitempty"` + ConnectionString *interface{} `json:"connectionString,omitempty"` + CryptoChecksumClient *interface{} `json:"cryptoChecksumClient,omitempty"` + CryptoChecksumTypesClient *interface{} `json:"cryptoChecksumTypesClient,omitempty"` + EnableBulkLoad *bool `json:"enableBulkLoad,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + EncryptionClient *interface{} `json:"encryptionClient,omitempty"` + EncryptionTypesClient *interface{} `json:"encryptionTypesClient,omitempty"` + FetchSize *int64 `json:"fetchSize,omitempty"` + FetchTswtzAsTimestamp *bool `json:"fetchTswtzAsTimestamp,omitempty"` + InitialLobFetchSize *int64 `json:"initialLobFetchSize,omitempty"` + InitializationString *interface{} `json:"initializationString,omitempty"` + Password SecretBase `json:"password"` + Server *interface{} `json:"server,omitempty"` + StatementCacheSize *int64 `json:"statementCacheSize,omitempty"` + SupportV1DataTypes *bool `json:"supportV1DataTypes,omitempty"` + Username *interface{} `json:"username,omitempty"` } var _ json.Unmarshaler = &AmazonRdsForLinkedServiceTypeProperties{} func (s *AmazonRdsForLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { var decoded struct { - ConnectionString interface{} `json:"connectionString"` - EncryptedCredential *string `json:"encryptedCredential,omitempty"` + AuthenticationType *AmazonRdsForOracleAuthenticationType `json:"authenticationType,omitempty"` + ConnectionString *interface{} `json:"connectionString,omitempty"` + CryptoChecksumClient *interface{} `json:"cryptoChecksumClient,omitempty"` + CryptoChecksumTypesClient *interface{} `json:"cryptoChecksumTypesClient,omitempty"` + EnableBulkLoad *bool `json:"enableBulkLoad,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + EncryptionClient *interface{} `json:"encryptionClient,omitempty"` + EncryptionTypesClient *interface{} `json:"encryptionTypesClient,omitempty"` + FetchSize *int64 `json:"fetchSize,omitempty"` + FetchTswtzAsTimestamp *bool `json:"fetchTswtzAsTimestamp,omitempty"` + InitialLobFetchSize *int64 `json:"initialLobFetchSize,omitempty"` + InitializationString *interface{} `json:"initializationString,omitempty"` + Server *interface{} `json:"server,omitempty"` + StatementCacheSize *int64 `json:"statementCacheSize,omitempty"` + SupportV1DataTypes *bool `json:"supportV1DataTypes,omitempty"` + Username *interface{} `json:"username,omitempty"` } if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } + s.AuthenticationType = decoded.AuthenticationType s.ConnectionString = decoded.ConnectionString + s.CryptoChecksumClient = decoded.CryptoChecksumClient + s.CryptoChecksumTypesClient = decoded.CryptoChecksumTypesClient + s.EnableBulkLoad = decoded.EnableBulkLoad s.EncryptedCredential = decoded.EncryptedCredential + s.EncryptionClient = decoded.EncryptionClient + s.EncryptionTypesClient = decoded.EncryptionTypesClient + s.FetchSize = decoded.FetchSize + s.FetchTswtzAsTimestamp = decoded.FetchTswtzAsTimestamp + s.InitialLobFetchSize = decoded.InitialLobFetchSize + s.InitializationString = decoded.InitializationString + s.Server = decoded.Server + s.StatementCacheSize = decoded.StatementCacheSize + s.SupportV1DataTypes = decoded.SupportV1DataTypes + s.Username = decoded.Username var temp map[string]json.RawMessage if err := json.Unmarshal(bytes, &temp); err != nil { diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabrickslinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabrickslinkedservicetypeproperties.go index e3b397d60b6..c0b94b02d26 100644 --- a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabrickslinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_azuredatabrickslinkedservicetypeproperties.go @@ -12,6 +12,7 @@ type AzureDatabricksLinkedServiceTypeProperties struct { AccessToken SecretBase `json:"accessToken"` Authentication *interface{} `json:"authentication,omitempty"` Credential *CredentialReference `json:"credential,omitempty"` + DataSecurityMode *interface{} `json:"dataSecurityMode,omitempty"` Domain interface{} `json:"domain"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` ExistingClusterId *interface{} `json:"existingClusterId,omitempty"` @@ -36,6 +37,7 @@ func (s *AzureDatabricksLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) var decoded struct { Authentication *interface{} `json:"authentication,omitempty"` Credential *CredentialReference `json:"credential,omitempty"` + DataSecurityMode *interface{} `json:"dataSecurityMode,omitempty"` Domain interface{} `json:"domain"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` ExistingClusterId *interface{} `json:"existingClusterId,omitempty"` @@ -59,6 +61,7 @@ func (s *AzureDatabricksLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) s.Authentication = decoded.Authentication s.Credential = decoded.Credential + s.DataSecurityMode = decoded.DataSecurityMode s.Domain = decoded.Domain s.EncryptedCredential = decoded.EncryptedCredential s.ExistingClusterId = decoded.ExistingClusterId diff --git a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_impalalinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_impalalinkedservicetypeproperties.go index f0b4a0e1bcb..eed9afa702b 100644 --- a/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_impalalinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/dataflowdebugsession/model_impalalinkedservicetypeproperties.go @@ -9,33 +9,37 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ImpalaLinkedServiceTypeProperties struct { - AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` - AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` - AuthenticationType ImpalaAuthenticationType `json:"authenticationType"` - EnableSsl *bool `json:"enableSsl,omitempty"` - EncryptedCredential *string `json:"encryptedCredential,omitempty"` - Host interface{} `json:"host"` - Password SecretBase `json:"password"` - Port *int64 `json:"port,omitempty"` - TrustedCertPath *interface{} `json:"trustedCertPath,omitempty"` - UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` - Username *interface{} `json:"username,omitempty"` + AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` + AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` + AuthenticationType ImpalaAuthenticationType `json:"authenticationType"` + EnableServerCertificateValidation *bool `json:"enableServerCertificateValidation,omitempty"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host interface{} `json:"host"` + Password SecretBase `json:"password"` + Port *int64 `json:"port,omitempty"` + ThriftTransportProtocol *ImpalaThriftTransportProtocol `json:"thriftTransportProtocol,omitempty"` + TrustedCertPath *interface{} `json:"trustedCertPath,omitempty"` + UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` + Username *interface{} `json:"username,omitempty"` } var _ json.Unmarshaler = &ImpalaLinkedServiceTypeProperties{} func (s *ImpalaLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { var decoded struct { - AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` - AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` - AuthenticationType ImpalaAuthenticationType `json:"authenticationType"` - EnableSsl *bool `json:"enableSsl,omitempty"` - EncryptedCredential *string `json:"encryptedCredential,omitempty"` - Host interface{} `json:"host"` - Port *int64 `json:"port,omitempty"` - TrustedCertPath *interface{} `json:"trustedCertPath,omitempty"` - UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` - Username *interface{} `json:"username,omitempty"` + AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` + AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` + AuthenticationType ImpalaAuthenticationType `json:"authenticationType"` + EnableServerCertificateValidation *bool `json:"enableServerCertificateValidation,omitempty"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host interface{} `json:"host"` + Port *int64 `json:"port,omitempty"` + ThriftTransportProtocol *ImpalaThriftTransportProtocol `json:"thriftTransportProtocol,omitempty"` + TrustedCertPath *interface{} `json:"trustedCertPath,omitempty"` + UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` + Username *interface{} `json:"username,omitempty"` } if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) @@ -44,10 +48,12 @@ func (s *ImpalaLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { s.AllowHostNameCNMismatch = decoded.AllowHostNameCNMismatch s.AllowSelfSignedServerCert = decoded.AllowSelfSignedServerCert s.AuthenticationType = decoded.AuthenticationType + s.EnableServerCertificateValidation = decoded.EnableServerCertificateValidation s.EnableSsl = decoded.EnableSsl s.EncryptedCredential = decoded.EncryptedCredential s.Host = decoded.Host s.Port = decoded.Port + s.ThriftTransportProtocol = decoded.ThriftTransportProtocol s.TrustedCertPath = decoded.TrustedCertPath s.UseSystemTrustStore = decoded.UseSystemTrustStore s.Username = decoded.Username diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/constants.go b/resource-manager/datafactory/2018-06-01/linkedservices/constants.go index c3ac7c648e7..1d8a53c6e72 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/constants.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/constants.go @@ -9,6 +9,44 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AmazonRdsForOracleAuthenticationType string + +const ( + AmazonRdsForOracleAuthenticationTypeBasic AmazonRdsForOracleAuthenticationType = "Basic" +) + +func PossibleValuesForAmazonRdsForOracleAuthenticationType() []string { + return []string{ + string(AmazonRdsForOracleAuthenticationTypeBasic), + } +} + +func (s *AmazonRdsForOracleAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAmazonRdsForOracleAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAmazonRdsForOracleAuthenticationType(input string) (*AmazonRdsForOracleAuthenticationType, error) { + vals := map[string]AmazonRdsForOracleAuthenticationType{ + "basic": AmazonRdsForOracleAuthenticationTypeBasic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AmazonRdsForOracleAuthenticationType(input) + return &out, nil +} + type AmazonRdsForSqlAuthenticationType string const ( @@ -830,6 +868,47 @@ func parseImpalaAuthenticationType(input string) (*ImpalaAuthenticationType, err return &out, nil } +type ImpalaThriftTransportProtocol string + +const ( + ImpalaThriftTransportProtocolBinary ImpalaThriftTransportProtocol = "Binary" + ImpalaThriftTransportProtocolHTTP ImpalaThriftTransportProtocol = "HTTP" +) + +func PossibleValuesForImpalaThriftTransportProtocol() []string { + return []string{ + string(ImpalaThriftTransportProtocolBinary), + string(ImpalaThriftTransportProtocolHTTP), + } +} + +func (s *ImpalaThriftTransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseImpalaThriftTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseImpalaThriftTransportProtocol(input string) (*ImpalaThriftTransportProtocol, error) { + vals := map[string]ImpalaThriftTransportProtocol{ + "binary": ImpalaThriftTransportProtocolBinary, + "http": ImpalaThriftTransportProtocolHTTP, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ImpalaThriftTransportProtocol(input) + return &out, nil +} + type IntegrationRuntimeReferenceType string const ( diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_amazonrdsforlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_amazonrdsforlinkedservicetypeproperties.go index b6da8e8c6ea..ad46875b534 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_amazonrdsforlinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_amazonrdsforlinkedservicetypeproperties.go @@ -9,24 +9,66 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AmazonRdsForLinkedServiceTypeProperties struct { - ConnectionString interface{} `json:"connectionString"` - EncryptedCredential *string `json:"encryptedCredential,omitempty"` - Password SecretBase `json:"password"` + AuthenticationType *AmazonRdsForOracleAuthenticationType `json:"authenticationType,omitempty"` + ConnectionString *interface{} `json:"connectionString,omitempty"` + CryptoChecksumClient *interface{} `json:"cryptoChecksumClient,omitempty"` + CryptoChecksumTypesClient *interface{} `json:"cryptoChecksumTypesClient,omitempty"` + EnableBulkLoad *bool `json:"enableBulkLoad,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + EncryptionClient *interface{} `json:"encryptionClient,omitempty"` + EncryptionTypesClient *interface{} `json:"encryptionTypesClient,omitempty"` + FetchSize *int64 `json:"fetchSize,omitempty"` + FetchTswtzAsTimestamp *bool `json:"fetchTswtzAsTimestamp,omitempty"` + InitialLobFetchSize *int64 `json:"initialLobFetchSize,omitempty"` + InitializationString *interface{} `json:"initializationString,omitempty"` + Password SecretBase `json:"password"` + Server *interface{} `json:"server,omitempty"` + StatementCacheSize *int64 `json:"statementCacheSize,omitempty"` + SupportV1DataTypes *bool `json:"supportV1DataTypes,omitempty"` + Username *interface{} `json:"username,omitempty"` } var _ json.Unmarshaler = &AmazonRdsForLinkedServiceTypeProperties{} func (s *AmazonRdsForLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { var decoded struct { - ConnectionString interface{} `json:"connectionString"` - EncryptedCredential *string `json:"encryptedCredential,omitempty"` + AuthenticationType *AmazonRdsForOracleAuthenticationType `json:"authenticationType,omitempty"` + ConnectionString *interface{} `json:"connectionString,omitempty"` + CryptoChecksumClient *interface{} `json:"cryptoChecksumClient,omitempty"` + CryptoChecksumTypesClient *interface{} `json:"cryptoChecksumTypesClient,omitempty"` + EnableBulkLoad *bool `json:"enableBulkLoad,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + EncryptionClient *interface{} `json:"encryptionClient,omitempty"` + EncryptionTypesClient *interface{} `json:"encryptionTypesClient,omitempty"` + FetchSize *int64 `json:"fetchSize,omitempty"` + FetchTswtzAsTimestamp *bool `json:"fetchTswtzAsTimestamp,omitempty"` + InitialLobFetchSize *int64 `json:"initialLobFetchSize,omitempty"` + InitializationString *interface{} `json:"initializationString,omitempty"` + Server *interface{} `json:"server,omitempty"` + StatementCacheSize *int64 `json:"statementCacheSize,omitempty"` + SupportV1DataTypes *bool `json:"supportV1DataTypes,omitempty"` + Username *interface{} `json:"username,omitempty"` } if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) } + s.AuthenticationType = decoded.AuthenticationType s.ConnectionString = decoded.ConnectionString + s.CryptoChecksumClient = decoded.CryptoChecksumClient + s.CryptoChecksumTypesClient = decoded.CryptoChecksumTypesClient + s.EnableBulkLoad = decoded.EnableBulkLoad s.EncryptedCredential = decoded.EncryptedCredential + s.EncryptionClient = decoded.EncryptionClient + s.EncryptionTypesClient = decoded.EncryptionTypesClient + s.FetchSize = decoded.FetchSize + s.FetchTswtzAsTimestamp = decoded.FetchTswtzAsTimestamp + s.InitialLobFetchSize = decoded.InitialLobFetchSize + s.InitializationString = decoded.InitializationString + s.Server = decoded.Server + s.StatementCacheSize = decoded.StatementCacheSize + s.SupportV1DataTypes = decoded.SupportV1DataTypes + s.Username = decoded.Username var temp map[string]json.RawMessage if err := json.Unmarshal(bytes, &temp); err != nil { diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_azuredatabrickslinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_azuredatabrickslinkedservicetypeproperties.go index ee42aa19962..2fb3ceae33d 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_azuredatabrickslinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_azuredatabrickslinkedservicetypeproperties.go @@ -12,6 +12,7 @@ type AzureDatabricksLinkedServiceTypeProperties struct { AccessToken SecretBase `json:"accessToken"` Authentication *interface{} `json:"authentication,omitempty"` Credential *CredentialReference `json:"credential,omitempty"` + DataSecurityMode *interface{} `json:"dataSecurityMode,omitempty"` Domain interface{} `json:"domain"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` ExistingClusterId *interface{} `json:"existingClusterId,omitempty"` @@ -36,6 +37,7 @@ func (s *AzureDatabricksLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) var decoded struct { Authentication *interface{} `json:"authentication,omitempty"` Credential *CredentialReference `json:"credential,omitempty"` + DataSecurityMode *interface{} `json:"dataSecurityMode,omitempty"` Domain interface{} `json:"domain"` EncryptedCredential *string `json:"encryptedCredential,omitempty"` ExistingClusterId *interface{} `json:"existingClusterId,omitempty"` @@ -59,6 +61,7 @@ func (s *AzureDatabricksLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) s.Authentication = decoded.Authentication s.Credential = decoded.Credential + s.DataSecurityMode = decoded.DataSecurityMode s.Domain = decoded.Domain s.EncryptedCredential = decoded.EncryptedCredential s.ExistingClusterId = decoded.ExistingClusterId diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_impalalinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_impalalinkedservicetypeproperties.go index 049bc299061..05d8d7b097a 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_impalalinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_impalalinkedservicetypeproperties.go @@ -9,33 +9,37 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type ImpalaLinkedServiceTypeProperties struct { - AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` - AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` - AuthenticationType ImpalaAuthenticationType `json:"authenticationType"` - EnableSsl *bool `json:"enableSsl,omitempty"` - EncryptedCredential *string `json:"encryptedCredential,omitempty"` - Host interface{} `json:"host"` - Password SecretBase `json:"password"` - Port *int64 `json:"port,omitempty"` - TrustedCertPath *interface{} `json:"trustedCertPath,omitempty"` - UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` - Username *interface{} `json:"username,omitempty"` + AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` + AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` + AuthenticationType ImpalaAuthenticationType `json:"authenticationType"` + EnableServerCertificateValidation *bool `json:"enableServerCertificateValidation,omitempty"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host interface{} `json:"host"` + Password SecretBase `json:"password"` + Port *int64 `json:"port,omitempty"` + ThriftTransportProtocol *ImpalaThriftTransportProtocol `json:"thriftTransportProtocol,omitempty"` + TrustedCertPath *interface{} `json:"trustedCertPath,omitempty"` + UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` + Username *interface{} `json:"username,omitempty"` } var _ json.Unmarshaler = &ImpalaLinkedServiceTypeProperties{} func (s *ImpalaLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { var decoded struct { - AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` - AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` - AuthenticationType ImpalaAuthenticationType `json:"authenticationType"` - EnableSsl *bool `json:"enableSsl,omitempty"` - EncryptedCredential *string `json:"encryptedCredential,omitempty"` - Host interface{} `json:"host"` - Port *int64 `json:"port,omitempty"` - TrustedCertPath *interface{} `json:"trustedCertPath,omitempty"` - UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` - Username *interface{} `json:"username,omitempty"` + AllowHostNameCNMismatch *bool `json:"allowHostNameCNMismatch,omitempty"` + AllowSelfSignedServerCert *bool `json:"allowSelfSignedServerCert,omitempty"` + AuthenticationType ImpalaAuthenticationType `json:"authenticationType"` + EnableServerCertificateValidation *bool `json:"enableServerCertificateValidation,omitempty"` + EnableSsl *bool `json:"enableSsl,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + Host interface{} `json:"host"` + Port *int64 `json:"port,omitempty"` + ThriftTransportProtocol *ImpalaThriftTransportProtocol `json:"thriftTransportProtocol,omitempty"` + TrustedCertPath *interface{} `json:"trustedCertPath,omitempty"` + UseSystemTrustStore *bool `json:"useSystemTrustStore,omitempty"` + Username *interface{} `json:"username,omitempty"` } if err := json.Unmarshal(bytes, &decoded); err != nil { return fmt.Errorf("unmarshaling: %+v", err) @@ -44,10 +48,12 @@ func (s *ImpalaLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error { s.AllowHostNameCNMismatch = decoded.AllowHostNameCNMismatch s.AllowSelfSignedServerCert = decoded.AllowSelfSignedServerCert s.AuthenticationType = decoded.AuthenticationType + s.EnableServerCertificateValidation = decoded.EnableServerCertificateValidation s.EnableSsl = decoded.EnableSsl s.EncryptedCredential = decoded.EncryptedCredential s.Host = decoded.Host s.Port = decoded.Port + s.ThriftTransportProtocol = decoded.ThriftTransportProtocol s.TrustedCertPath = decoded.TrustedCertPath s.UseSystemTrustStore = decoded.UseSystemTrustStore s.Username = decoded.Username diff --git a/resource-manager/network/2024-05-01/networkmanageractiveconfigurations/constants.go b/resource-manager/network/2024-05-01/networkmanageractiveconfigurations/constants.go index c9291fb2fab..793caeabedc 100644 --- a/resource-manager/network/2024-05-01/networkmanageractiveconfigurations/constants.go +++ b/resource-manager/network/2024-05-01/networkmanageractiveconfigurations/constants.go @@ -138,6 +138,8 @@ func parseGroupMemberType(input string) (*GroupMemberType, error) { type ProvisioningState string const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" @@ -146,6 +148,8 @@ const ( func PossibleValuesForProvisioningState() []string { return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), string(ProvisioningStateDeleting), string(ProvisioningStateFailed), string(ProvisioningStateSucceeded), @@ -168,6 +172,8 @@ func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { func parseProvisioningState(input string) (*ProvisioningState, error) { vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, "deleting": ProvisioningStateDeleting, "failed": ProvisioningStateFailed, "succeeded": ProvisioningStateSucceeded, diff --git a/resource-manager/network/2024-05-01/networkmanageractiveconnectivityconfigurations/constants.go b/resource-manager/network/2024-05-01/networkmanageractiveconnectivityconfigurations/constants.go index 642ecd4a0bd..6f3a6c4f554 100644 --- a/resource-manager/network/2024-05-01/networkmanageractiveconnectivityconfigurations/constants.go +++ b/resource-manager/network/2024-05-01/networkmanageractiveconnectivityconfigurations/constants.go @@ -217,6 +217,8 @@ func parseIsGlobal(input string) (*IsGlobal, error) { type ProvisioningState string const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" @@ -225,6 +227,8 @@ const ( func PossibleValuesForProvisioningState() []string { return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), string(ProvisioningStateDeleting), string(ProvisioningStateFailed), string(ProvisioningStateSucceeded), @@ -247,6 +251,8 @@ func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { func parseProvisioningState(input string) (*ProvisioningState, error) { vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, "deleting": ProvisioningStateDeleting, "failed": ProvisioningStateFailed, "succeeded": ProvisioningStateSucceeded, diff --git a/resource-manager/network/2024-05-01/networkmanagereffectiveconnectivityconfiguration/constants.go b/resource-manager/network/2024-05-01/networkmanagereffectiveconnectivityconfiguration/constants.go index caa8b3c8747..9007e4a33df 100644 --- a/resource-manager/network/2024-05-01/networkmanagereffectiveconnectivityconfiguration/constants.go +++ b/resource-manager/network/2024-05-01/networkmanagereffectiveconnectivityconfiguration/constants.go @@ -217,6 +217,8 @@ func parseIsGlobal(input string) (*IsGlobal, error) { type ProvisioningState string const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" @@ -225,6 +227,8 @@ const ( func PossibleValuesForProvisioningState() []string { return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), string(ProvisioningStateDeleting), string(ProvisioningStateFailed), string(ProvisioningStateSucceeded), @@ -247,6 +251,8 @@ func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { func parseProvisioningState(input string) (*ProvisioningState, error) { vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, "deleting": ProvisioningStateDeleting, "failed": ProvisioningStateFailed, "succeeded": ProvisioningStateSucceeded, diff --git a/resource-manager/network/2024-05-01/networkmanagereffectivesecurityadminrules/constants.go b/resource-manager/network/2024-05-01/networkmanagereffectivesecurityadminrules/constants.go index 67086d778e3..6dbd1e6db74 100644 --- a/resource-manager/network/2024-05-01/networkmanagereffectivesecurityadminrules/constants.go +++ b/resource-manager/network/2024-05-01/networkmanagereffectivesecurityadminrules/constants.go @@ -138,6 +138,8 @@ func parseGroupMemberType(input string) (*GroupMemberType, error) { type ProvisioningState string const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateSucceeded ProvisioningState = "Succeeded" @@ -146,6 +148,8 @@ const ( func PossibleValuesForProvisioningState() []string { return []string{ + string(ProvisioningStateCanceled), + string(ProvisioningStateCreating), string(ProvisioningStateDeleting), string(ProvisioningStateFailed), string(ProvisioningStateSucceeded), @@ -168,6 +172,8 @@ func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { func parseProvisioningState(input string) (*ProvisioningState, error) { vals := map[string]ProvisioningState{ + "canceled": ProvisioningStateCanceled, + "creating": ProvisioningStateCreating, "deleting": ProvisioningStateDeleting, "failed": ProvisioningStateFailed, "succeeded": ProvisioningStateSucceeded, diff --git a/resource-manager/operationalinsights/2025-02-01/workspaces/README.md b/resource-manager/operationalinsights/2025-02-01/workspaces/README.md index be057ed09db..1c22012220b 100644 --- a/resource-manager/operationalinsights/2025-02-01/workspaces/README.md +++ b/resource-manager/operationalinsights/2025-02-01/workspaces/README.md @@ -50,6 +50,30 @@ if err := client.DeleteThenPoll(ctx, id, workspaces.DefaultDeleteOperationOption ``` +### Example Usage: `WorkspacesClient.Failback` + +```go +ctx := context.TODO() +id := workspaces.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName") + +if err := client.FailbackThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `WorkspacesClient.Failover` + +```go +ctx := context.TODO() +id := workspaces.NewLocationWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "workspaceName") + +if err := client.FailoverThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + ### Example Usage: `WorkspacesClient.GatewaysDelete` ```go diff --git a/resource-manager/operationalinsights/2025-02-01/workspaces/id_locationworkspace.go b/resource-manager/operationalinsights/2025-02-01/workspaces/id_locationworkspace.go new file mode 100644 index 00000000000..674cb25599a --- /dev/null +++ b/resource-manager/operationalinsights/2025-02-01/workspaces/id_locationworkspace.go @@ -0,0 +1,139 @@ +package workspaces + +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(&LocationWorkspaceId{}) +} + +var _ resourceids.ResourceId = &LocationWorkspaceId{} + +// LocationWorkspaceId is a struct representing the Resource ID for a Location Workspace +type LocationWorkspaceId struct { + SubscriptionId string + ResourceGroupName string + LocationName string + WorkspaceName string +} + +// NewLocationWorkspaceID returns a new LocationWorkspaceId struct +func NewLocationWorkspaceID(subscriptionId string, resourceGroupName string, locationName string, workspaceName string) LocationWorkspaceId { + return LocationWorkspaceId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + LocationName: locationName, + WorkspaceName: workspaceName, + } +} + +// ParseLocationWorkspaceID parses 'input' into a LocationWorkspaceId +func ParseLocationWorkspaceID(input string) (*LocationWorkspaceId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationWorkspaceId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationWorkspaceId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseLocationWorkspaceIDInsensitively parses 'input' case-insensitively into a LocationWorkspaceId +// note: this method should only be used for API response data and not user input +func ParseLocationWorkspaceIDInsensitively(input string) (*LocationWorkspaceId, error) { + parser := resourceids.NewParserFromResourceIdType(&LocationWorkspaceId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LocationWorkspaceId{} + if err = id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *LocationWorkspaceId) 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.LocationName, ok = input.Parsed["locationName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) + } + + if id.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) + } + + return nil +} + +// ValidateLocationWorkspaceID checks that 'input' can be parsed as a Location Workspace ID +func ValidateLocationWorkspaceID(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 := ParseLocationWorkspaceID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Location Workspace ID +func (id LocationWorkspaceId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/locations/%s/workspaces/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LocationName, id.WorkspaceName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Location Workspace ID +func (id LocationWorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationName"), + resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), + resourceids.UserSpecifiedSegment("workspaceName", "workspaceName"), + } +} + +// String returns a human-readable description of this Location Workspace ID +func (id LocationWorkspaceId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Location Name: %q", id.LocationName), + fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), + } + return fmt.Sprintf("Location Workspace (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/operationalinsights/2025-02-01/workspaces/id_locationworkspace_test.go b/resource-manager/operationalinsights/2025-02-01/workspaces/id_locationworkspace_test.go new file mode 100644 index 00000000000..8cbaa2df08e --- /dev/null +++ b/resource-manager/operationalinsights/2025-02-01/workspaces/id_locationworkspace_test.go @@ -0,0 +1,327 @@ +package workspaces + +import ( + "testing" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = &LocationWorkspaceId{} + +func TestNewLocationWorkspaceID(t *testing.T) { + id := NewLocationWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "workspaceName") + + if id.SubscriptionId != "12345678-1234-9876-4563-123456789012" { + t.Fatalf("Expected %q but got %q for Segment 'SubscriptionId'", id.SubscriptionId, "12345678-1234-9876-4563-123456789012") + } + + if id.ResourceGroupName != "example-resource-group" { + t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "example-resource-group") + } + + if id.LocationName != "locationName" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationName") + } + + if id.WorkspaceName != "workspaceName" { + t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceName") + } +} + +func TestFormatLocationWorkspaceID(t *testing.T) { + actual := NewLocationWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationName", "workspaceName").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/locations/locationName/workspaces/workspaceName" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseLocationWorkspaceID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *LocationWorkspaceId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/locations", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/locations/locationName", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/locations/locationName/workspaces", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/locations/locationName/workspaces/workspaceName", + Expected: &LocationWorkspaceId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + LocationName: "locationName", + WorkspaceName: "workspaceName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/locations/locationName/workspaces/workspaceName/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseLocationWorkspaceID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.LocationName != v.Expected.LocationName { + t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) + } + + if actual.WorkspaceName != v.Expected.WorkspaceName { + t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) + } + + } +} + +func TestParseLocationWorkspaceIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *LocationWorkspaceId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/locations", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/lOcAtIoNs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/locations/locationName", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/lOcAtIoNs/lOcAtIoNnAmE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/locations/locationName/workspaces", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/lOcAtIoNs/lOcAtIoNnAmE/wOrKsPaCeS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/locations/locationName/workspaces/workspaceName", + Expected: &LocationWorkspaceId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + LocationName: "locationName", + WorkspaceName: "workspaceName", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/locations/locationName/workspaces/workspaceName/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/lOcAtIoNs/lOcAtIoNnAmE/wOrKsPaCeS/wOrKsPaCeNaMe", + Expected: &LocationWorkspaceId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + LocationName: "lOcAtIoNnAmE", + WorkspaceName: "wOrKsPaCeNaMe", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/lOcAtIoNs/lOcAtIoNnAmE/wOrKsPaCeS/wOrKsPaCeNaMe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseLocationWorkspaceIDInsensitively(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expect a value but got an error: %+v", err) + } + if v.Error { + t.Fatal("Expect an error but didn't get one") + } + + if actual.SubscriptionId != v.Expected.SubscriptionId { + t.Fatalf("Expected %q but got %q for SubscriptionId", v.Expected.SubscriptionId, actual.SubscriptionId) + } + + if actual.ResourceGroupName != v.Expected.ResourceGroupName { + t.Fatalf("Expected %q but got %q for ResourceGroupName", v.Expected.ResourceGroupName, actual.ResourceGroupName) + } + + if actual.LocationName != v.Expected.LocationName { + t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) + } + + if actual.WorkspaceName != v.Expected.WorkspaceName { + t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) + } + + } +} + +func TestSegmentsForLocationWorkspaceId(t *testing.T) { + segments := LocationWorkspaceId{}.Segments() + if len(segments) == 0 { + t.Fatalf("LocationWorkspaceId has no segments") + } + + uniqueNames := make(map[string]struct{}, 0) + for _, segment := range segments { + uniqueNames[segment.Name] = struct{}{} + } + if len(uniqueNames) != len(segments) { + t.Fatalf("Expected the Segments to be unique but got %q unique segments and %d total segments", len(uniqueNames), len(segments)) + } +} diff --git a/resource-manager/operationalinsights/2025-02-01/workspaces/method_failback.go b/resource-manager/operationalinsights/2025-02-01/workspaces/method_failback.go new file mode 100644 index 00000000000..27be73711ed --- /dev/null +++ b/resource-manager/operationalinsights/2025-02-01/workspaces/method_failback.go @@ -0,0 +1,69 @@ +package workspaces + +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 FailbackOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Failback ... +func (c WorkspacesClient) Failback(ctx context.Context, id WorkspaceId) (result FailbackOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/failback", 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 +} + +// FailbackThenPoll performs Failback then polls until it's completed +func (c WorkspacesClient) FailbackThenPoll(ctx context.Context, id WorkspaceId) error { + result, err := c.Failback(ctx, id) + if err != nil { + return fmt.Errorf("performing Failback: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Failback: %+v", err) + } + + return nil +} diff --git a/resource-manager/operationalinsights/2025-02-01/workspaces/method_failover.go b/resource-manager/operationalinsights/2025-02-01/workspaces/method_failover.go new file mode 100644 index 00000000000..999a93b109a --- /dev/null +++ b/resource-manager/operationalinsights/2025-02-01/workspaces/method_failover.go @@ -0,0 +1,69 @@ +package workspaces + +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 +} + +// Failover ... +func (c WorkspacesClient) Failover(ctx context.Context, id LocationWorkspaceId) (result FailoverOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/failover", 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 +} + +// FailoverThenPoll performs Failover then polls until it's completed +func (c WorkspacesClient) FailoverThenPoll(ctx context.Context, id LocationWorkspaceId) error { + result, err := c.Failover(ctx, id) + 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/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/README.md b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/README.md index 16a4e154362..8a95fde81ba 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/README.md +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/README.md @@ -65,14 +65,14 @@ if model := read.Model; model != nil { ``` -### Example Usage: `AutonomousDatabaseBackupsClient.ListByAutonomousDatabase` +### Example Usage: `AutonomousDatabaseBackupsClient.ListByParent` ```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) +// alternatively `client.ListByParent(ctx, id)` can be used to do batched pagination +items, err := client.ListByParentComplete(ctx, id) if err != nil { // handle the error } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_listbyautonomousdatabase.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_listbyparent.go similarity index 55% rename from resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_listbyautonomousdatabase.go rename to resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_listbyparent.go index 38df32dfe02..6db542ef277 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_listbyautonomousdatabase.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/method_listbyparent.go @@ -12,22 +12,22 @@ import ( // 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 { +type ListByParentOperationResponse struct { HttpResponse *http.Response OData *odata.OData Model *[]AutonomousDatabaseBackup } -type ListByAutonomousDatabaseCompleteResult struct { +type ListByParentCompleteResult struct { LatestHttpResponse *http.Response Items []AutonomousDatabaseBackup } -type ListByAutonomousDatabaseCustomPager struct { +type ListByParentCustomPager struct { NextLink *odata.Link `json:"nextLink"` } -func (p *ListByAutonomousDatabaseCustomPager) NextPageLink() *odata.Link { +func (p *ListByParentCustomPager) NextPageLink() *odata.Link { defer func() { p.NextLink = nil }() @@ -35,15 +35,15 @@ func (p *ListByAutonomousDatabaseCustomPager) NextPageLink() *odata.Link { return p.NextLink } -// ListByAutonomousDatabase ... -func (c AutonomousDatabaseBackupsClient) ListByAutonomousDatabase(ctx context.Context, id AutonomousDatabaseId) (result ListByAutonomousDatabaseOperationResponse, err error) { +// ListByParent ... +func (c AutonomousDatabaseBackupsClient) ListByParent(ctx context.Context, id AutonomousDatabaseId) (result ListByParentOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ http.StatusOK, }, HttpMethod: http.MethodGet, - Pager: &ListByAutonomousDatabaseCustomPager{}, + Pager: &ListByParentCustomPager{}, Path: fmt.Sprintf("%s/autonomousDatabaseBackups", id.ID()), } @@ -74,16 +74,16 @@ func (c AutonomousDatabaseBackupsClient) ListByAutonomousDatabase(ctx context.Co 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{}) +// ListByParentComplete retrieves all the results into a single object +func (c AutonomousDatabaseBackupsClient) ListByParentComplete(ctx context.Context, id AutonomousDatabaseId) (ListByParentCompleteResult, error) { + return c.ListByParentCompleteMatchingPredicate(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) { +// ListByParentCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c AutonomousDatabaseBackupsClient) ListByParentCompleteMatchingPredicate(ctx context.Context, id AutonomousDatabaseId, predicate AutonomousDatabaseBackupOperationPredicate) (result ListByParentCompleteResult, err error) { items := make([]AutonomousDatabaseBackup, 0) - resp, err := c.ListByAutonomousDatabase(ctx, id) + resp, err := c.ListByParent(ctx, id) if err != nil { result.LatestHttpResponse = resp.HttpResponse err = fmt.Errorf("loading results: %+v", err) @@ -97,7 +97,7 @@ func (c AutonomousDatabaseBackupsClient) ListByAutonomousDatabaseCompleteMatchin } } - result = ListByAutonomousDatabaseCompleteResult{ + result = ListByParentCompleteResult{ LatestHttpResponse: resp.HttpResponse, Items: items, } diff --git a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackupupdate.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackupupdate.go index 4ccab72b0dc..4cf5dfb4dbd 100644 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackupupdate.go +++ b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackupupdate.go @@ -1,8 +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 AutonomousDatabaseBackupUpdate struct { - Properties *AutonomousDatabaseBackupUpdateProperties `json:"properties,omitempty"` + 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/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackupupdateproperties.go b/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackupupdateproperties.go deleted file mode 100644 index cebcbe7eb15..00000000000 --- a/resource-manager/oracledatabase/2024-06-01/autonomousdatabasebackups/model_autonomousdatabasebackupupdateproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -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/resource-manager/oracledatabase/2024-06-01/dbnodes/README.md b/resource-manager/oracledatabase/2024-06-01/dbnodes/README.md index 85970d8b53a..e95f8d3f5b5 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbnodes/README.md +++ b/resource-manager/oracledatabase/2024-06-01/dbnodes/README.md @@ -53,14 +53,14 @@ if model := read.Model; model != nil { ``` -### Example Usage: `DbNodesClient.ListByCloudVMCluster` +### Example Usage: `DbNodesClient.ListByParent` ```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) +// alternatively `client.ListByParent(ctx, id)` can be used to do batched pagination +items, err := client.ListByParentComplete(ctx, id) if err != nil { // handle the error } diff --git a/resource-manager/oracledatabase/2024-06-01/dbnodes/method_listbycloudvmcluster.go b/resource-manager/oracledatabase/2024-06-01/dbnodes/method_listbyparent.go similarity index 57% rename from resource-manager/oracledatabase/2024-06-01/dbnodes/method_listbycloudvmcluster.go rename to resource-manager/oracledatabase/2024-06-01/dbnodes/method_listbyparent.go index f610bea1c1d..d851f56f03a 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbnodes/method_listbycloudvmcluster.go +++ b/resource-manager/oracledatabase/2024-06-01/dbnodes/method_listbyparent.go @@ -12,22 +12,22 @@ import ( // 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 { +type ListByParentOperationResponse struct { HttpResponse *http.Response OData *odata.OData Model *[]DbNode } -type ListByCloudVMClusterCompleteResult struct { +type ListByParentCompleteResult struct { LatestHttpResponse *http.Response Items []DbNode } -type ListByCloudVMClusterCustomPager struct { +type ListByParentCustomPager struct { NextLink *odata.Link `json:"nextLink"` } -func (p *ListByCloudVMClusterCustomPager) NextPageLink() *odata.Link { +func (p *ListByParentCustomPager) NextPageLink() *odata.Link { defer func() { p.NextLink = nil }() @@ -35,15 +35,15 @@ func (p *ListByCloudVMClusterCustomPager) NextPageLink() *odata.Link { return p.NextLink } -// ListByCloudVMCluster ... -func (c DbNodesClient) ListByCloudVMCluster(ctx context.Context, id CloudVMClusterId) (result ListByCloudVMClusterOperationResponse, err error) { +// ListByParent ... +func (c DbNodesClient) ListByParent(ctx context.Context, id CloudVMClusterId) (result ListByParentOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ http.StatusOK, }, HttpMethod: http.MethodGet, - Pager: &ListByCloudVMClusterCustomPager{}, + Pager: &ListByParentCustomPager{}, Path: fmt.Sprintf("%s/dbNodes", id.ID()), } @@ -74,16 +74,16 @@ func (c DbNodesClient) ListByCloudVMCluster(ctx context.Context, id CloudVMClust 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{}) +// ListByParentComplete retrieves all the results into a single object +func (c DbNodesClient) ListByParentComplete(ctx context.Context, id CloudVMClusterId) (ListByParentCompleteResult, error) { + return c.ListByParentCompleteMatchingPredicate(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) { +// ListByParentCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c DbNodesClient) ListByParentCompleteMatchingPredicate(ctx context.Context, id CloudVMClusterId, predicate DbNodeOperationPredicate) (result ListByParentCompleteResult, err error) { items := make([]DbNode, 0) - resp, err := c.ListByCloudVMCluster(ctx, id) + resp, err := c.ListByParent(ctx, id) if err != nil { result.LatestHttpResponse = resp.HttpResponse err = fmt.Errorf("loading results: %+v", err) @@ -97,7 +97,7 @@ func (c DbNodesClient) ListByCloudVMClusterCompleteMatchingPredicate(ctx context } } - result = ListByCloudVMClusterCompleteResult{ + result = ListByParentCompleteResult{ LatestHttpResponse: resp.HttpResponse, Items: items, } diff --git a/resource-manager/oracledatabase/2024-06-01/dbservers/README.md b/resource-manager/oracledatabase/2024-06-01/dbservers/README.md index 3e36e006cab..006bd94be0b 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbservers/README.md +++ b/resource-manager/oracledatabase/2024-06-01/dbservers/README.md @@ -36,14 +36,14 @@ if model := read.Model; model != nil { ``` -### Example Usage: `DbServersClient.ListByCloudExadataInfrastructure` +### Example Usage: `DbServersClient.ListByParent` ```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) +// alternatively `client.ListByParent(ctx, id)` can be used to do batched pagination +items, err := client.ListByParentComplete(ctx, id) if err != nil { // handle the error } diff --git a/resource-manager/oracledatabase/2024-06-01/dbservers/method_listbycloudexadatainfrastructure.go b/resource-manager/oracledatabase/2024-06-01/dbservers/method_listbyparent.go similarity index 52% rename from resource-manager/oracledatabase/2024-06-01/dbservers/method_listbycloudexadatainfrastructure.go rename to resource-manager/oracledatabase/2024-06-01/dbservers/method_listbyparent.go index 7440cdef40a..2402d07b98e 100644 --- a/resource-manager/oracledatabase/2024-06-01/dbservers/method_listbycloudexadatainfrastructure.go +++ b/resource-manager/oracledatabase/2024-06-01/dbservers/method_listbyparent.go @@ -12,22 +12,22 @@ import ( // 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 { +type ListByParentOperationResponse struct { HttpResponse *http.Response OData *odata.OData Model *[]DbServer } -type ListByCloudExadataInfrastructureCompleteResult struct { +type ListByParentCompleteResult struct { LatestHttpResponse *http.Response Items []DbServer } -type ListByCloudExadataInfrastructureCustomPager struct { +type ListByParentCustomPager struct { NextLink *odata.Link `json:"nextLink"` } -func (p *ListByCloudExadataInfrastructureCustomPager) NextPageLink() *odata.Link { +func (p *ListByParentCustomPager) NextPageLink() *odata.Link { defer func() { p.NextLink = nil }() @@ -35,15 +35,15 @@ func (p *ListByCloudExadataInfrastructureCustomPager) NextPageLink() *odata.Link return p.NextLink } -// ListByCloudExadataInfrastructure ... -func (c DbServersClient) ListByCloudExadataInfrastructure(ctx context.Context, id CloudExadataInfrastructureId) (result ListByCloudExadataInfrastructureOperationResponse, err error) { +// ListByParent ... +func (c DbServersClient) ListByParent(ctx context.Context, id CloudExadataInfrastructureId) (result ListByParentOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ http.StatusOK, }, HttpMethod: http.MethodGet, - Pager: &ListByCloudExadataInfrastructureCustomPager{}, + Pager: &ListByParentCustomPager{}, Path: fmt.Sprintf("%s/dbServers", id.ID()), } @@ -74,16 +74,16 @@ func (c DbServersClient) ListByCloudExadataInfrastructure(ctx context.Context, i 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{}) +// ListByParentComplete retrieves all the results into a single object +func (c DbServersClient) ListByParentComplete(ctx context.Context, id CloudExadataInfrastructureId) (ListByParentCompleteResult, error) { + return c.ListByParentCompleteMatchingPredicate(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) { +// ListByParentCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c DbServersClient) ListByParentCompleteMatchingPredicate(ctx context.Context, id CloudExadataInfrastructureId, predicate DbServerOperationPredicate) (result ListByParentCompleteResult, err error) { items := make([]DbServer, 0) - resp, err := c.ListByCloudExadataInfrastructure(ctx, id) + resp, err := c.ListByParent(ctx, id) if err != nil { result.LatestHttpResponse = resp.HttpResponse err = fmt.Errorf("loading results: %+v", err) @@ -97,7 +97,7 @@ func (c DbServersClient) ListByCloudExadataInfrastructureCompleteMatchingPredica } } - result = ListByCloudExadataInfrastructureCompleteResult{ + result = ListByParentCompleteResult{ LatestHttpResponse: resp.HttpResponse, Items: items, } diff --git a/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/README.md b/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/README.md index 38c028c0648..3a41327b6ea 100644 --- a/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/README.md +++ b/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/README.md @@ -65,14 +65,14 @@ if model := read.Model; model != nil { ``` -### Example Usage: `VirtualNetworkAddressesClient.ListByCloudVMCluster` +### Example Usage: `VirtualNetworkAddressesClient.ListByParent` ```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) +// alternatively `client.ListByParent(ctx, id)` can be used to do batched pagination +items, err := client.ListByParentComplete(ctx, id) if err != nil { // handle the error } diff --git a/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/method_listbycloudvmcluster.go b/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/method_listbyparent.go similarity index 57% rename from resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/method_listbycloudvmcluster.go rename to resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/method_listbyparent.go index 81eba745ec7..5d9d615971a 100644 --- a/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/method_listbycloudvmcluster.go +++ b/resource-manager/oracledatabase/2024-06-01/virtualnetworkaddresses/method_listbyparent.go @@ -12,22 +12,22 @@ import ( // 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 { +type ListByParentOperationResponse struct { HttpResponse *http.Response OData *odata.OData Model *[]VirtualNetworkAddress } -type ListByCloudVMClusterCompleteResult struct { +type ListByParentCompleteResult struct { LatestHttpResponse *http.Response Items []VirtualNetworkAddress } -type ListByCloudVMClusterCustomPager struct { +type ListByParentCustomPager struct { NextLink *odata.Link `json:"nextLink"` } -func (p *ListByCloudVMClusterCustomPager) NextPageLink() *odata.Link { +func (p *ListByParentCustomPager) NextPageLink() *odata.Link { defer func() { p.NextLink = nil }() @@ -35,15 +35,15 @@ func (p *ListByCloudVMClusterCustomPager) NextPageLink() *odata.Link { return p.NextLink } -// ListByCloudVMCluster ... -func (c VirtualNetworkAddressesClient) ListByCloudVMCluster(ctx context.Context, id CloudVMClusterId) (result ListByCloudVMClusterOperationResponse, err error) { +// ListByParent ... +func (c VirtualNetworkAddressesClient) ListByParent(ctx context.Context, id CloudVMClusterId) (result ListByParentOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ http.StatusOK, }, HttpMethod: http.MethodGet, - Pager: &ListByCloudVMClusterCustomPager{}, + Pager: &ListByParentCustomPager{}, Path: fmt.Sprintf("%s/virtualNetworkAddresses", id.ID()), } @@ -74,16 +74,16 @@ func (c VirtualNetworkAddressesClient) ListByCloudVMCluster(ctx context.Context, 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{}) +// ListByParentComplete retrieves all the results into a single object +func (c VirtualNetworkAddressesClient) ListByParentComplete(ctx context.Context, id CloudVMClusterId) (ListByParentCompleteResult, error) { + return c.ListByParentCompleteMatchingPredicate(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) { +// ListByParentCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VirtualNetworkAddressesClient) ListByParentCompleteMatchingPredicate(ctx context.Context, id CloudVMClusterId, predicate VirtualNetworkAddressOperationPredicate) (result ListByParentCompleteResult, err error) { items := make([]VirtualNetworkAddress, 0) - resp, err := c.ListByCloudVMCluster(ctx, id) + resp, err := c.ListByParent(ctx, id) if err != nil { result.LatestHttpResponse = resp.HttpResponse err = fmt.Errorf("loading results: %+v", err) @@ -97,7 +97,7 @@ func (c VirtualNetworkAddressesClient) ListByCloudVMClusterCompleteMatchingPredi } } - result = ListByCloudVMClusterCompleteResult{ + result = ListByParentCompleteResult{ LatestHttpResponse: resp.HttpResponse, Items: items, }