Skip to content

Commit

Permalink
[AutoPR datafactory/resource-manager] [Data Factory]Add schema mappin…
Browse files Browse the repository at this point in the history
…g for hierarchical data (#2431)

* Generated from 219315700287d09055dec44446b34f261d15d2c1

Add schema mapping for hierarchical data

* Generated from a3c2bff7ee233f1de44032b1fccc27450874c77f

Add example for column mapping

* Generated from efe8a46867a169c9cd530d4562c56c5c3dba4da8

Merge remote-tracking branch 'upstream/master'
  • Loading branch information
AutorestCI authored Jun 8, 2018
1 parent e28deb2 commit 48d13d4
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,17 @@ class QuickBooksLinkedService(LinkedService):
:param company_id: Required. The company ID of the QuickBooks company to
authorize.
:type company_id: object
:param access_token: The access token for OAuth 1.0 authentication.
:type access_token: ~azure.mgmt.datafactory.models.SecretBase
:param access_token_secret: The access token secret for OAuth 1.0
:param consumer_key: Required. The consumer key for OAuth 1.0
authentication.
:type consumer_key: object
:param consumer_secret: Required. The consumer secret for OAuth 1.0
authentication.
:type consumer_secret: ~azure.mgmt.datafactory.models.SecretBase
:param access_token: Required. The access token for OAuth 1.0
authentication.
:type access_token: ~azure.mgmt.datafactory.models.SecretBase
:param access_token_secret: Required. The access token secret for OAuth
1.0 authentication.
:type access_token_secret: ~azure.mgmt.datafactory.models.SecretBase
:param use_encrypted_endpoints: Specifies whether the data source
endpoints are encrypted using HTTPS. The default value is true.
Expand All @@ -57,6 +64,10 @@ class QuickBooksLinkedService(LinkedService):
'type': {'required': True},
'endpoint': {'required': True},
'company_id': {'required': True},
'consumer_key': {'required': True},
'consumer_secret': {'required': True},
'access_token': {'required': True},
'access_token_secret': {'required': True},
}

