diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/README.rst b/sdk/apimanagement/azure-mgmt-apimanagement/README.rst index ec8eea3c8439..a0115f92fe77 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/README.rst +++ b/sdk/apimanagement/azure-mgmt-apimanagement/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure API Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. +This package has been tested with Python 2.7, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_api_management_client.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_api_management_client.py index 8645f1f79b4d..1d37453a3e82 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_api_management_client.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_api_management_client.py @@ -58,7 +58,7 @@ from .operations import ProductGroupOperations from .operations import ProductSubscriptionsOperations from .operations import ProductPolicyOperations -from .operations import PropertyOperations +from .operations import NamedValueOperations from .operations import QuotaByCounterKeysOperations from .operations import QuotaByPeriodKeysOperations from .operations import RegionOperations @@ -173,8 +173,8 @@ class ApiManagementClient(SDKClient): :vartype product_subscriptions: azure.mgmt.apimanagement.operations.ProductSubscriptionsOperations :ivar product_policy: ProductPolicy operations :vartype product_policy: azure.mgmt.apimanagement.operations.ProductPolicyOperations - :ivar property: Property operations - :vartype property: azure.mgmt.apimanagement.operations.PropertyOperations + :ivar named_value: NamedValue operations + :vartype named_value: azure.mgmt.apimanagement.operations.NamedValueOperations :ivar quota_by_counter_keys: QuotaByCounterKeys operations :vartype quota_by_counter_keys: azure.mgmt.apimanagement.operations.QuotaByCounterKeysOperations :ivar quota_by_period_keys: QuotaByPeriodKeys operations @@ -317,7 +317,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.product_policy = ProductPolicyOperations( self._client, self.config, self._serialize, self._deserialize) - self.property = PropertyOperations( + self.named_value = NamedValueOperations( self._client, self.config, self._serialize, self._deserialize) self.quota_by_counter_keys = QuotaByCounterKeysOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py index 26cb1758d143..fc4d99930b33 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py @@ -61,6 +61,7 @@ from ._models_py3 import CertificateContract from ._models_py3 import CertificateCreateOrUpdateParameters from ._models_py3 import CertificateInformation + from ._models_py3 import ClientSecretContract from ._models_py3 import ConnectivityStatusContract from ._models_py3 import DeployConfigurationParameters from ._models_py3 import DiagnosticContract @@ -87,6 +88,9 @@ from ._models_py3 import IssueUpdateContract from ._models_py3 import LoggerContract from ._models_py3 import LoggerUpdateContract + from ._models_py3 import NamedValueContract + from ._models_py3 import NamedValueEntityBaseParameters + from ._models_py3 import NamedValueUpdateParameters from ._models_py3 import NetworkStatusContract from ._models_py3 import NetworkStatusContractByLocation from ._models_py3 import NotificationContract @@ -115,9 +119,6 @@ from ._models_py3 import ProductEntityBaseParameters from ._models_py3 import ProductTagResourceContractProperties from ._models_py3 import ProductUpdateParameters - from ._models_py3 import PropertyContract - from ._models_py3 import PropertyEntityBaseParameters - from ._models_py3 import PropertyUpdateParameters from ._models_py3 import QuotaCounterCollection from ._models_py3 import QuotaCounterContract from ._models_py3 import QuotaCounterValueContract @@ -145,6 +146,7 @@ from ._models_py3 import SubscriptionContract from ._models_py3 import SubscriptionCreateParameters from ._models_py3 import SubscriptionKeyParameterNamesContract + from ._models_py3 import SubscriptionKeysContract from ._models_py3 import SubscriptionsDelegationSettingsProperties from ._models_py3 import SubscriptionUpdateParameters from ._models_py3 import TagContract @@ -217,6 +219,7 @@ from ._models import CertificateContract from ._models import CertificateCreateOrUpdateParameters from ._models import CertificateInformation + from ._models import ClientSecretContract from ._models import ConnectivityStatusContract from ._models import DeployConfigurationParameters from ._models import DiagnosticContract @@ -243,6 +246,9 @@ from ._models import IssueUpdateContract from ._models import LoggerContract from ._models import LoggerUpdateContract + from ._models import NamedValueContract + from ._models import NamedValueEntityBaseParameters + from ._models import NamedValueUpdateParameters from ._models import NetworkStatusContract from ._models import NetworkStatusContractByLocation from ._models import NotificationContract @@ -271,9 +277,6 @@ from ._models import ProductEntityBaseParameters from ._models import ProductTagResourceContractProperties from ._models import ProductUpdateParameters - from ._models import PropertyContract - from ._models import PropertyEntityBaseParameters - from ._models import PropertyUpdateParameters from ._models import QuotaCounterCollection from ._models import QuotaCounterContract from ._models import QuotaCounterValueContract @@ -301,6 +304,7 @@ from ._models import SubscriptionContract from ._models import SubscriptionCreateParameters from ._models import SubscriptionKeyParameterNamesContract + from ._models import SubscriptionKeysContract from ._models import SubscriptionsDelegationSettingsProperties from ._models import SubscriptionUpdateParameters from ._models import TagContract @@ -338,12 +342,12 @@ from ._paged_models import IssueCommentContractPaged from ._paged_models import IssueContractPaged from ._paged_models import LoggerContractPaged +from ._paged_models import NamedValueContractPaged from ._paged_models import NotificationContractPaged from ._paged_models import OpenidConnectProviderContractPaged from ._paged_models import OperationContractPaged from ._paged_models import OperationPaged from ._paged_models import ProductContractPaged -from ._paged_models import PropertyContractPaged from ._paged_models import RegionContractPaged from ._paged_models import ReportRecordContractPaged from ._paged_models import RequestReportRecordContractPaged @@ -446,6 +450,7 @@ 'CertificateContract', 'CertificateCreateOrUpdateParameters', 'CertificateInformation', + 'ClientSecretContract', 'ConnectivityStatusContract', 'DeployConfigurationParameters', 'DiagnosticContract', @@ -472,6 +477,9 @@ 'IssueUpdateContract', 'LoggerContract', 'LoggerUpdateContract', + 'NamedValueContract', + 'NamedValueEntityBaseParameters', + 'NamedValueUpdateParameters', 'NetworkStatusContract', 'NetworkStatusContractByLocation', 'NotificationContract', @@ -500,9 +508,6 @@ 'ProductEntityBaseParameters', 'ProductTagResourceContractProperties', 'ProductUpdateParameters', - 'PropertyContract', - 'PropertyEntityBaseParameters', - 'PropertyUpdateParameters', 'QuotaCounterCollection', 'QuotaCounterContract', 'QuotaCounterValueContract', @@ -530,6 +535,7 @@ 'SubscriptionContract', 'SubscriptionCreateParameters', 'SubscriptionKeyParameterNamesContract', + 'SubscriptionKeysContract', 'SubscriptionsDelegationSettingsProperties', 'SubscriptionUpdateParameters', 'TagContract', @@ -579,7 +585,7 @@ 'NotificationContractPaged', 'OpenidConnectProviderContractPaged', 'SubscriptionContractPaged', - 'PropertyContractPaged', + 'NamedValueContractPaged', 'RegionContractPaged', 'ReportRecordContractPaged', 'RequestReportRecordContractPaged', diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models.py index 0c251a092f3c..6cf740703048 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models.py @@ -18,9 +18,12 @@ class AccessInformationContract(Model): :param id: Identifier. :type id: str - :param primary_key: Primary access key. + :param primary_key: Primary access key. This property will not be filled + on 'GET' operations! Use '/listSecrets' POST request to get the value. :type primary_key: str - :param secondary_key: Secondary access key. + :param secondary_key: Secondary access key. This property will not be + filled on 'GET' operations! Use '/listSecrets' POST request to get the + value. :type secondary_key: str :param enabled: Determines whether direct access is enabled. :type enabled: bool @@ -2090,7 +2093,8 @@ class AuthorizationServerContract(Resource): :type bearer_token_sending_methods: list[str or ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] :param client_secret: Client or app secret registered with this - authorization server. + authorization server. This property will not be filled on 'GET' + operations! Use '/listSecrets' POST request to get the value. :type client_secret: str :param resource_owner_username: Can be optionally specified when resource owner password grant type is supported by this authorization server. @@ -2209,7 +2213,8 @@ class AuthorizationServerContractBaseProperties(Model): :type bearer_token_sending_methods: list[str or ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] :param client_secret: Client or app secret registered with this - authorization server. + authorization server. This property will not be filled on 'GET' + operations! Use '/listSecrets' POST request to get the value. :type client_secret: str :param resource_owner_username: Can be optionally specified when resource owner password grant type is supported by this authorization server. @@ -2298,7 +2303,8 @@ class AuthorizationServerUpdateContract(Resource): :type bearer_token_sending_methods: list[str or ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] :param client_secret: Client or app secret registered with this - authorization server. + authorization server. This property will not be filled on 'GET' + operations! Use '/listSecrets' POST request to get the value. :type client_secret: str :param resource_owner_username: Can be optionally specified when resource owner password grant type is supported by this authorization server. @@ -3018,6 +3024,23 @@ def __init__(self, **kwargs): self.subject = kwargs.get('subject', None) +class ClientSecretContract(Model): + """Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + + :param client_secret: Client or app secret used in IdentityProviders, Aad, + OpenID or OAuth. + :type client_secret: str + """ + + _attribute_map = { + 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ClientSecretContract, self).__init__(**kwargs) + self.client_secret = kwargs.get('client_secret', None) + + class CloudError(Model): """CloudError. """ @@ -3775,10 +3798,11 @@ class IdentityProviderContract(Resource): Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft. :type client_id: str - :param client_secret: Required. Client secret of the Application in - external Identity Provider, used to authenticate login request. For - example, it is App Secret for Facebook login, API Key for Google login, - Public Key for Microsoft. + :param client_secret: Client secret of the Application in external + Identity Provider, used to authenticate login request. For example, it is + App Secret for Facebook login, API Key for Google login, Public Key for + Microsoft. This property will not be filled on 'GET' operations! Use + '/listSecrets' POST request to get the value. :type client_secret: str """ @@ -3792,7 +3816,7 @@ class IdentityProviderContract(Resource): 'profile_editing_policy_name': {'min_length': 1}, 'password_reset_policy_name': {'min_length': 1}, 'client_id': {'required': True, 'min_length': 1}, - 'client_secret': {'required': True, 'min_length': 1}, + 'client_secret': {'min_length': 1}, } _attribute_map = { @@ -4212,6 +4236,125 @@ def __init__(self, **kwargs): self.is_buffered = kwargs.get('is_buffered', None) +class NamedValueContract(Resource): + """NamedValue details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type for API Management resource. + :vartype type: str + :param tags: Optional tags that when provided can be used to filter the + NamedValue list. + :type tags: list[str] + :param secret: Determines whether the value is a secret and should be + encrypted or not. Default value is false. + :type secret: bool + :param display_name: Required. Unique name of NamedValue. It may contain + only letters, digits, period, dash, and underscore characters. + :type display_name: str + :param value: Required. Value of the NamedValue. Can contain policy + expressions. It may not be empty or consist only of whitespace. + :type value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'max_items': 32}, + 'display_name': {'required': True, 'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, + 'value': {'required': True, 'max_length': 4096, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'properties.tags', 'type': '[str]'}, + 'secret': {'key': 'properties.secret', 'type': 'bool'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NamedValueContract, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.secret = kwargs.get('secret', None) + self.display_name = kwargs.get('display_name', None) + self.value = kwargs.get('value', None) + + +class NamedValueEntityBaseParameters(Model): + """NamedValue Entity Base Parameters set. + + :param tags: Optional tags that when provided can be used to filter the + NamedValue list. + :type tags: list[str] + :param secret: Determines whether the value is a secret and should be + encrypted or not. Default value is false. + :type secret: bool + """ + + _validation = { + 'tags': {'max_items': 32}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '[str]'}, + 'secret': {'key': 'secret', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(NamedValueEntityBaseParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.secret = kwargs.get('secret', None) + + +class NamedValueUpdateParameters(Model): + """NamedValue update Parameters. + + :param tags: Optional tags that when provided can be used to filter the + NamedValue list. + :type tags: list[str] + :param secret: Determines whether the value is a secret and should be + encrypted or not. Default value is false. + :type secret: bool + :param display_name: Unique name of NamedValue. It may contain only + letters, digits, period, dash, and underscore characters. + :type display_name: str + :param value: Value of the NamedValue. Can contain policy expressions. It + may not be empty or consist only of whitespace. + :type value: str + """ + + _validation = { + 'tags': {'max_items': 32}, + 'display_name': {'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, + 'value': {'max_length': 4096, 'min_length': 1}, + } + + _attribute_map = { + 'tags': {'key': 'properties.tags', 'type': '[str]'}, + 'secret': {'key': 'properties.secret', 'type': 'bool'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NamedValueUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.secret = kwargs.get('secret', None) + self.display_name = kwargs.get('display_name', None) + self.value = kwargs.get('value', None) + + class NetworkStatusContract(Model): """Network Status details. @@ -5380,125 +5523,6 @@ def __init__(self, **kwargs): self.display_name = kwargs.get('display_name', None) -class PropertyContract(Resource): - """Property details. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type for API Management resource. - :vartype type: str - :param tags: Optional tags that when provided can be used to filter the - property list. - :type tags: list[str] - :param secret: Determines whether the value is a secret and should be - encrypted or not. Default value is false. - :type secret: bool - :param display_name: Required. Unique name of Property. It may contain - only letters, digits, period, dash, and underscore characters. - :type display_name: str - :param value: Required. Value of the property. Can contain policy - expressions. It may not be empty or consist only of whitespace. - :type value: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'max_items': 32}, - 'display_name': {'required': True, 'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, - 'value': {'required': True, 'max_length': 4096, 'min_length': 1}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'properties.tags', 'type': '[str]'}, - 'secret': {'key': 'properties.secret', 'type': 'bool'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'value': {'key': 'properties.value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PropertyContract, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.secret = kwargs.get('secret', None) - self.display_name = kwargs.get('display_name', None) - self.value = kwargs.get('value', None) - - -class PropertyEntityBaseParameters(Model): - """Property Entity Base Parameters set. - - :param tags: Optional tags that when provided can be used to filter the - property list. - :type tags: list[str] - :param secret: Determines whether the value is a secret and should be - encrypted or not. Default value is false. - :type secret: bool - """ - - _validation = { - 'tags': {'max_items': 32}, - } - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '[str]'}, - 'secret': {'key': 'secret', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(PropertyEntityBaseParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.secret = kwargs.get('secret', None) - - -class PropertyUpdateParameters(Model): - """Property update Parameters. - - :param tags: Optional tags that when provided can be used to filter the - property list. - :type tags: list[str] - :param secret: Determines whether the value is a secret and should be - encrypted or not. Default value is false. - :type secret: bool - :param display_name: Unique name of Property. It may contain only letters, - digits, period, dash, and underscore characters. - :type display_name: str - :param value: Value of the property. Can contain policy expressions. It - may not be empty or consist only of whitespace. - :type value: str - """ - - _validation = { - 'tags': {'max_items': 32}, - 'display_name': {'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, - 'value': {'max_length': 4096, 'min_length': 1}, - } - - _attribute_map = { - 'tags': {'key': 'properties.tags', 'type': '[str]'}, - 'secret': {'key': 'properties.secret', 'type': 'bool'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'value': {'key': 'properties.value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PropertyUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.secret = kwargs.get('secret', None) - self.display_name = kwargs.get('display_name', None) - self.value = kwargs.get('value', None) - - class QuotaCounterCollection(Model): """Paged Quota Counter list representation. @@ -6438,9 +6462,13 @@ class SubscriptionContract(Resource): date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. :type notification_date: datetime - :param primary_key: Required. Subscription primary key. + :param primary_key: Subscription primary key. This property will not be + filled on 'GET' operations! Use '/listSecrets' POST request to get the + value. :type primary_key: str - :param secondary_key: Required. Subscription secondary key. + :param secondary_key: Subscription secondary key. This property will not + be filled on 'GET' operations! Use '/listSecrets' POST request to get the + value. :type secondary_key: str :param state_comment: Optional subscription comment added by an administrator. @@ -6457,8 +6485,8 @@ class SubscriptionContract(Resource): 'display_name': {'max_length': 100, 'min_length': 0}, 'state': {'required': True}, 'created_date': {'readonly': True}, - 'primary_key': {'required': True, 'max_length': 256, 'min_length': 1}, - 'secondary_key': {'required': True, 'max_length': 256, 'min_length': 1}, + 'primary_key': {'max_length': 256, 'min_length': 1}, + 'secondary_key': {'max_length': 256, 'min_length': 1}, } _attribute_map = { @@ -6579,6 +6607,31 @@ def __init__(self, **kwargs): self.query = kwargs.get('query', None) +class SubscriptionKeysContract(Model): + """Subscription keys. + + :param primary_key: Subscription primary key. + :type primary_key: str + :param secondary_key: Subscription secondary key. + :type secondary_key: str + """ + + _validation = { + 'primary_key': {'max_length': 256, 'min_length': 1}, + 'secondary_key': {'max_length': 256, 'min_length': 1}, + } + + _attribute_map = { + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubscriptionKeysContract, self).__init__(**kwargs) + self.primary_key = kwargs.get('primary_key', None) + self.secondary_key = kwargs.get('secondary_key', None) + + class SubscriptionsDelegationSettingsProperties(Model): """Subscriptions delegation settings properties. diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py index 6f3452345097..2bb8972a4029 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py @@ -18,9 +18,12 @@ class AccessInformationContract(Model): :param id: Identifier. :type id: str - :param primary_key: Primary access key. + :param primary_key: Primary access key. This property will not be filled + on 'GET' operations! Use '/listSecrets' POST request to get the value. :type primary_key: str - :param secondary_key: Secondary access key. + :param secondary_key: Secondary access key. This property will not be + filled on 'GET' operations! Use '/listSecrets' POST request to get the + value. :type secondary_key: str :param enabled: Determines whether direct access is enabled. :type enabled: bool @@ -2090,7 +2093,8 @@ class AuthorizationServerContract(Resource): :type bearer_token_sending_methods: list[str or ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] :param client_secret: Client or app secret registered with this - authorization server. + authorization server. This property will not be filled on 'GET' + operations! Use '/listSecrets' POST request to get the value. :type client_secret: str :param resource_owner_username: Can be optionally specified when resource owner password grant type is supported by this authorization server. @@ -2209,7 +2213,8 @@ class AuthorizationServerContractBaseProperties(Model): :type bearer_token_sending_methods: list[str or ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] :param client_secret: Client or app secret registered with this - authorization server. + authorization server. This property will not be filled on 'GET' + operations! Use '/listSecrets' POST request to get the value. :type client_secret: str :param resource_owner_username: Can be optionally specified when resource owner password grant type is supported by this authorization server. @@ -2298,7 +2303,8 @@ class AuthorizationServerUpdateContract(Resource): :type bearer_token_sending_methods: list[str or ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] :param client_secret: Client or app secret registered with this - authorization server. + authorization server. This property will not be filled on 'GET' + operations! Use '/listSecrets' POST request to get the value. :type client_secret: str :param resource_owner_username: Can be optionally specified when resource owner password grant type is supported by this authorization server. @@ -3018,6 +3024,23 @@ def __init__(self, *, expiry, thumbprint: str, subject: str, **kwargs) -> None: self.subject = subject +class ClientSecretContract(Model): + """Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + + :param client_secret: Client or app secret used in IdentityProviders, Aad, + OpenID or OAuth. + :type client_secret: str + """ + + _attribute_map = { + 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + } + + def __init__(self, *, client_secret: str=None, **kwargs) -> None: + super(ClientSecretContract, self).__init__(**kwargs) + self.client_secret = client_secret + + class CloudError(Model): """CloudError. """ @@ -3775,10 +3798,11 @@ class IdentityProviderContract(Resource): Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft. :type client_id: str - :param client_secret: Required. Client secret of the Application in - external Identity Provider, used to authenticate login request. For - example, it is App Secret for Facebook login, API Key for Google login, - Public Key for Microsoft. + :param client_secret: Client secret of the Application in external + Identity Provider, used to authenticate login request. For example, it is + App Secret for Facebook login, API Key for Google login, Public Key for + Microsoft. This property will not be filled on 'GET' operations! Use + '/listSecrets' POST request to get the value. :type client_secret: str """ @@ -3792,7 +3816,7 @@ class IdentityProviderContract(Resource): 'profile_editing_policy_name': {'min_length': 1}, 'password_reset_policy_name': {'min_length': 1}, 'client_id': {'required': True, 'min_length': 1}, - 'client_secret': {'required': True, 'min_length': 1}, + 'client_secret': {'min_length': 1}, } _attribute_map = { @@ -3811,7 +3835,7 @@ class IdentityProviderContract(Resource): 'client_secret': {'key': 'properties.clientSecret', 'type': 'str'}, } - def __init__(self, *, client_id: str, client_secret: str, identity_provider_contract_type=None, signin_tenant: str=None, allowed_tenants=None, authority: str=None, signup_policy_name: str=None, signin_policy_name: str=None, profile_editing_policy_name: str=None, password_reset_policy_name: str=None, **kwargs) -> None: + def __init__(self, *, client_id: str, identity_provider_contract_type=None, signin_tenant: str=None, allowed_tenants=None, authority: str=None, signup_policy_name: str=None, signin_policy_name: str=None, profile_editing_policy_name: str=None, password_reset_policy_name: str=None, client_secret: str=None, **kwargs) -> None: super(IdentityProviderContract, self).__init__(**kwargs) self.identity_provider_contract_type = identity_provider_contract_type self.signin_tenant = signin_tenant @@ -4212,6 +4236,125 @@ def __init__(self, *, logger_type=None, description: str=None, credentials=None, self.is_buffered = is_buffered +class NamedValueContract(Resource): + """NamedValue details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type for API Management resource. + :vartype type: str + :param tags: Optional tags that when provided can be used to filter the + NamedValue list. + :type tags: list[str] + :param secret: Determines whether the value is a secret and should be + encrypted or not. Default value is false. + :type secret: bool + :param display_name: Required. Unique name of NamedValue. It may contain + only letters, digits, period, dash, and underscore characters. + :type display_name: str + :param value: Required. Value of the NamedValue. Can contain policy + expressions. It may not be empty or consist only of whitespace. + :type value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'tags': {'max_items': 32}, + 'display_name': {'required': True, 'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, + 'value': {'required': True, 'max_length': 4096, 'min_length': 1}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'properties.tags', 'type': '[str]'}, + 'secret': {'key': 'properties.secret', 'type': 'bool'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + } + + def __init__(self, *, display_name: str, value: str, tags=None, secret: bool=None, **kwargs) -> None: + super(NamedValueContract, self).__init__(**kwargs) + self.tags = tags + self.secret = secret + self.display_name = display_name + self.value = value + + +class NamedValueEntityBaseParameters(Model): + """NamedValue Entity Base Parameters set. + + :param tags: Optional tags that when provided can be used to filter the + NamedValue list. + :type tags: list[str] + :param secret: Determines whether the value is a secret and should be + encrypted or not. Default value is false. + :type secret: bool + """ + + _validation = { + 'tags': {'max_items': 32}, + } + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '[str]'}, + 'secret': {'key': 'secret', 'type': 'bool'}, + } + + def __init__(self, *, tags=None, secret: bool=None, **kwargs) -> None: + super(NamedValueEntityBaseParameters, self).__init__(**kwargs) + self.tags = tags + self.secret = secret + + +class NamedValueUpdateParameters(Model): + """NamedValue update Parameters. + + :param tags: Optional tags that when provided can be used to filter the + NamedValue list. + :type tags: list[str] + :param secret: Determines whether the value is a secret and should be + encrypted or not. Default value is false. + :type secret: bool + :param display_name: Unique name of NamedValue. It may contain only + letters, digits, period, dash, and underscore characters. + :type display_name: str + :param value: Value of the NamedValue. Can contain policy expressions. It + may not be empty or consist only of whitespace. + :type value: str + """ + + _validation = { + 'tags': {'max_items': 32}, + 'display_name': {'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, + 'value': {'max_length': 4096, 'min_length': 1}, + } + + _attribute_map = { + 'tags': {'key': 'properties.tags', 'type': '[str]'}, + 'secret': {'key': 'properties.secret', 'type': 'bool'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'value': {'key': 'properties.value', 'type': 'str'}, + } + + def __init__(self, *, tags=None, secret: bool=None, display_name: str=None, value: str=None, **kwargs) -> None: + super(NamedValueUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.secret = secret + self.display_name = display_name + self.value = value + + class NetworkStatusContract(Model): """Network Status details. @@ -5380,125 +5523,6 @@ def __init__(self, *, description: str=None, terms: str=None, subscription_requi self.display_name = display_name -class PropertyContract(Resource): - """Property details. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type for API Management resource. - :vartype type: str - :param tags: Optional tags that when provided can be used to filter the - property list. - :type tags: list[str] - :param secret: Determines whether the value is a secret and should be - encrypted or not. Default value is false. - :type secret: bool - :param display_name: Required. Unique name of Property. It may contain - only letters, digits, period, dash, and underscore characters. - :type display_name: str - :param value: Required. Value of the property. Can contain policy - expressions. It may not be empty or consist only of whitespace. - :type value: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tags': {'max_items': 32}, - 'display_name': {'required': True, 'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, - 'value': {'required': True, 'max_length': 4096, 'min_length': 1}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'properties.tags', 'type': '[str]'}, - 'secret': {'key': 'properties.secret', 'type': 'bool'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'value': {'key': 'properties.value', 'type': 'str'}, - } - - def __init__(self, *, display_name: str, value: str, tags=None, secret: bool=None, **kwargs) -> None: - super(PropertyContract, self).__init__(**kwargs) - self.tags = tags - self.secret = secret - self.display_name = display_name - self.value = value - - -class PropertyEntityBaseParameters(Model): - """Property Entity Base Parameters set. - - :param tags: Optional tags that when provided can be used to filter the - property list. - :type tags: list[str] - :param secret: Determines whether the value is a secret and should be - encrypted or not. Default value is false. - :type secret: bool - """ - - _validation = { - 'tags': {'max_items': 32}, - } - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '[str]'}, - 'secret': {'key': 'secret', 'type': 'bool'}, - } - - def __init__(self, *, tags=None, secret: bool=None, **kwargs) -> None: - super(PropertyEntityBaseParameters, self).__init__(**kwargs) - self.tags = tags - self.secret = secret - - -class PropertyUpdateParameters(Model): - """Property update Parameters. - - :param tags: Optional tags that when provided can be used to filter the - property list. - :type tags: list[str] - :param secret: Determines whether the value is a secret and should be - encrypted or not. Default value is false. - :type secret: bool - :param display_name: Unique name of Property. It may contain only letters, - digits, period, dash, and underscore characters. - :type display_name: str - :param value: Value of the property. Can contain policy expressions. It - may not be empty or consist only of whitespace. - :type value: str - """ - - _validation = { - 'tags': {'max_items': 32}, - 'display_name': {'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, - 'value': {'max_length': 4096, 'min_length': 1}, - } - - _attribute_map = { - 'tags': {'key': 'properties.tags', 'type': '[str]'}, - 'secret': {'key': 'properties.secret', 'type': 'bool'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'value': {'key': 'properties.value', 'type': 'str'}, - } - - def __init__(self, *, tags=None, secret: bool=None, display_name: str=None, value: str=None, **kwargs) -> None: - super(PropertyUpdateParameters, self).__init__(**kwargs) - self.tags = tags - self.secret = secret - self.display_name = display_name - self.value = value - - class QuotaCounterCollection(Model): """Paged Quota Counter list representation. @@ -6438,9 +6462,13 @@ class SubscriptionContract(Resource): date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. :type notification_date: datetime - :param primary_key: Required. Subscription primary key. + :param primary_key: Subscription primary key. This property will not be + filled on 'GET' operations! Use '/listSecrets' POST request to get the + value. :type primary_key: str - :param secondary_key: Required. Subscription secondary key. + :param secondary_key: Subscription secondary key. This property will not + be filled on 'GET' operations! Use '/listSecrets' POST request to get the + value. :type secondary_key: str :param state_comment: Optional subscription comment added by an administrator. @@ -6457,8 +6485,8 @@ class SubscriptionContract(Resource): 'display_name': {'max_length': 100, 'min_length': 0}, 'state': {'required': True}, 'created_date': {'readonly': True}, - 'primary_key': {'required': True, 'max_length': 256, 'min_length': 1}, - 'secondary_key': {'required': True, 'max_length': 256, 'min_length': 1}, + 'primary_key': {'max_length': 256, 'min_length': 1}, + 'secondary_key': {'max_length': 256, 'min_length': 1}, } _attribute_map = { @@ -6480,7 +6508,7 @@ class SubscriptionContract(Resource): 'allow_tracing': {'key': 'properties.allowTracing', 'type': 'bool'}, } - def __init__(self, *, scope: str, state, primary_key: str, secondary_key: str, owner_id: str=None, display_name: str=None, start_date=None, expiration_date=None, end_date=None, notification_date=None, state_comment: str=None, allow_tracing: bool=None, **kwargs) -> None: + def __init__(self, *, scope: str, state, owner_id: str=None, display_name: str=None, start_date=None, expiration_date=None, end_date=None, notification_date=None, primary_key: str=None, secondary_key: str=None, state_comment: str=None, allow_tracing: bool=None, **kwargs) -> None: super(SubscriptionContract, self).__init__(**kwargs) self.owner_id = owner_id self.scope = scope @@ -6579,6 +6607,31 @@ def __init__(self, *, header: str=None, query: str=None, **kwargs) -> None: self.query = query +class SubscriptionKeysContract(Model): + """Subscription keys. + + :param primary_key: Subscription primary key. + :type primary_key: str + :param secondary_key: Subscription secondary key. + :type secondary_key: str + """ + + _validation = { + 'primary_key': {'max_length': 256, 'min_length': 1}, + 'secondary_key': {'max_length': 256, 'min_length': 1}, + } + + _attribute_map = { + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + } + + def __init__(self, *, primary_key: str=None, secondary_key: str=None, **kwargs) -> None: + super(SubscriptionKeysContract, self).__init__(**kwargs) + self.primary_key = primary_key + self.secondary_key = secondary_key + + class SubscriptionsDelegationSettingsProperties(Model): """Subscriptions delegation settings properties. diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_paged_models.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_paged_models.py index 00805dffaafd..49405cae5c07 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_paged_models.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_paged_models.py @@ -389,19 +389,19 @@ class SubscriptionContractPaged(Paged): def __init__(self, *args, **kwargs): super(SubscriptionContractPaged, self).__init__(*args, **kwargs) -class PropertyContractPaged(Paged): +class NamedValueContractPaged(Paged): """ - A paging container for iterating over a list of :class:`PropertyContract ` object + A paging container for iterating over a list of :class:`NamedValueContract ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[PropertyContract]'} + 'current_page': {'key': 'value', 'type': '[NamedValueContract]'} } def __init__(self, *args, **kwargs): - super(PropertyContractPaged, self).__init__(*args, **kwargs) + super(NamedValueContractPaged, self).__init__(*args, **kwargs) class RegionContractPaged(Paged): """ A paging container for iterating over a list of :class:`RegionContract ` object diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/__init__.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/__init__.py index 9f118416b588..0fd0157c6c13 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/__init__.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/__init__.py @@ -54,7 +54,7 @@ from ._product_group_operations import ProductGroupOperations from ._product_subscriptions_operations import ProductSubscriptionsOperations from ._product_policy_operations import ProductPolicyOperations -from ._property_operations import PropertyOperations +from ._named_value_operations import NamedValueOperations from ._quota_by_counter_keys_operations import QuotaByCounterKeysOperations from ._quota_by_period_keys_operations import QuotaByPeriodKeysOperations from ._region_operations import RegionOperations @@ -117,7 +117,7 @@ 'ProductGroupOperations', 'ProductSubscriptionsOperations', 'ProductPolicyOperations', - 'PropertyOperations', + 'NamedValueOperations', 'QuotaByCounterKeysOperations', 'QuotaByPeriodKeysOperations', 'RegionOperations', diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_operations.py index c66ad2c3374a..997e3c3ff1e6 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_operations.py @@ -320,11 +320,13 @@ def _create_or_update_initial( deserialized = self._deserialize('ApiContract', response) header_dict = { 'ETag': 'str', + 'Location': 'str', } if response.status_code == 201: deserialized = self._deserialize('ApiContract', response) header_dict = { 'ETag': 'str', + 'Location': 'str', } if raw: @@ -381,6 +383,7 @@ def create_or_update( def get_long_running_output(response): header_dict = { 'ETag': 'str', + 'Location': 'str', } deserialized = self._deserialize('ApiContract', response) diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_schema_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_schema_operations.py index 82e52fcc4543..bb86a72bd12e 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_schema_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_schema_operations.py @@ -348,7 +348,7 @@ def create_or_update( request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 201]: + if response.status_code not in [200, 201, 202]: raise models.ErrorResponseException(self._deserialize, response) header_dict = {} @@ -357,11 +357,13 @@ def create_or_update( deserialized = self._deserialize('SchemaContract', response) header_dict = { 'ETag': 'str', + 'Location': 'str', } if response.status_code == 201: deserialized = self._deserialize('SchemaContract', response) header_dict = { 'ETag': 'str', + 'Location': 'str', } if raw: diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_authorization_server_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_authorization_server_operations.py index 5bec1af67ae2..3d55be13d4e5 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_authorization_server_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_authorization_server_operations.py @@ -468,3 +468,66 @@ def delete( client_raw_response = ClientRawResponse(None, response) return client_raw_response delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'} + + def list_secrets( + self, resource_group_name, service_name, authsid, custom_headers=None, raw=False, **operation_config): + """Gets the client secret details of the authorization server. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param authsid: Identifier of the authorization server. + :type authsid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ClientSecretContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ClientSecretContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_secrets.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'authsid': self._serialize.url("authsid", authsid, 'str', max_length=80, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ClientSecretContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}/listSecrets'} diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_identity_provider_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_identity_provider_operations.py index f05b40b81e4d..ac720b7fa990 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_identity_provider_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_identity_provider_operations.py @@ -464,3 +464,69 @@ def delete( client_raw_response = ClientRawResponse(None, response) return client_raw_response delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'} + + def list_secrets( + self, resource_group_name, service_name, identity_provider_name, custom_headers=None, raw=False, **operation_config): + """Gets the client secret details of the Identity Provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param identity_provider_name: Identity Provider Type identifier. + Possible values include: 'facebook', 'google', 'microsoft', 'twitter', + 'aad', 'aadB2C' + :type identity_provider_name: str or + ~azure.mgmt.apimanagement.models.IdentityProviderType + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ClientSecretContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ClientSecretContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_secrets.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'identityProviderName': self._serialize.url("identity_provider_name", identity_provider_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ClientSecretContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}/listSecrets'} diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_property_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_named_value_operations.py similarity index 83% rename from sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_property_operations.py rename to sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_named_value_operations.py index e4e83493ef53..279a5320d0eb 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_property_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_named_value_operations.py @@ -15,8 +15,8 @@ from .. import models -class PropertyOperations(object): - """PropertyOperations operations. +class NamedValueOperations(object): + """NamedValueOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -40,7 +40,7 @@ def __init__(self, client, config, serializer, deserializer): def list_by_service( self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): - """Lists a collection of properties defined within a service instance. + """Lists a collection of NamedValues defined within a service instance. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -62,9 +62,9 @@ def list_by_service( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of PropertyContract + :return: An iterator like instance of NamedValueContract :rtype: - ~azure.mgmt.apimanagement.models.PropertyContractPaged[~azure.mgmt.apimanagement.models.PropertyContract] + ~azure.mgmt.apimanagement.models.NamedValueContractPaged[~azure.mgmt.apimanagement.models.NamedValueContract] :raises: :class:`ErrorResponseException` """ @@ -121,22 +121,22 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.PropertyContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.NamedValueContractPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties'} + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues'} def get_entity_tag( - self, resource_group_name, service_name, prop_id, custom_headers=None, raw=False, **operation_config): - """Gets the entity state (Etag) version of the property specified by its + self, resource_group_name, service_name, named_value_id, custom_headers=None, raw=False, **operation_config): + """Gets the entity state (Etag) version of the NamedValue specified by its identifier. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param prop_id: Identifier of the property. - :type prop_id: str + :param named_value_id: Identifier of the NamedValue. + :type named_value_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -152,7 +152,7 @@ def get_entity_tag( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), - 'propId': self._serialize.url("prop_id", prop_id, 'str', max_length=256, pattern=r'^[^*#&+:<>?]+$'), + 'namedValueId': self._serialize.url("named_value_id", named_value_id, 'str', max_length=256, pattern=r'^[^*#&+:<>?]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -183,25 +183,25 @@ def get_entity_tag( 'ETag': 'str', }) return client_raw_response - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}'} + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} def get( - self, resource_group_name, service_name, prop_id, custom_headers=None, raw=False, **operation_config): - """Gets the details of the property specified by its identifier. + self, resource_group_name, service_name, named_value_id, custom_headers=None, raw=False, **operation_config): + """Gets the details of the NamedValue specified by its identifier. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param prop_id: Identifier of the property. - :type prop_id: str + :param named_value_id: Identifier of the NamedValue. + :type named_value_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: PropertyContract or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.apimanagement.models.PropertyContract or + :return: NamedValueContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.NamedValueContract or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -211,7 +211,7 @@ def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), - 'propId': self._serialize.url("prop_id", prop_id, 'str', max_length=256, pattern=r'^[^*#&+:<>?]+$'), + 'namedValueId': self._serialize.url("named_value_id", named_value_id, 'str', max_length=256, pattern=r'^[^*#&+:<>?]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -240,7 +240,7 @@ def get( header_dict = {} deserialized = None if response.status_code == 200: - deserialized = self._deserialize('PropertyContract', response) + deserialized = self._deserialize('NamedValueContract', response) header_dict = { 'ETag': 'str', } @@ -251,20 +251,20 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} def create_or_update( - self, resource_group_name, service_name, prop_id, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): - """Creates or updates a property. + self, resource_group_name, service_name, named_value_id, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates a NamedValue. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param prop_id: Identifier of the property. - :type prop_id: str + :param named_value_id: Identifier of the NamedValue. + :type named_value_id: str :param parameters: Create parameters. - :type parameters: ~azure.mgmt.apimanagement.models.PropertyContract + :type parameters: ~azure.mgmt.apimanagement.models.NamedValueContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when updating an entity. :type if_match: str @@ -273,8 +273,8 @@ def create_or_update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: PropertyContract or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.apimanagement.models.PropertyContract or + :return: NamedValueContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.NamedValueContract or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -284,7 +284,7 @@ def create_or_update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), - 'propId': self._serialize.url("prop_id", prop_id, 'str', max_length=256, pattern=r'^[^*#&+:<>?]+$'), + 'namedValueId': self._serialize.url("named_value_id", named_value_id, 'str', max_length=256, pattern=r'^[^*#&+:<>?]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -307,26 +307,28 @@ def create_or_update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'PropertyContract') + body_content = self._serialize.body(parameters, 'NamedValueContract') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 201]: + if response.status_code not in [200, 201, 202]: raise models.ErrorResponseException(self._deserialize, response) header_dict = {} deserialized = None if response.status_code == 200: - deserialized = self._deserialize('PropertyContract', response) + deserialized = self._deserialize('NamedValueContract', response) header_dict = { 'ETag': 'str', + 'Location': 'str', } if response.status_code == 201: - deserialized = self._deserialize('PropertyContract', response) + deserialized = self._deserialize('NamedValueContract', response) header_dict = { 'ETag': 'str', + 'Location': 'str', } if raw: @@ -335,21 +337,21 @@ def create_or_update( return client_raw_response return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} def update( - self, resource_group_name, service_name, prop_id, parameters, if_match, custom_headers=None, raw=False, **operation_config): - """Updates the specific property. + self, resource_group_name, service_name, named_value_id, parameters, if_match, custom_headers=None, raw=False, **operation_config): + """Updates the specific NamedValue. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param prop_id: Identifier of the property. - :type prop_id: str + :param named_value_id: Identifier of the NamedValue. + :type named_value_id: str :param parameters: Update parameters. :type parameters: - ~azure.mgmt.apimanagement.models.PropertyUpdateParameters + ~azure.mgmt.apimanagement.models.NamedValueUpdateParameters :param if_match: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update. @@ -369,7 +371,7 @@ def update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), - 'propId': self._serialize.url("prop_id", prop_id, 'str', max_length=256, pattern=r'^[^*#&+:<>?]+$'), + 'namedValueId': self._serialize.url("named_value_id", named_value_id, 'str', max_length=256, pattern=r'^[^*#&+:<>?]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -390,30 +392,33 @@ def update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'PropertyUpdateParameters') + body_content = self._serialize.body(parameters, 'NamedValueUpdateParameters') # Construct and send request request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [202, 204]: raise models.ErrorResponseException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'Location': 'str', + }) return client_raw_response - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} def delete( - self, resource_group_name, service_name, prop_id, if_match, custom_headers=None, raw=False, **operation_config): - """Deletes specific property from the API Management service instance. + self, resource_group_name, service_name, named_value_id, if_match, custom_headers=None, raw=False, **operation_config): + """Deletes specific NamedValue from the API Management service instance. :param resource_group_name: The name of the resource group. :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param prop_id: Identifier of the property. - :type prop_id: str + :param named_value_id: Identifier of the NamedValue. + :type named_value_id: str :param if_match: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update. @@ -433,7 +438,7 @@ def delete( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), - 'propId': self._serialize.url("prop_id", prop_id, 'str', max_length=256, pattern=r'^[^*#&+:<>?]+$'), + 'namedValueId': self._serialize.url("named_value_id", named_value_id, 'str', max_length=256, pattern=r'^[^*#&+:<>?]+$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -462,4 +467,4 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_open_id_connect_provider_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_open_id_connect_provider_operations.py index 60e6dddf8a10..fb19e6bc1265 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_open_id_connect_provider_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_open_id_connect_provider_operations.py @@ -467,3 +467,66 @@ def delete( client_raw_response = ClientRawResponse(None, response) return client_raw_response delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'} + + def list_secrets( + self, resource_group_name, service_name, opid, custom_headers=None, raw=False, **operation_config): + """Gets the client secret details of the OpenID Connect Provider. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param opid: Identifier of the OpenID Connect Provider. + :type opid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ClientSecretContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ClientSecretContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_secrets.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'opid': self._serialize.url("opid", opid, 'str', max_length=256, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ClientSecretContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}/listSecrets'} diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_subscription_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_subscription_operations.py index 62fc2d3efcc7..5ae50ec42958 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_subscription_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_subscription_operations.py @@ -607,3 +607,67 @@ def regenerate_secondary_key( client_raw_response = ClientRawResponse(None, response) return client_raw_response regenerate_secondary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regenerateSecondaryKey'} + + def list_secrets( + self, resource_group_name, service_name, sid, custom_headers=None, raw=False, **operation_config): + """Gets the subscription keys. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param sid: Subscription entity Identifier. The entity represents the + association between a user and a product in API Management. + :type sid: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SubscriptionKeysContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.SubscriptionKeysContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_secrets.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'sid': self._serialize.url("sid", sid, 'str', max_length=256, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SubscriptionKeysContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/listSecrets'} diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_access_git_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_access_git_operations.py index 932ae98470f4..ce25ff051276 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_access_git_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_access_git_operations.py @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer): def get( self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): - """Gets the Git access configuration for the tenant. + """Gets the Git access configuration for the tenant. Without secrets. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -211,3 +211,69 @@ def regenerate_secondary_key( client_raw_response = ClientRawResponse(None, response) return client_raw_response regenerate_secondary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regenerateSecondaryKey'} + + def list_secrets( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Gets the Git access configuration for the tenant. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessInformationContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_secrets.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'accessName': self._serialize.url("self.access_name", self.access_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessInformationContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/listSecrets'} diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_access_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_access_operations.py index ae65d1f5d3cb..7cfc4f837433 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_access_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_access_operations.py @@ -98,7 +98,7 @@ def get_entity_tag( def get( self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): - """Get tenant access information details. + """Get tenant access information details without secrets. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -333,3 +333,69 @@ def regenerate_secondary_key( client_raw_response = ClientRawResponse(None, response) return client_raw_response regenerate_secondary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regenerateSecondaryKey'} + + def list_secrets( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Get tenant access information details. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessInformationContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_secrets.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'accessName': self._serialize.url("self.access_name", self.access_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessInformationContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/listSecrets'} diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/setup.py b/sdk/apimanagement/azure-mgmt-apimanagement/setup.py index 37fdad48736f..7ddc0c393bc7 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/setup.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/setup.py @@ -64,7 +64,6 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7',