<s> from msrest . pipeline import ClientRawResponse <EOL> from msrestazure . azure_exceptions import CloudError <EOL> from msrestazure . azure_operation import AzureOperationPoller <EOL> import uuid <EOL> from . . import models <EOL> class StorageAccountsOperations ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , client , config , serializer , deserializer ) : <EOL> self . _client = client <EOL> self . _serialize = serializer <EOL> self . _deserialize = deserializer <EOL> self . config = config <EOL> def check_name_availability ( <EOL> self , name , type = "<STR_LIT>" , custom_headers = { } , raw = False , ** operation_config ) : <EOL> """<STR_LIT>""" <EOL> account_name = models . StorageAccountCheckNameAvailabilityParameters ( name = name , type = type ) <EOL> url = '<STR_LIT>' <EOL> path_format_arguments = { <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , self . config . subscription_id , '<STR_LIT:str>' ) <EOL> } <EOL> url = self . _client . format_url ( url , ** path_format_arguments ) <EOL> query_parameters = { } <EOL> query_parameters [ '<STR_LIT>' ] = self . _serialize . query ( "<STR_LIT>" , self . config . api_version , '<STR_LIT:str>' ) <EOL> header_parameters = { } <EOL> header_parameters [ '<STR_LIT:Content-Type>' ] = '<STR_LIT>' <EOL> if self . config . generate_client_request_id : <EOL> header_parameters [ '<STR_LIT>' ] = str ( uuid . uuid1 ( ) ) <EOL> if custom_headers : <EOL> header_parameters . update ( custom_headers ) <EOL> if self . config . accept_language is not None : <EOL> header_parameters [ '<STR_LIT>' ] = self . _serialize . header ( "<STR_LIT>" , self . config . accept_language , '<STR_LIT:str>' ) <EOL> body_content = self . _serialize . body ( account_name , '<STR_LIT>' ) <EOL> request = self . _client . post ( url , query_parameters ) <EOL> response = self . _client . send ( <EOL> request , header_parameters , body_content , ** operation_config ) <EOL> if response . status_code not in [ <NUM_LIT:200> ] : <EOL> exp = CloudError ( response ) <EOL> exp . request_id = response . headers . get ( '<STR_LIT>' ) <EOL> raise exp <EOL> deserialized = None <EOL> if response . status_code == <NUM_LIT:200> : <EOL> deserialized = self . _deserialize ( '<STR_LIT>' , response ) <EOL> if raw : <EOL> client_raw_response = ClientRawResponse ( deserialized , response ) <EOL> return client_raw_response <EOL> return deserialized <EOL> def create ( <EOL> self , resource_group_name , account_name , parameters , custom_headers = { } , raw = False , ** operation_config ) : <EOL> """<STR_LIT>""" <EOL> url = '<STR_LIT>' <EOL> path_format_arguments = { <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , resource_group_name , '<STR_LIT:str>' ) , <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , account_name , '<STR_LIT:str>' , max_length = <NUM_LIT> , min_length = <NUM_LIT:3> ) , <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , self . config . subscription_id , '<STR_LIT:str>' ) <EOL> } <EOL> url = self . _client . format_url ( url , ** path_format_arguments ) <EOL> query_parameters = { } <EOL> query_parameters [ '<STR_LIT>' ] = self . _serialize . query ( "<STR_LIT>" , self . config . api_version , '<STR_LIT:str>' ) <EOL> header_parameters = { } <EOL> header_parameters [ '<STR_LIT:Content-Type>' ] = '<STR_LIT>' <EOL> if self . config . generate_client_request_id : <EOL> header_parameters [ '<STR_LIT>' ] = str ( uuid . uuid1 ( ) ) <EOL> if custom_headers : <EOL> header_parameters . update ( custom_headers ) <EOL> if self . config . accept_language is not None : <EOL> header_parameters [ '<STR_LIT>' ] = self . _serialize . header ( "<STR_LIT>" , self . config . accept_language , '<STR_LIT:str>' ) <EOL> body_content = self . _serialize . body ( parameters , '<STR_LIT>' ) <EOL> def long_running_send ( ) : <EOL> request = self . _client . put ( url , query_parameters ) <EOL> return self . _client . send ( <EOL> request , header_parameters , body_content , ** operation_config ) <EOL> def get_long_running_status ( status_link , headers = { } ) : <EOL> request = self . _client . get ( status_link ) <EOL> request . headers . update ( headers ) <EOL> return self . _client . send ( <EOL> request , header_parameters , ** operation_config ) <EOL> def get_long_running_output ( response ) : <EOL> if response . status_code not in [ <NUM_LIT:200> , <NUM_LIT> ] : <EOL> exp = CloudError ( response ) <EOL> exp . request_id = response . headers . get ( '<STR_LIT>' ) <EOL> raise exp <EOL> deserialized = None <EOL> if response . status_code == <NUM_LIT:200> : <EOL> deserialized = self . _deserialize ( '<STR_LIT>' , response ) <EOL> if raw : <EOL> client_raw_response = ClientRawResponse ( deserialized , response ) <EOL> return client_raw_response <EOL> return deserialized <EOL> if raw : <EOL> response = long_running_send ( ) <EOL> return get_long_running_output ( response ) <EOL> long_running_operation_timeout = operation_config . get ( <EOL> '<STR_LIT>' , <EOL> self . config . long_running_operation_timeout ) <EOL> return AzureOperationPoller ( <EOL> long_running_send , get_long_running_output , <EOL> get_long_running_status , long_running_operation_timeout ) <EOL> def delete ( <EOL> self , resource_group_name , account_name , custom_headers = { } , raw = False , ** operation_config ) : <EOL> """<STR_LIT>""" <EOL> url = '<STR_LIT>' <EOL> path_format_arguments = { <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , resource_group_name , '<STR_LIT:str>' ) , <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , account_name , '<STR_LIT:str>' , max_length = <NUM_LIT> , min_length = <NUM_LIT:3> ) , <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , self . config . subscription_id , '<STR_LIT:str>' ) <EOL> } <EOL> url = self . _client . format_url ( url , ** path_format_arguments ) <EOL> query_parameters = { } <EOL> query_parameters [ '<STR_LIT>' ] = self . _serialize . query ( "<STR_LIT>" , self . config . api_version , '<STR_LIT:str>' ) <EOL> header_parameters = { } <EOL> header_parameters [ '<STR_LIT:Content-Type>' ] = '<STR_LIT>' <EOL> if self . config . generate_client_request_id : <EOL> header_parameters [ '<STR_LIT>' ] = str ( uuid . uuid1 ( ) ) <EOL> if custom_headers : <EOL> header_parameters . update ( custom_headers ) <EOL> if self . config . accept_language is not None : <EOL> header_parameters [ '<STR_LIT>' ] = self . _serialize . header ( "<STR_LIT>" , self . config . accept_language , '<STR_LIT:str>' ) <EOL> request = self . _client . delete ( url , query_parameters ) <EOL> response = self . _client . send ( request , header_parameters , ** operation_config ) <EOL> if response . status_code not in [ <NUM_LIT:200> , <NUM_LIT> ] : <EOL> exp = CloudError ( response ) <EOL> exp . request_id = response . headers . get ( '<STR_LIT>' ) <EOL> raise exp <EOL> if raw : <EOL> client_raw_response = ClientRawResponse ( None , response ) <EOL> return client_raw_response <EOL> def get_properties ( <EOL> self , resource_group_name , account_name , custom_headers = { } , raw = False , ** operation_config ) : <EOL> """<STR_LIT>""" <EOL> url = '<STR_LIT>' <EOL> path_format_arguments = { <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , resource_group_name , '<STR_LIT:str>' ) , <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , account_name , '<STR_LIT:str>' , max_length = <NUM_LIT> , min_length = <NUM_LIT:3> ) , <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , self . config . subscription_id , '<STR_LIT:str>' ) <EOL> } <EOL> url = self . _client . format_url ( url , ** path_format_arguments ) <EOL> query_parameters = { } <EOL> query_parameters [ '<STR_LIT>' ] = self . _serialize . query ( "<STR_LIT>" , self . config . api_version , '<STR_LIT:str>' ) <EOL> header_parameters = { } <EOL> header_parameters [ '<STR_LIT:Content-Type>' ] = '<STR_LIT>' <EOL> if self . config . generate_client_request_id : <EOL> header_parameters [ '<STR_LIT>' ] = str ( uuid . uuid1 ( ) ) <EOL> if custom_headers : <EOL> header_parameters . update ( custom_headers ) <EOL> if self . config . accept_language is not None : <EOL> header_parameters [ '<STR_LIT>' ] = self . _serialize . header ( "<STR_LIT>" , self . config . accept_language , '<STR_LIT:str>' ) <EOL> request = self . _client . get ( url , query_parameters ) <EOL> response = self . _client . send ( request , header_parameters , ** operation_config ) <EOL> if response . status_code not in [ <NUM_LIT:200> ] : <EOL> exp = CloudError ( response ) <EOL> exp . request_id = response . headers . get ( '<STR_LIT>' ) <EOL> raise exp <EOL> deserialized = None <EOL> if response . status_code == <NUM_LIT:200> : <EOL> deserialized = self . _deserialize ( '<STR_LIT>' , response ) <EOL> if raw : <EOL> client_raw_response = ClientRawResponse ( deserialized , response ) <EOL> return client_raw_response <EOL> return deserialized <EOL> def update ( <EOL> self , resource_group_name , account_name , parameters , custom_headers = { } , raw = False , ** operation_config ) : <EOL> """<STR_LIT>""" <EOL> url = '<STR_LIT>' <EOL> path_format_arguments = { <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , resource_group_name , '<STR_LIT:str>' ) , <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , account_name , '<STR_LIT:str>' , max_length = <NUM_LIT> , min_length = <NUM_LIT:3> ) , <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , self . config . subscription_id , '<STR_LIT:str>' ) <EOL> } <EOL> url = self . _client . format_url ( url , ** path_format_arguments ) <EOL> query_parameters = { } <EOL> query_parameters [ '<STR_LIT>' ] = self . _serialize . query ( "<STR_LIT>" , self . config . api_version , '<STR_LIT:str>' ) <EOL> header_parameters = { } <EOL> header_parameters [ '<STR_LIT:Content-Type>' ] = '<STR_LIT>' <EOL> if self . config . generate_client_request_id : <EOL> header_parameters [ '<STR_LIT>' ] = str ( uuid . uuid1 ( ) ) <EOL> if custom_headers : <EOL> header_parameters . update ( custom_headers ) <EOL> if self . config . accept_language is not None : <EOL> header_parameters [ '<STR_LIT>' ] = self . _serialize . header ( "<STR_LIT>" , self . config . accept_language , '<STR_LIT:str>' ) <EOL> body_content = self . _serialize . body ( parameters , '<STR_LIT>' ) <EOL> request = self . _client . patch ( url , query_parameters ) <EOL> response = self . _client . send ( <EOL> request , header_parameters , body_content , ** operation_config ) <EOL> if response . status_code not in [ <NUM_LIT:200> ] : <EOL> exp = CloudError ( response ) <EOL> exp . request_id = response . headers . get ( '<STR_LIT>' ) <EOL> raise exp <EOL> deserialized = None <EOL> if response . status_code == <NUM_LIT:200> : <EOL> deserialized = self . _deserialize ( '<STR_LIT>' , response ) <EOL> if raw : <EOL> client_raw_response = ClientRawResponse ( deserialized , response ) <EOL> return client_raw_response <EOL> return deserialized <EOL> def list_keys ( <EOL> self , resource_group_name , account_name , custom_headers = { } , raw = False , ** operation_config ) : <EOL> """<STR_LIT>""" <EOL> url = '<STR_LIT>' <EOL> path_format_arguments = { <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , resource_group_name , '<STR_LIT:str>' ) , <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , account_name , '<STR_LIT:str>' , max_length = <NUM_LIT> , min_length = <NUM_LIT:3> ) , <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , self . config . subscription_id , '<STR_LIT:str>' ) <EOL> } <EOL> url = self . _client . format_url ( url , ** path_format_arguments ) <EOL> query_parameters = { } <EOL> query_parameters [ '<STR_LIT>' ] = self . _serialize . query ( "<STR_LIT>" , self . config . api_version , '<STR_LIT:str>' ) <EOL> header_parameters = { } <EOL> header_parameters [ '<STR_LIT:Content-Type>' ] = '<STR_LIT>' <EOL> if self . config . generate_client_request_id : <EOL> header_parameters [ '<STR_LIT>' ] = str ( uuid . uuid1 ( ) ) <EOL> if custom_headers : <EOL> header_parameters . update ( custom_headers ) <EOL> if self . config . accept_language is not None : <EOL> header_parameters [ '<STR_LIT>' ] = self . _serialize . header ( "<STR_LIT>" , self . config . accept_language , '<STR_LIT:str>' ) <EOL> request = self . _client . post ( url , query_parameters ) <EOL> response = self . _client . send ( request , header_parameters , ** operation_config ) <EOL> if response . status_code not in [ <NUM_LIT:200> ] : <EOL> exp = CloudError ( response ) <EOL> exp . request_id = response . headers . get ( '<STR_LIT>' ) <EOL> raise exp <EOL> deserialized = None <EOL> if response . status_code == <NUM_LIT:200> : <EOL> deserialized = self . _deserialize ( '<STR_LIT>' , response ) <EOL> if raw : <EOL> client_raw_response = ClientRawResponse ( deserialized , response ) <EOL> return client_raw_response <EOL> return deserialized <EOL> def list ( <EOL> self , custom_headers = { } , raw = False , ** operation_config ) : <EOL> """<STR_LIT>""" <EOL> def internal_paging ( next_link = None , raw = False ) : <EOL> if not next_link : <EOL> url = '<STR_LIT>' <EOL> path_format_arguments = { <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , self . config . subscription_id , '<STR_LIT:str>' ) <EOL> } <EOL> url = self . _client . format_url ( url , ** path_format_arguments ) <EOL> query_parameters = { } <EOL> query_parameters [ '<STR_LIT>' ] = self . _serialize . query ( "<STR_LIT>" , self . config . api_version , '<STR_LIT:str>' ) <EOL> else : <EOL> url = next_link <EOL> query_parameters = { } <EOL> header_parameters = { } <EOL> header_parameters [ '<STR_LIT:Content-Type>' ] = '<STR_LIT>' <EOL> if self . config . generate_client_request_id : <EOL> header_parameters [ '<STR_LIT>' ] = str ( uuid . uuid1 ( ) ) <EOL> if custom_headers : <EOL> header_parameters . update ( custom_headers ) <EOL> if self . config . accept_language is not None : <EOL> header_parameters [ '<STR_LIT>' ] = self . _serialize . header ( "<STR_LIT>" , self . config . accept_language , '<STR_LIT:str>' ) <EOL> request = self . _client . get ( url , query_parameters ) <EOL> response = self . _client . send ( <EOL> request , header_parameters , ** operation_config ) <EOL> if response . status_code not in [ <NUM_LIT:200> ] : <EOL> exp = CloudError ( response ) <EOL> exp . request_id = response . headers . get ( '<STR_LIT>' ) <EOL> raise exp <EOL> return response <EOL> deserialized = models . StorageAccountPaged ( internal_paging , self . _deserialize . dependencies ) <EOL> if raw : <EOL> header_dict = { } <EOL> client_raw_response = models . StorageAccountPaged ( internal_paging , self . _deserialize . dependencies , header_dict ) <EOL> return client_raw_response <EOL> return deserialized <EOL> def list_by_resource_group ( <EOL> self , resource_group_name , custom_headers = { } , raw = False , ** operation_config ) : <EOL> """<STR_LIT>""" <EOL> def internal_paging ( next_link = None , raw = False ) : <EOL> if not next_link : <EOL> url = '<STR_LIT>' <EOL> path_format_arguments = { <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , resource_group_name , '<STR_LIT:str>' ) , <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , self . config . subscription_id , '<STR_LIT:str>' ) <EOL> } <EOL> url = self . _client . format_url ( url , ** path_format_arguments ) <EOL> query_parameters = { } <EOL> query_parameters [ '<STR_LIT>' ] = self . _serialize . query ( "<STR_LIT>" , self . config . api_version , '<STR_LIT:str>' ) <EOL> else : <EOL> url = next_link <EOL> query_parameters = { } <EOL> header_parameters = { } <EOL> header_parameters [ '<STR_LIT:Content-Type>' ] = '<STR_LIT>' <EOL> if self . config . generate_client_request_id : <EOL> header_parameters [ '<STR_LIT>' ] = str ( uuid . uuid1 ( ) ) <EOL> if custom_headers : <EOL> header_parameters . update ( custom_headers ) <EOL> if self . config . accept_language is not None : <EOL> header_parameters [ '<STR_LIT>' ] = self . _serialize . header ( "<STR_LIT>" , self . config . accept_language , '<STR_LIT:str>' ) <EOL> request = self . _client . get ( url , query_parameters ) <EOL> response = self . _client . send ( <EOL> request , header_parameters , ** operation_config ) <EOL> if response . status_code not in [ <NUM_LIT:200> ] : <EOL> exp = CloudError ( response ) <EOL> exp . request_id = response . headers . get ( '<STR_LIT>' ) <EOL> raise exp <EOL> return response <EOL> deserialized = models . StorageAccountPaged ( internal_paging , self . _deserialize . dependencies ) <EOL> if raw : <EOL> header_dict = { } <EOL> client_raw_response = models . StorageAccountPaged ( internal_paging , self . _deserialize . dependencies , header_dict ) <EOL> return client_raw_response <EOL> return deserialized <EOL> def regenerate_key ( <EOL> self , resource_group_name , account_name , key_name , custom_headers = { } , raw = False , ** operation_config ) : <EOL> """<STR_LIT>""" <EOL> regenerate_key = models . StorageAccountRegenerateKeyParameters ( key_name = key_name ) <EOL> url = '<STR_LIT>' <EOL> path_format_arguments = { <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , resource_group_name , '<STR_LIT:str>' ) , <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , account_name , '<STR_LIT:str>' , max_length = <NUM_LIT> , min_length = <NUM_LIT:3> ) , <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , self . config . subscription_id , '<STR_LIT:str>' ) <EOL> } <EOL> url = self . _client . format_url ( url , ** path_format_arguments ) <EOL> query_parameters = { } <EOL> query_parameters [ '<STR_LIT>' ] = self . _serialize . query ( "<STR_LIT>" , self . config . api_version , '<STR_LIT:str>' ) <EOL> header_parameters = { } <EOL> header_parameters [ '<STR_LIT:Content-Type>' ] = '<STR_LIT>' <EOL> if self . config . generate_client_request_id : <EOL> header_parameters [ '<STR_LIT>' ] = str ( uuid . uuid1 ( ) ) <EOL> if custom_headers : <EOL> header_parameters . update ( custom_headers ) <EOL> if self . config . accept_language is not None : <EOL> header_parameters [ '<STR_LIT>' ] = self . _serialize . header ( "<STR_LIT>" , self . config . accept_language , '<STR_LIT:str>' ) <EOL> body_content = self . _serialize . body ( regenerate_key , '<STR_LIT>' ) <EOL> request = self . _client . post ( url , query_parameters ) <EOL> response = self . _client . send ( <EOL> request , header_parameters , body_content , ** operation_config ) <EOL> if response . status_code not in [ <NUM_LIT:200> ] : <EOL> exp = CloudError ( response ) <EOL> exp . request_id = response . headers . get ( '<STR_LIT>' ) <EOL> raise exp <EOL> deserialized = None <EOL> if response . status_code == <NUM_LIT:200> : <EOL> deserialized = self . _deserialize ( '<STR_LIT>' , response ) <EOL> if raw : <EOL> client_raw_response = ClientRawResponse ( deserialized , response ) <EOL> return client_raw_response <EOL> return deserialized </s>