_attribute_map = {
Expand All @@ -68,6 +79,8 @@ class QuickBooksLinkedService(LinkedService):
'type': {'key': 'type', 'type': 'str'},
'endpoint': {'key': 'typeProperties.endpoint', 'type': 'object'},
'company_id': {'key': 'typeProperties.companyId', 'type': 'object'},
'consumer_key': {'key': 'typeProperties.consumerKey', 'type': 'object'},
'consumer_secret': {'key': 'typeProperties.consumerSecret', 'type': 'SecretBase'},
'access_token': {'key': 'typeProperties.accessToken', 'type': 'SecretBase'},
'access_token_secret': {'key': 'typeProperties.accessTokenSecret', 'type': 'SecretBase'},
'use_encrypted_endpoints': {'key': 'typeProperties.useEncryptedEndpoints', 'type': 'object'},
Expand All @@ -78,6 +91,8 @@ def __init__(self, **kwargs):
super(QuickBooksLinkedService, self).__init__(**kwargs)
self.endpoint = kwargs.get('endpoint', None)
self.company_id = kwargs.get('company_id', None)
self.consumer_key = kwargs.get('consumer_key', None)
self.consumer_secret = kwargs.get('consumer_secret', None)
self.access_token = kwargs.get('access_token', None)
self.access_token_secret = kwargs.get('access_token_secret', None)
self.use_encrypted_endpoints = kwargs.get('use_encrypted_endpoints', None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,17 @@ class QuickBooksLinkedService(LinkedService):
:param company_id: Required. The company ID of the QuickBooks company to
authorize.
:type company_id: object
:param access_token: The access token for OAuth 1.0 authentication.
:type access_token: ~azure.mgmt.datafactory.models.SecretBase
:param access_token_secret: The access token secret for OAuth 1.0
:param consumer_key: Required. The consumer key for OAuth 1.0
authentication.
:type consumer_key: object
:param consumer_secret: Required. The consumer secret for OAuth 1.0
authentication.
:type consumer_secret: ~azure.mgmt.datafactory.models.SecretBase
:param access_token: Required. The access token for OAuth 1.0
authentication.
:type access_token: ~azure.mgmt.datafactory.models.SecretBase
:param access_token_secret: Required. The access token secret for OAuth
1.0 authentication.
:type access_token_secret: ~azure.mgmt.datafactory.models.SecretBase
:param use_encrypted_endpoints: Specifies whether the data source
endpoints are encrypted using HTTPS. The default value is true.
Expand All @@ -57,6 +64,10 @@ class QuickBooksLinkedService(LinkedService):
'type': {'required': True},
'endpoint': {'required': True},
'company_id': {'required': True},
'consumer_key': {'required': True},
'consumer_secret': {'required': True},
'access_token': {'required': True},
'access_token_secret': {'required': True},
}

_attribute_map = {
Expand All @@ -68,16 +79,20 @@ class QuickBooksLinkedService(LinkedService):
'type': {'key': 'type', 'type': 'str'},
'endpoint': {'key': 'typeProperties.endpoint', 'type': 'object'},
'company_id': {'key': 'typeProperties.companyId', 'type': 'object'},
'consumer_key': {'key': 'typeProperties.consumerKey', 'type': 'object'},
'consumer_secret': {'key': 'typeProperties.consumerSecret', 'type': 'SecretBase'},
'access_token': {'key': 'typeProperties.accessToken', 'type': 'SecretBase'},
'access_token_secret': {'key': 'typeProperties.accessTokenSecret', 'type': 'SecretBase'},
'use_encrypted_endpoints': {'key': 'typeProperties.useEncryptedEndpoints', 'type': 'object'},
'encrypted_credential': {'key': 'typeProperties.encryptedCredential', 'type': 'object'},
}

def __init__(self, *, endpoint, company_id, additional_properties=None, connect_via=None, description: str=None, parameters=None, annotations=None, access_token=None, access_token_secret=None, use_encrypted_endpoints=None, encrypted_credential=None, **kwargs) -> None:
def __init__(self, *, endpoint, company_id, consumer_key, consumer_secret, access_token, access_token_secret, additional_properties=None, connect_via=None, description: str=None, parameters=None, annotations=None, use_encrypted_endpoints=None, encrypted_credential=None, **kwargs) -> None:
super(QuickBooksLinkedService, self).__init__(additional_properties=additional_properties, connect_via=connect_via, description=description, parameters=parameters, annotations=annotations, **kwargs)
self.endpoint = endpoint
self.company_id = company_id
self.consumer_key = consumer_key
self.consumer_secret = consumer_secret
self.access_token = access_token
self.access_token_secret = access_token_secret
self.use_encrypted_endpoints = use_encrypted_endpoints
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ServiceNowLinkedService(LinkedService):
:param type: Required. Constant filled by server.
:type type: str
:param endpoint: Required. The endpoint of the ServiceNow server. (i.e.
ServiceNowData.com)
<instance>.service-now.com)
:type endpoint: object
:param authentication_type: Required. The authentication type to use.
Possible values include: 'Basic', 'OAuth2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ServiceNowLinkedService(LinkedService):
:param type: Required. Constant filled by server.
:type type: str
:param endpoint: Required. The endpoint of the ServiceNow server. (i.e.
ServiceNowData.com)
<instance>.service-now.com)
:type endpoint: object
:param authentication_type: Required. The authentication type to use.
Possible values include: 'Basic', 'OAuth2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@ class TabularTranslator(CopyTranslator):
:type additional_properties: dict[str, object]
:param type: Required. Constant filled by server.
:type type: str
:param column_mappings: Column mappings. Type: string (or Expression with
resultType string).
:param column_mappings: Column mappings. Example: "UserId: MyUserId,
Group: MyGroup, Name: MyName" Type: string (or Expression with resultType
string).
:type column_mappings: object
:param schema_mapping: The schema mapping to map between tabular data and
hierarchical data. Example: {"Column1": "$.Column1", "Column2":
"$.Column2.Property1", "Column3": "$.Column2.Property2"}. Type: object (or
Expression with resultType object).
:type schema_mapping: object
"""

_validation = {
Expand All @@ -35,9 +41,11 @@ class TabularTranslator(CopyTranslator):
'additional_properties': {'key': '', 'type': '{object}'},
'type': {'key': 'type', 'type': 'str'},
'column_mappings': {'key': 'columnMappings', 'type': 'object'},
'schema_mapping': {'key': 'schemaMapping', 'type': 'object'},
}

def __init__(self, **kwargs):
super(TabularTranslator, self).__init__(**kwargs)
self.column_mappings = kwargs.get('column_mappings', None)
self.schema_mapping = kwargs.get('schema_mapping', None)
self.type = 'TabularTranslator'
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@ class TabularTranslator(CopyTranslator):
:type additional_properties: dict[str, object]
:param type: Required. Constant filled by server.
:type type: str
:param column_mappings: Column mappings. Type: string (or Expression with
resultType string).
:param column_mappings: Column mappings. Example: "UserId: MyUserId,
Group: MyGroup, Name: MyName" Type: string (or Expression with resultType
string).
:type column_mappings: object
:param schema_mapping: The schema mapping to map between tabular data and
hierarchical data. Example: {"Column1": "$.Column1", "Column2":
"$.Column2.Property1", "Column3": "$.Column2.Property2"}. Type: object (or
Expression with resultType object).
:type schema_mapping: object
"""

_validation = {
Expand All @@ -35,9 +41,11 @@ class TabularTranslator(CopyTranslator):
'additional_properties': {'key': '', 'type': '{object}'},
'type': {'key': 'type', 'type': 'str'},
'column_mappings': {'key': 'columnMappings', 'type': 'object'},
'schema_mapping': {'key': 'schemaMapping', 'type': 'object'},
}

def __init__(self, *, additional_properties=None, column_mappings=None, **kwargs) -> None:
def __init__(self, *, additional_properties=None, column_mappings=None, schema_mapping=None, **kwargs) -> None:
super(TabularTranslator, self).__init__(additional_properties=additional_properties, **kwargs)
self.column_mappings = column_mappings
self.schema_mapping = schema_mapping
self.type = 'TabularTranslator'

0 comments on commit 48d13d4

Please sign in to comment.