id
int64
0
843k
repository_name
stringlengths
7
55
file_path
stringlengths
9
332
class_name
stringlengths
3
290
human_written_code
stringlengths
12
4.36M
class_skeleton
stringlengths
19
2.2M
total_program_units
int64
1
9.57k
total_doc_str
int64
0
4.2k
AvgCountLine
float64
0
7.89k
AvgCountLineBlank
float64
0
300
AvgCountLineCode
float64
0
7.89k
AvgCountLineComment
float64
0
7.89k
AvgCyclomatic
float64
0
130
CommentToCodeRatio
float64
0
176
CountClassBase
float64
0
48
CountClassCoupled
float64
0
589
CountClassCoupledModified
float64
0
581
CountClassDerived
float64
0
5.37k
CountDeclInstanceMethod
float64
0
4.2k
CountDeclInstanceVariable
float64
0
299
CountDeclMethod
float64
0
4.2k
CountDeclMethodAll
float64
0
4.2k
CountLine
float64
1
115k
CountLineBlank
float64
0
9.01k
CountLineCode
float64
0
94.4k
CountLineCodeDecl
float64
0
46.1k
CountLineCodeExe
float64
0
91.3k
CountLineComment
float64
0
27k
CountStmt
float64
1
93.2k
CountStmtDecl
float64
0
46.1k
CountStmtExe
float64
0
90.2k
MaxCyclomatic
float64
0
759
MaxInheritanceTree
float64
0
16
MaxNesting
float64
0
34
SumCyclomatic
float64
0
6k
8,800
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/generated/action.py
azext_datafactory.generated.action.AddOrderBy
class AddOrderBy(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): action = self.get_action(values, option_string) super(AddOrderBy, self).__call__(parser, namespace, action, option_string) def get_action(self, values, option_string): try: properties = defaultdict(list) for (k, v) in (x.split("=", 1) for x in values): properties[k].append(v) properties = dict(properties) except ValueError: raise CLIError("usage error: {} [KEY=VALUE ...]".format(option_string)) d = {} for k in properties: kl = k.lower() v = properties[k] if kl == "order-by": d["order_by"] = v[0] elif kl == "order": d["order"] = v[0] else: raise CLIError( "Unsupported Key {} is provided for parameter order-by. All possible keys are: order-by, order".format( k ) ) return d
class AddOrderBy(argparse._AppendAction): def __call__(self, parser, namespace, values, option_string=None): pass def get_action(self, values, option_string): pass
3
0
15
2
13
0
4
0
1
4
0
0
2
0
2
11
32
5
27
8
24
0
21
8
18
6
4
2
7
8,801
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/_configuration.py
azext_datafactory.vendored_sdks.datafactory._configuration.DataFactoryManagementClientConfiguration
class DataFactoryManagementClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for DataFactoryManagementClient. Note that all parameters used to create this instance are saved as instance attributes. :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription identifier. Required. :type subscription_id: str :keyword api_version: Api Version. Default value is "2018-06-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: api_version: str = kwargs.pop("api_version", "2018-06-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") self.credential = credential self.subscription_id = subscription_id self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-datafactory/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( self.credential, *self.credential_scopes, **kwargs )
class DataFactoryManagementClientConfiguration: '''Configuration for DataFactoryManagementClient. Note that all parameters used to create this instance are saved as instance attributes. :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription identifier. Required. :type subscription_id: str :keyword api_version: Api Version. Default value is "2018-06-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str ''' def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: pass def _configure(self, **kwargs: Any) -> None: pass
3
1
15
1
14
0
3
0.43
0
3
0
0
2
14
2
2
45
6
28
18
25
12
26
18
23
3
0
1
5
8,802
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/_data_factory_management_client.py
azext_datafactory.vendored_sdks.datafactory._data_factory_management_client.DataFactoryManagementClient
class DataFactoryManagementClient: # pylint: disable=too-many-instance-attributes """The Azure Data Factory V2 management API provides a RESTful set of web services that interact with Azure Data Factory V2 services. :ivar operations: Operations operations :vartype operations: azure.mgmt.datafactory.operations.Operations :ivar factories: FactoriesOperations operations :vartype factories: azure.mgmt.datafactory.operations.FactoriesOperations :ivar exposure_control: ExposureControlOperations operations :vartype exposure_control: azure.mgmt.datafactory.operations.ExposureControlOperations :ivar integration_runtimes: IntegrationRuntimesOperations operations :vartype integration_runtimes: azure.mgmt.datafactory.operations.IntegrationRuntimesOperations :ivar integration_runtime_object_metadata: IntegrationRuntimeObjectMetadataOperations operations :vartype integration_runtime_object_metadata: azure.mgmt.datafactory.operations.IntegrationRuntimeObjectMetadataOperations :ivar integration_runtime_nodes: IntegrationRuntimeNodesOperations operations :vartype integration_runtime_nodes: azure.mgmt.datafactory.operations.IntegrationRuntimeNodesOperations :ivar linked_services: LinkedServicesOperations operations :vartype linked_services: azure.mgmt.datafactory.operations.LinkedServicesOperations :ivar datasets: DatasetsOperations operations :vartype datasets: azure.mgmt.datafactory.operations.DatasetsOperations :ivar pipelines: PipelinesOperations operations :vartype pipelines: azure.mgmt.datafactory.operations.PipelinesOperations :ivar pipeline_runs: PipelineRunsOperations operations :vartype pipeline_runs: azure.mgmt.datafactory.operations.PipelineRunsOperations :ivar activity_runs: ActivityRunsOperations operations :vartype activity_runs: azure.mgmt.datafactory.operations.ActivityRunsOperations :ivar triggers: TriggersOperations operations :vartype triggers: azure.mgmt.datafactory.operations.TriggersOperations :ivar trigger_runs: TriggerRunsOperations operations :vartype trigger_runs: azure.mgmt.datafactory.operations.TriggerRunsOperations :ivar data_flows: DataFlowsOperations operations :vartype data_flows: azure.mgmt.datafactory.operations.DataFlowsOperations :ivar data_flow_debug_session: DataFlowDebugSessionOperations operations :vartype data_flow_debug_session: azure.mgmt.datafactory.operations.DataFlowDebugSessionOperations :ivar managed_virtual_networks: ManagedVirtualNetworksOperations operations :vartype managed_virtual_networks: azure.mgmt.datafactory.operations.ManagedVirtualNetworksOperations :ivar managed_private_endpoints: ManagedPrivateEndpointsOperations operations :vartype managed_private_endpoints: azure.mgmt.datafactory.operations.ManagedPrivateEndpointsOperations :ivar credential_operations: CredentialOperationsOperations operations :vartype credential_operations: azure.mgmt.datafactory.operations.CredentialOperationsOperations :ivar private_end_point_connections: PrivateEndPointConnectionsOperations operations :vartype private_end_point_connections: azure.mgmt.datafactory.operations.PrivateEndPointConnectionsOperations :ivar private_endpoint_connection: PrivateEndpointConnectionOperations operations :vartype private_endpoint_connection: azure.mgmt.datafactory.operations.PrivateEndpointConnectionOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: azure.mgmt.datafactory.operations.PrivateLinkResourcesOperations :ivar global_parameters: GlobalParametersOperations operations :vartype global_parameters: azure.mgmt.datafactory.operations.GlobalParametersOperations :ivar change_data_capture: ChangeDataCaptureOperations operations :vartype change_data_capture: azure.mgmt.datafactory.operations.ChangeDataCaptureOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription identifier. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str :keyword api_version: Api Version. Default value is "2018-06-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( self, credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = DataFactoryManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ policies.RequestIdPolicy(**kwargs), self._config.headers_policy, self._config.user_agent_policy, self._config.proxy_policy, policies.ContentDecodePolicy(**kwargs), ARMAutoResourceProviderRegistrationPolicy(), self._config.redirect_policy, self._config.retry_policy, self._config.authentication_policy, self._config.custom_hook_policy, self._config.logging_policy, policies.DistributedTracingPolicy(**kwargs), policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.factories = FactoriesOperations(self._client, self._config, self._serialize, self._deserialize) self.exposure_control = ExposureControlOperations( self._client, self._config, self._serialize, self._deserialize ) self.integration_runtimes = IntegrationRuntimesOperations( self._client, self._config, self._serialize, self._deserialize ) self.integration_runtime_object_metadata = IntegrationRuntimeObjectMetadataOperations( self._client, self._config, self._serialize, self._deserialize ) self.integration_runtime_nodes = IntegrationRuntimeNodesOperations( self._client, self._config, self._serialize, self._deserialize ) self.linked_services = LinkedServicesOperations(self._client, self._config, self._serialize, self._deserialize) self.datasets = DatasetsOperations(self._client, self._config, self._serialize, self._deserialize) self.pipelines = PipelinesOperations(self._client, self._config, self._serialize, self._deserialize) self.pipeline_runs = PipelineRunsOperations(self._client, self._config, self._serialize, self._deserialize) self.activity_runs = ActivityRunsOperations(self._client, self._config, self._serialize, self._deserialize) self.triggers = TriggersOperations(self._client, self._config, self._serialize, self._deserialize) self.trigger_runs = TriggerRunsOperations(self._client, self._config, self._serialize, self._deserialize) self.data_flows = DataFlowsOperations(self._client, self._config, self._serialize, self._deserialize) self.data_flow_debug_session = DataFlowDebugSessionOperations( self._client, self._config, self._serialize, self._deserialize ) self.managed_virtual_networks = ManagedVirtualNetworksOperations( self._client, self._config, self._serialize, self._deserialize ) self.managed_private_endpoints = ManagedPrivateEndpointsOperations( self._client, self._config, self._serialize, self._deserialize ) self.credential_operations = CredentialOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) self.private_end_point_connections = PrivateEndPointConnectionsOperations( self._client, self._config, self._serialize, self._deserialize ) self.private_endpoint_connection = PrivateEndpointConnectionOperations( self._client, self._config, self._serialize, self._deserialize ) self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) self.global_parameters = GlobalParametersOperations( self._client, self._config, self._serialize, self._deserialize ) self.change_data_capture = ChangeDataCaptureOperations( self._client, self._config, self._serialize, self._deserialize ) def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") <HttpRequest [GET], url: 'https://www.example.org/'> >>> response = client._send_request(request) <HttpResponse: 200 OK> For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request :param request: The network request you want to make. Required. :type request: ~azure.core.rest.HttpRequest :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. :rtype: ~azure.core.rest.HttpResponse """ request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: self._client.close() def __enter__(self) -> Self: self._client.__enter__() return self def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details)
class DataFactoryManagementClient: '''The Azure Data Factory V2 management API provides a RESTful set of web services that interact with Azure Data Factory V2 services. :ivar operations: Operations operations :vartype operations: azure.mgmt.datafactory.operations.Operations :ivar factories: FactoriesOperations operations :vartype factories: azure.mgmt.datafactory.operations.FactoriesOperations :ivar exposure_control: ExposureControlOperations operations :vartype exposure_control: azure.mgmt.datafactory.operations.ExposureControlOperations :ivar integration_runtimes: IntegrationRuntimesOperations operations :vartype integration_runtimes: azure.mgmt.datafactory.operations.IntegrationRuntimesOperations :ivar integration_runtime_object_metadata: IntegrationRuntimeObjectMetadataOperations operations :vartype integration_runtime_object_metadata: azure.mgmt.datafactory.operations.IntegrationRuntimeObjectMetadataOperations :ivar integration_runtime_nodes: IntegrationRuntimeNodesOperations operations :vartype integration_runtime_nodes: azure.mgmt.datafactory.operations.IntegrationRuntimeNodesOperations :ivar linked_services: LinkedServicesOperations operations :vartype linked_services: azure.mgmt.datafactory.operations.LinkedServicesOperations :ivar datasets: DatasetsOperations operations :vartype datasets: azure.mgmt.datafactory.operations.DatasetsOperations :ivar pipelines: PipelinesOperations operations :vartype pipelines: azure.mgmt.datafactory.operations.PipelinesOperations :ivar pipeline_runs: PipelineRunsOperations operations :vartype pipeline_runs: azure.mgmt.datafactory.operations.PipelineRunsOperations :ivar activity_runs: ActivityRunsOperations operations :vartype activity_runs: azure.mgmt.datafactory.operations.ActivityRunsOperations :ivar triggers: TriggersOperations operations :vartype triggers: azure.mgmt.datafactory.operations.TriggersOperations :ivar trigger_runs: TriggerRunsOperations operations :vartype trigger_runs: azure.mgmt.datafactory.operations.TriggerRunsOperations :ivar data_flows: DataFlowsOperations operations :vartype data_flows: azure.mgmt.datafactory.operations.DataFlowsOperations :ivar data_flow_debug_session: DataFlowDebugSessionOperations operations :vartype data_flow_debug_session: azure.mgmt.datafactory.operations.DataFlowDebugSessionOperations :ivar managed_virtual_networks: ManagedVirtualNetworksOperations operations :vartype managed_virtual_networks: azure.mgmt.datafactory.operations.ManagedVirtualNetworksOperations :ivar managed_private_endpoints: ManagedPrivateEndpointsOperations operations :vartype managed_private_endpoints: azure.mgmt.datafactory.operations.ManagedPrivateEndpointsOperations :ivar credential_operations: CredentialOperationsOperations operations :vartype credential_operations: azure.mgmt.datafactory.operations.CredentialOperationsOperations :ivar private_end_point_connections: PrivateEndPointConnectionsOperations operations :vartype private_end_point_connections: azure.mgmt.datafactory.operations.PrivateEndPointConnectionsOperations :ivar private_endpoint_connection: PrivateEndpointConnectionOperations operations :vartype private_endpoint_connection: azure.mgmt.datafactory.operations.PrivateEndpointConnectionOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: azure.mgmt.datafactory.operations.PrivateLinkResourcesOperations :ivar global_parameters: GlobalParametersOperations operations :vartype global_parameters: azure.mgmt.datafactory.operations.GlobalParametersOperations :ivar change_data_capture: ChangeDataCaptureOperations operations :vartype change_data_capture: azure.mgmt.datafactory.operations.ChangeDataCaptureOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription identifier. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str :keyword api_version: Api Version. Default value is "2018-06-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. ''' def __init__( self, credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: pass def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: '''Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") <HttpRequest [GET], url: 'https://www.example.org/'> >>> response = client._send_request(request) <HttpResponse: 200 OK> For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request :param request: The network request you want to make. Required. :type request: ~azure.core.rest.HttpRequest :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. :rtype: ~azure.core.rest.HttpResponse ''' pass def close(self) -> None: pass def __enter__(self) -> Self: pass def __exit__(self, *exc_details: Any) -> None: pass
6
2
22
1
19
3
1
0.9
0
30
26
0
5
27
5
5
188
11
94
42
82
85
45
36
39
3
0
1
7
8,803
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/_serialization.py
azext_datafactory.vendored_sdks.datafactory._serialization.Deserializer
class Deserializer(object): """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. """ basic_types = {str: "str", int: "int", bool: "bool", float: "float"} valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, "long": Deserializer.deserialize_long, "bytearray": Deserializer.deserialize_bytearray, "base64": Deserializer.deserialize_base64, "object": self.deserialize_object, "[]": self.deserialize_iter, "{}": self.deserialize_dict, } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } self.dependencies: Dict[str, type] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much # complicated, with no real scenario for now. # So adding a flag to disable additional properties detection. This flag should be # used if your expect the deserialization to NOT come from a JSON REST syntax. # Otherwise, result are unexpected self.additional_properties_detection = True def __call__(self, target_obj, response_data, content_type=None): """Call the deserializer to process a REST response. :param str target_obj: Target data type to deserialize to. :param requests.Response response_data: REST response object. :param str content_type: Swagger "produces" if available. :raises: DeserializationError if deserialization fails. :return: Deserialized object. :rtype: object """ data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements """Call the deserializer on a model. Data needs to be already deserialized as JSON or XML ElementTree :param str target_obj: Target data type to deserialize to. :param object data: Object to deserialize. :raises: DeserializationError if deserialization fails. :return: Deserialized object. :rtype: object """ # This is already a model, go recursive just in case if hasattr(data, "_attribute_map"): constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] try: for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access if attr in constants: continue value = getattr(data, attr) if value is None: continue local_type = mapconfig["type"] internal_data_type = local_type.strip("[]{}") if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): continue setattr(data, attr, self._deserialize(local_type, value)) return data except AttributeError: return response, class_name = self._classify_target(target_obj, data) if isinstance(response, str): return self.deserialize_data(data, response) if isinstance(response, type) and issubclass(response, Enum): return self.deserialize_enum(data, response) if data is None or data is CoreNull: return data try: attributes = response._attribute_map # type: ignore # pylint: disable=protected-access d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... if attr == "additional_properties" and attr_desc["key"] == "": continue raw_value = None # Enhance attr_desc with some dynamic data attr_desc = attr_desc.copy() # Do a copy, do not change the real one internal_data_type = attr_desc["type"].strip("[]{}") if internal_data_type in self.dependencies: attr_desc["internalType"] = self.dependencies[internal_data_type] for key_extractor in self.key_extractors: found_value = key_extractor(attr, attr_desc, data) if found_value is not None: if raw_value is not None and raw_value != found_value: msg = ( "Ignoring extracted value '%s' from %s for key '%s'" " (duplicate extraction, follow extractors order)" ) _LOGGER.warning(msg, found_value, key_extractor, attr) continue raw_value = found_value value = self.deserialize_data(raw_value, attr_desc["type"]) d_attrs[attr] = value except (AttributeError, TypeError, KeyError) as err: msg = "Unable to deserialize to object: " + class_name # type: ignore raise DeserializationError(msg) from err additional_properties = self._build_additional_properties(attributes, data) return self._instantiate_model(response, d_attrs, additional_properties) def _build_additional_properties(self, attribute_map, data): if not self.additional_properties_detection: return None if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": # Check empty string. If it's not empty, someone has a real "additionalProperties" return None if isinstance(data, ET.Element): data = {el.tag: el.text for el in data} known_keys = { _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) for desc in attribute_map.values() if desc["key"] != "" } present_keys = set(data.keys()) missing_keys = present_keys - known_keys return {key: data[key] for key in missing_keys} def _classify_target(self, target, data): """Check to see whether the deserialization target object can be classified into a subclass. Once classification has been determined, initialize object. :param str target: The target object type to deserialize to. :param str/dict data: The response data to deserialize. :return: The classified target object and its class name. :rtype: tuple """ if target is None: return None, None if isinstance(target, str): try: target = self.dependencies[target] except KeyError: return target, target try: target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access except AttributeError: pass # Target is not a Model, no classify return target, target.__class__.__name__ # type: ignore def failsafe_deserialize(self, target_obj, data, content_type=None): """Ignores any errors encountered in deserialization, and falls back to not deserializing the object. Recommended for use in error deserialization, as we want to return the HttpResponseError to users, and not have them deal with a deserialization error. :param str target_obj: The target object type to deserialize to. :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. :return: Deserialized object. :rtype: object """ try: return self(target_obj, data, content_type=content_type) except: # pylint: disable=bare-except _LOGGER.debug( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) return None @staticmethod def _unpack_content(raw_data, content_type=None): """Extract the correct structure for deserialization. If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. if we can't, raise. Your Pipeline should have a RawDeserializer. If not a pipeline response and raw_data is bytes or string, use content-type to decode it. If no content-type, try JSON. If raw_data is something else, bypass all logic and return it directly. :param obj raw_data: Data to be processed. :param str content_type: How to parse if raw_data is a string/bytes. :raises JSONDecodeError: If JSON is requested and parsing is impossible. :raises UnicodeDecodeError: If bytes is not UTF8 :rtype: object :return: Unpacked content. """ # Assume this is enough to detect a Pipeline Response without importing it context = getattr(raw_data, "context", {}) if context: if RawDeserializer.CONTEXT_NAME in context: return context[RawDeserializer.CONTEXT_NAME] raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") # Assume this is enough to recognize universal_http.ClientResponse without importing it if hasattr(raw_data, "body"): return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) # Assume this enough to recognize requests.Response without importing it. if hasattr(raw_data, "_content_consumed"): return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore return raw_data def _instantiate_model(self, response, attrs, additional_properties=None): """Instantiate a response model passing in deserialized args. :param Response response: The response model class. :param dict attrs: The deserialized response attributes. :param dict additional_properties: Additional properties to be set. :rtype: Response :return: The instantiated response model. """ if callable(response): subtype = getattr(response, "_subtype_map", {}) try: readonly = [ k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access ] const = [ k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access ] kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} response_obj = response(**kwargs) for attr in readonly: setattr(response_obj, attr, attrs.get(attr)) if additional_properties: response_obj.additional_properties = additional_properties return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore raise DeserializationError(msg + str(err)) from err else: try: for attr, value in attrs.items(): setattr(response, attr, value) return response except Exception as exp: msg = "Unable to populate response model. " msg += "Type: {}, Error: {}".format(type(response), exp) raise DeserializationError(msg) from exp def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements """Process data for deserialization according to data type. :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. :raises: DeserializationError if deserialization fails. :return: Deserialized object. :rtype: object """ if data is None: return data try: if not data_type: return data if data_type in self.basic_types.values(): return self.deserialize_basic(data, data_type) if data_type in self.deserialize_type: if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): return data is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment "object", "[]", r"{}", ] if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: return None data_val = self.deserialize_type[data_type](data) return data_val iter_type = data_type[0] + data_type[-1] if iter_type in self.deserialize_type: return self.deserialize_type[iter_type](data, data_type[1:-1]) obj_type = self.dependencies[data_type] if issubclass(obj_type, Enum): if isinstance(data, ET.Element): data = data.text return self.deserialize_enum(data, obj_type) except (ValueError, TypeError, AttributeError) as err: msg = "Unable to deserialize response data." msg += " Data: {}, {}".format(data, data_type) raise DeserializationError(msg) from err return self._deserialize(obj_type, data) def deserialize_iter(self, attr, iter_type): """Deserialize an iterable. :param list attr: Iterable to be deserialized. :param str iter_type: The type of object in the iterable. :return: Deserialized iterable. :rtype: list """ if attr is None: return None if isinstance(attr, ET.Element): # If I receive an element here, get the children attr = list(attr) if not isinstance(attr, (list, set)): raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) return [self.deserialize_data(a, iter_type) for a in attr] def deserialize_dict(self, attr, dict_type): """Deserialize a dictionary. :param dict/list attr: Dictionary to be deserialized. Also accepts a list of key, value pairs. :param str dict_type: The object type of the items in the dictionary. :return: Deserialized dictionary. :rtype: dict """ if isinstance(attr, list): return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} if isinstance(attr, ET.Element): # Transform <Key>value</Key> into {"Key": "value"} attr = {el.tag: el.text for el in attr} return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Deserialize a generic object. This will be handled as a dictionary. :param dict attr: Dictionary to be deserialized. :return: Deserialized object. :rtype: dict :raises: TypeError if non-builtin datatype encountered. """ if attr is None: return None if isinstance(attr, ET.Element): # Do no recurse on XML, just return the tree as-is return attr if isinstance(attr, str): return self.deserialize_basic(attr, "str") obj_type = type(attr) if obj_type in self.basic_types: return self.deserialize_basic(attr, self.basic_types[obj_type]) if obj_type is _long_type: return self.deserialize_long(attr) if obj_type == dict: deserialized = {} for key, value in attr.items(): try: deserialized[key] = self.deserialize_object(value, **kwargs) except ValueError: deserialized[key] = None return deserialized if obj_type == list: deserialized = [] for obj in attr: try: deserialized.append(self.deserialize_object(obj, **kwargs)) except ValueError: pass return deserialized error = "Cannot deserialize generic object with type: " raise TypeError(error + str(obj_type)) def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements """Deserialize basic builtin data type from string. Will attempt to convert to str, int, float and bool. This function will also accept '1', '0', 'true' and 'false' as valid bool values. :param str attr: response string to be deserialized. :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool :raises: TypeError if string format is not valid. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text if isinstance(attr, ET.Element): attr = attr.text if not attr: if data_type == "str": # None or '', node <a/> is empty string. return "" # None or '', node <a/> with a strong type is None. # Don't try to model "empty bool" or "empty int" return None if data_type == "bool": if attr in [True, False, 1, 0]: return bool(attr) if isinstance(attr, str): if attr.lower() in ["true", "1"]: return True if attr.lower() in ["false", "0"]: return False raise TypeError("Invalid boolean value: {}".format(attr)) if data_type == "str": return self.deserialize_unicode(attr) return eval(data_type)(attr) # nosec # pylint: disable=eval-used @staticmethod def deserialize_unicode(data): """Preserve unicode objects in Python 2, otherwise return data as a string. :param str data: response string to be deserialized. :return: Deserialized string. :rtype: str or unicode """ # We might be here because we have an enum modeled as string, # and we try to deserialize a partial dict with enum inside if isinstance(data, Enum): return data # Consider this is real string try: if isinstance(data, unicode): # type: ignore return data except NameError: return str(data) return str(data) @staticmethod def deserialize_enum(data, enum_obj): """Deserialize string into enum object. If the string is not a valid enum value it will be returned as-is and a warning will be logged. :param str data: Response string to be deserialized. If this value is None or invalid it will be returned as-is. :param Enum enum_obj: Enum object to deserialize to. :return: Deserialized enum object. :rtype: Enum """ if isinstance(data, enum_obj) or data is None: return data if isinstance(data, Enum): data = data.value if isinstance(data, int): # Workaround. We might consider remove it in the future. try: return list(enum_obj.__members__.values())[data] except IndexError as exc: error = "{!r} is not a valid index for enum {!r}" raise DeserializationError(error.format(data, enum_obj)) from exc try: return enum_obj(str(data)) except ValueError: for enum_value in enum_obj: if enum_value.value.lower() == str(data).lower(): return enum_value # We don't fail anymore for unknown value, we deserialize as a string _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) return Deserializer.deserialize_unicode(data) @staticmethod def deserialize_bytearray(attr): """Deserialize string into bytearray. :param str attr: response string to be deserialized. :return: Deserialized bytearray :rtype: bytearray :raises: TypeError if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text return bytearray(b64decode(attr)) # type: ignore @staticmethod def deserialize_base64(attr): """Deserialize base64 encoded string into string. :param str attr: response string to be deserialized. :return: Deserialized base64 string :rtype: bytearray :raises: TypeError if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore attr = attr + padding # type: ignore encoded = attr.replace("-", "+").replace("_", "/") return b64decode(encoded) @staticmethod def deserialize_decimal(attr): """Deserialize string into Decimal object. :param str attr: response string to be deserialized. :return: Deserialized decimal :raises: DeserializationError if string format invalid. :rtype: decimal """ if isinstance(attr, ET.Element): attr = attr.text try: return decimal.Decimal(str(attr)) # type: ignore except decimal.DecimalException as err: msg = "Invalid decimal {}".format(attr) raise DeserializationError(msg) from err @staticmethod def deserialize_long(attr): """Deserialize string into long (Py2) or int (Py3). :param str attr: response string to be deserialized. :return: Deserialized int :rtype: long or int :raises: ValueError if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text return _long_type(attr) # type: ignore @staticmethod def deserialize_duration(attr): """Deserialize ISO-8601 formatted string into TimeDelta object. :param str attr: response string to be deserialized. :return: Deserialized duration :rtype: TimeDelta :raises: DeserializationError if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text try: duration = isodate.parse_duration(attr) except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize duration object." raise DeserializationError(msg) from err return duration @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. :param str attr: response string to be deserialized. :return: Deserialized date :rtype: Date :raises: DeserializationError if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. return isodate.parse_date(attr, defaultmonth=0, defaultday=0) @staticmethod def deserialize_time(attr): """Deserialize ISO-8601 formatted string into time object. :param str attr: response string to be deserialized. :return: Deserialized time :rtype: datetime.time :raises: DeserializationError if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore raise DeserializationError("Date must have only digits and -. Received: %s" % attr) return isodate.parse_time(attr) @staticmethod def deserialize_rfc(attr): """Deserialize RFC-1123 formatted string into Datetime object. :param str attr: response string to be deserialized. :return: Deserialized RFC datetime :rtype: Datetime :raises: DeserializationError if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text try: parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) if not date_obj.tzinfo: date_obj = date_obj.astimezone(tz=TZ_UTC) except ValueError as err: msg = "Cannot deserialize to rfc datetime object." raise DeserializationError(msg) from err return date_obj @staticmethod def deserialize_iso(attr): """Deserialize ISO-8601 formatted string into Datetime object. :param str attr: response string to be deserialized. :return: Deserialized ISO datetime :rtype: Datetime :raises: DeserializationError if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text try: attr = attr.upper() # type: ignore match = Deserializer.valid_date.match(attr) if not match: raise ValueError("Invalid datetime string: " + attr) check_decimal = attr.split(".") if len(check_decimal) > 1: decimal_str = "" for digit in check_decimal[1]: if digit.isdigit(): decimal_str += digit else: break if len(decimal_str) > 6: attr = attr.replace(decimal_str, decimal_str[0:6]) date_obj = isodate.parse_datetime(attr) test_utc = date_obj.utctimetuple() if test_utc.tm_year > 9999 or test_utc.tm_year < 1: raise OverflowError("Hit max or min date") except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize datetime object." raise DeserializationError(msg) from err return date_obj @staticmethod def deserialize_unix(attr): """Serialize Datetime object into IntTime format. This is represented as seconds. :param int attr: Object to be serialized. :return: Deserialized datetime :rtype: Datetime :raises: DeserializationError if format invalid """ if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore try: attr = int(attr) date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) except ValueError as err: msg = "Cannot deserialize to unix datetime object." raise DeserializationError(msg) from err return date_obj
class Deserializer(object): '''Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. ''' def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: pass def __call__(self, target_obj, response_data, content_type=None): '''Call the deserializer to process a REST response. :param str target_obj: Target data type to deserialize to. :param requests.Response response_data: REST response object. :param str content_type: Swagger "produces" if available. :raises: DeserializationError if deserialization fails. :return: Deserialized object. :rtype: object ''' pass def _deserialize(self, target_obj, data): '''Call the deserializer on a model. Data needs to be already deserialized as JSON or XML ElementTree :param str target_obj: Target data type to deserialize to. :param object data: Object to deserialize. :raises: DeserializationError if deserialization fails. :return: Deserialized object. :rtype: object ''' pass def _build_additional_properties(self, attribute_map, data): pass def _classify_target(self, target, data): '''Check to see whether the deserialization target object can be classified into a subclass. Once classification has been determined, initialize object. :param str target: The target object type to deserialize to. :param str/dict data: The response data to deserialize. :return: The classified target object and its class name. :rtype: tuple ''' pass def failsafe_deserialize(self, target_obj, data, content_type=None): '''Ignores any errors encountered in deserialization, and falls back to not deserializing the object. Recommended for use in error deserialization, as we want to return the HttpResponseError to users, and not have them deal with a deserialization error. :param str target_obj: The target object type to deserialize to. :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. :return: Deserialized object. :rtype: object ''' pass @staticmethod def _unpack_content(raw_data, content_type=None): '''Extract the correct structure for deserialization. If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. if we can't, raise. Your Pipeline should have a RawDeserializer. If not a pipeline response and raw_data is bytes or string, use content-type to decode it. If no content-type, try JSON. If raw_data is something else, bypass all logic and return it directly. :param obj raw_data: Data to be processed. :param str content_type: How to parse if raw_data is a string/bytes. :raises JSONDecodeError: If JSON is requested and parsing is impossible. :raises UnicodeDecodeError: If bytes is not UTF8 :rtype: object :return: Unpacked content. ''' pass def _instantiate_model(self, response, attrs, additional_properties=None): '''Instantiate a response model passing in deserialized args. :param Response response: The response model class. :param dict attrs: The deserialized response attributes. :param dict additional_properties: Additional properties to be set. :rtype: Response :return: The instantiated response model. ''' pass def deserialize_data(self, data, data_type): '''Process data for deserialization according to data type. :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. :raises: DeserializationError if deserialization fails. :return: Deserialized object. :rtype: object ''' pass def deserialize_iter(self, attr, iter_type): '''Deserialize an iterable. :param list attr: Iterable to be deserialized. :param str iter_type: The type of object in the iterable. :return: Deserialized iterable. :rtype: list ''' pass def deserialize_dict(self, attr, dict_type): '''Deserialize a dictionary. :param dict/list attr: Dictionary to be deserialized. Also accepts a list of key, value pairs. :param str dict_type: The object type of the items in the dictionary. :return: Deserialized dictionary. :rtype: dict ''' pass def deserialize_object(self, attr, **kwargs): '''Deserialize a generic object. This will be handled as a dictionary. :param dict attr: Dictionary to be deserialized. :return: Deserialized object. :rtype: dict :raises: TypeError if non-builtin datatype encountered. ''' pass def deserialize_basic(self, attr, data_type): '''Deserialize basic builtin data type from string. Will attempt to convert to str, int, float and bool. This function will also accept '1', '0', 'true' and 'false' as valid bool values. :param str attr: response string to be deserialized. :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool :raises: TypeError if string format is not valid. ''' pass @staticmethod def deserialize_unicode(data): '''Preserve unicode objects in Python 2, otherwise return data as a string. :param str data: response string to be deserialized. :return: Deserialized string. :rtype: str or unicode ''' pass @staticmethod def deserialize_enum(data, enum_obj): '''Deserialize string into enum object. If the string is not a valid enum value it will be returned as-is and a warning will be logged. :param str data: Response string to be deserialized. If this value is None or invalid it will be returned as-is. :param Enum enum_obj: Enum object to deserialize to. :return: Deserialized enum object. :rtype: Enum ''' pass @staticmethod def deserialize_bytearray(attr): '''Deserialize string into bytearray. :param str attr: response string to be deserialized. :return: Deserialized bytearray :rtype: bytearray :raises: TypeError if string format invalid. ''' pass @staticmethod def deserialize_base64(attr): '''Deserialize base64 encoded string into string. :param str attr: response string to be deserialized. :return: Deserialized base64 string :rtype: bytearray :raises: TypeError if string format invalid. ''' pass @staticmethod def deserialize_decimal(attr): '''Deserialize string into Decimal object. :param str attr: response string to be deserialized. :return: Deserialized decimal :raises: DeserializationError if string format invalid. :rtype: decimal ''' pass @staticmethod def deserialize_long(attr): '''Deserialize string into long (Py2) or int (Py3). :param str attr: response string to be deserialized. :return: Deserialized int :rtype: long or int :raises: ValueError if string format invalid. ''' pass @staticmethod def deserialize_duration(attr): '''Deserialize ISO-8601 formatted string into TimeDelta object. :param str attr: response string to be deserialized. :return: Deserialized duration :rtype: TimeDelta :raises: DeserializationError if string format invalid. ''' pass @staticmethod def deserialize_date(attr): '''Deserialize ISO-8601 formatted string into Date object. :param str attr: response string to be deserialized. :return: Deserialized date :rtype: Date :raises: DeserializationError if string format invalid. ''' pass @staticmethod def deserialize_time(attr): '''Deserialize ISO-8601 formatted string into time object. :param str attr: response string to be deserialized. :return: Deserialized time :rtype: datetime.time :raises: DeserializationError if string format invalid. ''' pass @staticmethod def deserialize_rfc(attr): '''Deserialize RFC-1123 formatted string into Datetime object. :param str attr: response string to be deserialized. :return: Deserialized RFC datetime :rtype: Datetime :raises: DeserializationError if string format invalid. ''' pass @staticmethod def deserialize_iso(attr): '''Deserialize ISO-8601 formatted string into Datetime object. :param str attr: response string to be deserialized. :return: Deserialized ISO datetime :rtype: Datetime :raises: DeserializationError if string format invalid. ''' pass @staticmethod def deserialize_unix(attr): '''Serialize Datetime object into IntTime format. This is represented as seconds. :param int attr: Object to be serialized. :return: Deserialized datetime :rtype: Datetime :raises: DeserializationError if format invalid ''' pass
39
24
25
2
15
9
5
0.58
1
25
1
0
12
5
25
25
671
81
392
113
353
228
341
89
315
17
1
5
130
8,804
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/_serialization.py
azext_datafactory.vendored_sdks.datafactory._serialization.Model
class Model(object): """Mixin for all client request body/response body models to support serialization and deserialization. """ _subtype_map: Dict[str, Dict[str, Any]] = {} _attribute_map: Dict[str, Dict[str, Any]] = {} _validation: Dict[str, Dict[str, Any]] = {} def __init__(self, **kwargs: Any) -> None: self.additional_properties: Optional[Dict[str, Any]] = {} for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) elif k in self._validation and self._validation[k].get("readonly", False): _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) else: setattr(self, k, kwargs[k]) def __eq__(self, other: Any) -> bool: """Compare objects by comparing all attributes. :param object other: The object to compare :returns: True if objects are equal :rtype: bool """ if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False def __ne__(self, other: Any) -> bool: """Compare objects by comparing all attributes. :param object other: The object to compare :returns: True if objects are not equal :rtype: bool """ return not self.__eq__(other) def __str__(self) -> str: return str(self.__dict__) @classmethod def enable_additional_properties_sending(cls) -> None: cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} @classmethod def is_xml_model(cls) -> bool: try: cls._xml_map # type: ignore except AttributeError: return False return True @classmethod def _create_xml_node(cls): """Create XML node. :returns: The XML node :rtype: xml.etree.ElementTree.Element """ try: xml_map = cls._xml_map # type: ignore except AttributeError: xml_map = {} return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: """Return the JSON that would be sent to server from this model. This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. If you want XML serialization, you can pass the kwargs is_xml=True. :param bool keep_readonly: If you want to serialize the readonly attributes :returns: A dict JSON compatible object :rtype: dict """ serializer = Serializer(self._infer_class_models()) return serializer._serialize( # type: ignore # pylint: disable=protected-access self, keep_readonly=keep_readonly, **kwargs ) def as_dict( self, keep_readonly: bool = True, key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, **kwargs: Any ) -> JSON: """Return a dict that can be serialized using json.dump. Advanced usage might optionally use a callback as parameter: .. code::python def my_key_transformer(key, attr_desc, value): return key Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains 'type' with the msrest type and 'key' with the RestAPI encoded key. Value is the current value in this object. The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict. See the three examples in this file: - attribute_transformer - full_restapi_key_transformer - last_restapi_key_transformer If you want XML serialization, you can pass the kwargs is_xml=True. :param bool keep_readonly: If you want to serialize the readonly attributes :param function key_transformer: A key transformer function. :returns: A dict JSON compatible object :rtype: dict """ serializer = Serializer(self._infer_class_models()) return serializer._serialize( # type: ignore # pylint: disable=protected-access self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs ) @classmethod def _infer_class_models(cls): try: str_models = cls.__module__.rsplit(".", 1)[0] models = sys.modules[str_models] client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} if cls.__name__ not in client_models: raise ValueError("Not Autorest generated code") except Exception: # pylint: disable=broad-exception-caught # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. client_models = {cls.__name__: cls} return client_models @classmethod def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model :raises: DeserializationError if something went wrong :rtype: ModelType """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( cls: Type[ModelType], data: Any, key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, ) -> ModelType: """Parse a dict using given key extractor return a model. By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor) :param dict data: A dict using RestAPI structure :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model :raises: DeserializationError if something went wrong :rtype: ModelType """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore [ # type: ignore attribute_key_case_insensitive_extractor, rest_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, ] if key_extractors is None else key_extractors ) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def _flatten_subtype(cls, key, objects): if "_subtype_map" not in cls.__dict__: return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access return result @classmethod def _classify(cls, response, objects): """Check the class _subtype_map for any child classes. We want to ignore any inherited _subtype_maps. :param dict response: The initial data :param dict objects: The class objects :returns: The class to be used :rtype: class """ for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): subtype_value = None if not isinstance(response, ET.Element): rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) else: subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) if subtype_value: # Try to match base class. Can be class name only # (bug to fix in Autorest to support x-ms-discriminator-name) if cls.__name__ == subtype_value: return cls flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) try: return objects[flatten_mapping_type[subtype_value]] # type: ignore except KeyError: _LOGGER.warning( "Subtype value %s has no mapping, use base class %s.", subtype_value, cls.__name__, ) break else: _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) break return cls @classmethod def _get_rest_key_parts(cls, attr_key): """Get the RestAPI key of this attr, split it and decode part :param str attr_key: Attribute key must be in attribute_map. :returns: A list of RestAPI part :rtype: list """ rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) return [_decode_attribute_map_key(key_part) for key_part in rest_split_key]
class Model(object): '''Mixin for all client request body/response body models to support serialization and deserialization. ''' def __init__(self, **kwargs: Any) -> None: pass def __eq__(self, other: Any) -> bool: '''Compare objects by comparing all attributes. :param object other: The object to compare :returns: True if objects are equal :rtype: bool ''' pass def __ne__(self, other: Any) -> bool: '''Compare objects by comparing all attributes. :param object other: The object to compare :returns: True if objects are not equal :rtype: bool ''' pass def __str__(self) -> str: pass @classmethod def enable_additional_properties_sending(cls) -> None: pass @classmethod def is_xml_model(cls) -> bool: pass @classmethod def _create_xml_node(cls): '''Create XML node. :returns: The XML node :rtype: xml.etree.ElementTree.Element ''' pass def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: '''Return the JSON that would be sent to server from this model. This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. If you want XML serialization, you can pass the kwargs is_xml=True. :param bool keep_readonly: If you want to serialize the readonly attributes :returns: A dict JSON compatible object :rtype: dict ''' pass def as_dict( self, keep_readonly: bool = True, key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, **kwargs: Any ) -> JSON: '''Return a dict that can be serialized using json.dump. Advanced usage might optionally use a callback as parameter: .. code::python def my_key_transformer(key, attr_desc, value): return key Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains 'type' with the msrest type and 'key' with the RestAPI encoded key. Value is the current value in this object. The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict. See the three examples in this file: - attribute_transformer - full_restapi_key_transformer - last_restapi_key_transformer If you want XML serialization, you can pass the kwargs is_xml=True. :param bool keep_readonly: If you want to serialize the readonly attributes :param function key_transformer: A key transformer function. :returns: A dict JSON compatible object :rtype: dict ''' pass @classmethod def _infer_class_models(cls): pass @classmethod def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: '''Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model :raises: DeserializationError if something went wrong :rtype: ModelType ''' pass @classmethod def from_dict( cls: Type[ModelType], data: Any, key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, ) -> ModelType: '''Parse a dict using given key extractor return a model. By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor) :param dict data: A dict using RestAPI structure :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model :raises: DeserializationError if something went wrong :rtype: ModelType ''' pass @classmethod def _flatten_subtype(cls, key, objects): pass @classmethod def _classify(cls, response, objects): '''Check the class _subtype_map for any child classes. We want to ignore any inherited _subtype_maps. :param dict response: The initial data :param dict objects: The class objects :returns: The class to be used :rtype: class ''' pass @classmethod def _get_rest_key_parts(cls, attr_key): '''Get the RestAPI key of this attr, split it and decode part :param str attr_key: Attribute key must be in attribute_map. :returns: A list of RestAPI part :rtype: list ''' pass
25
10
14
1
7
6
2
0.73
1
12
2
245
6
1
15
15
240
37
124
55
89
91
85
36
69
6
1
3
31
8,805
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/_serialization.py
azext_datafactory.vendored_sdks.datafactory._serialization.Serializer
class Serializer(object): # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} months = { 1: "Jan", 2: "Feb", 3: "Mar", 4: "Apr", 5: "May", 6: "Jun", 7: "Jul", 8: "Aug", 9: "Sep", 10: "Oct", 11: "Nov", 12: "Dec", } validation = { "min_length": lambda x, y: len(x) < y, "max_length": lambda x, y: len(x) > y, "minimum": lambda x, y: x < y, "maximum": lambda x, y: x > y, "minimum_ex": lambda x, y: x <= y, "maximum_ex": lambda x, y: x >= y, "min_items": lambda x, y: len(x) < y, "max_items": lambda x, y: len(x) > y, "pattern": lambda x, y: not re.match(y, x, re.UNICODE), "unique": lambda x, y: len(x) != len(set(x)), "multiple": lambda x, y: x % y != 0, } def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, "long": Serializer.serialize_long, "bytearray": Serializer.serialize_bytearray, "base64": Serializer.serialize_base64, "object": self.serialize_object, "[]": self.serialize_iter, "{}": self.serialize_dict, } self.dependencies: Dict[str, type] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals self, target_obj, data_type=None, **kwargs ): """Serialize data into a string according to type. :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict :raises: SerializationError if serialization fails. :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) keep_readonly = kwargs.get("keep_readonly", False) if target_obj is None: return None attr_name = None class_name = target_obj.__class__.__name__ if data_type: return self.serialize_data(target_obj, data_type, **kwargs) if not hasattr(target_obj, "_attribute_map"): data_type = type(target_obj).__name__ if data_type in self.basic_types.values(): return self.serialize_data(target_obj, data_type, **kwargs) # Force "is_xml" kwargs if we detect a XML model try: is_xml_model_serialization = kwargs["is_xml"] except KeyError: is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) serialized = {} if is_xml_model_serialization: serialized = target_obj._create_xml_node() # pylint: disable=protected-access try: attributes = target_obj._attribute_map # pylint: disable=protected-access for attr, attr_desc in attributes.items(): attr_name = attr if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access attr_name, {} ).get("readonly", False): continue if attr_name == "additional_properties" and attr_desc["key"] == "": if target_obj.additional_properties is not None: serialized.update(target_obj.additional_properties) continue try: orig_attr = getattr(target_obj, attr) if is_xml_model_serialization: pass # Don't provide "transformer" for XML for now. Keep "orig_attr" else: # JSON keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) keys = keys if isinstance(keys, list) else [keys] kwargs["serialization_ctxt"] = attr_desc new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) if is_xml_model_serialization: xml_desc = attr_desc.get("xml", {}) xml_name = xml_desc.get("name", attr_desc["key"]) xml_prefix = xml_desc.get("prefix", None) xml_ns = xml_desc.get("ns", None) if xml_desc.get("attr", False): if xml_ns: ET.register_namespace(xml_prefix, xml_ns) xml_name = "{{{}}}{}".format(xml_ns, xml_name) serialized.set(xml_name, new_attr) # type: ignore continue if xml_desc.get("text", False): serialized.text = new_attr # type: ignore continue if isinstance(new_attr, list): serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): # If the down XML has no XML/Name, # we MUST replace the tag with the local tag. But keeping the namespaces. if "name" not in getattr(orig_attr, "_xml_map", {}): splitted_tag = new_attr.tag.split("}") if len(splitted_tag) == 2: # Namespace new_attr.tag = "}".join([splitted_tag[0], xml_name]) else: new_attr.tag = xml_name serialized.append(new_attr) # type: ignore else: # That's a basic type # Integrate namespace if necessary local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) local_node.text = str(new_attr) serialized.append(local_node) # type: ignore else: # JSON for k in reversed(keys): # type: ignore new_attr = {k: new_attr} _new_attr = new_attr _serialized = serialized for k in keys: # type: ignore if k not in _serialized: _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] except ValueError as err: if isinstance(err, SerializationError): raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) raise SerializationError(msg) from err return serialized def body(self, data, data_type, **kwargs): """Serialize data intended for a request body. :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict :raises: SerializationError if serialization fails. :raises: ValueError if data is None :returns: The serialized request body """ # Just in case this is a dict internal_data_type_str = data_type.strip("[]{}") internal_data_type = self.dependencies.get(internal_data_type_str, None) try: is_xml_model_serialization = kwargs["is_xml"] except KeyError: if internal_data_type and issubclass(internal_data_type, Model): is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) else: is_xml_model_serialization = False if internal_data_type and not isinstance(internal_data_type, Enum): try: deserializer = Deserializer(self.dependencies) # Since it's on serialization, it's almost sure that format is not JSON REST # We're not able to deal with additional properties for now. deserializer.additional_properties_detection = False if is_xml_model_serialization: deserializer.key_extractors = [ # type: ignore attribute_key_case_insensitive_extractor, ] else: deserializer.key_extractors = [ rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, ] data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access except DeserializationError as err: raise SerializationError("Unable to build a model: " + str(err)) from err return self._serialize(data, data_type, **kwargs) def url(self, name, data, data_type, **kwargs): """Serialize data intended for a URL path. :param str name: The name of the URL path parameter. :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str :returns: The serialized URL path :raises: TypeError if serialization fails. :raises: ValueError if data is None """ try: output = self.serialize_data(data, data_type, **kwargs) if data_type == "bool": output = json.dumps(output) if kwargs.get("skip_quote") is True: output = str(output) output = output.replace("{", quote("{")).replace("}", quote("}")) else: output = quote(str(output), safe="") except SerializationError as exc: raise TypeError("{} must be type {}.".format(name, data_type)) from exc return output def query(self, name, data, data_type, **kwargs): """Serialize data intended for a URL query. :param str name: The name of the query parameter. :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, list :raises: TypeError if serialization fails. :raises: ValueError if data is None :returns: The serialized query parameter """ try: # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] do_quote = not kwargs.get("skip_quote", False) return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) if data_type == "bool": output = json.dumps(output) if kwargs.get("skip_quote") is True: output = str(output) else: output = quote(str(output), safe="") except SerializationError as exc: raise TypeError("{} must be type {}.".format(name, data_type)) from exc return str(output) def header(self, name, data, data_type, **kwargs): """Serialize data intended for a request header. :param str name: The name of the header. :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None :returns: The serialized header """ try: if data_type in ["[str]"]: data = ["" if d is None else d for d in data] output = self.serialize_data(data, data_type, **kwargs) if data_type == "bool": output = json.dumps(output) except SerializationError as exc: raise TypeError("{} must be type {}.".format(name, data_type)) from exc return str(output) def serialize_data(self, data, data_type, **kwargs): """Serialize generic data according to supplied data type. :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :raises: AttributeError if required data is None. :raises: ValueError if data is None :raises: SerializationError if serialization fails. :returns: The serialized data. :rtype: str, int, float, bool, dict, list """ if data is None: raise ValueError("No value for given attribute") try: if data is CoreNull: return None if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) if data_type in self.serialize_type: return self.serialize_type[data_type](data, **kwargs) # If dependencies is empty, try with current data class # It has to be a subclass of Enum anyway enum_type = self.dependencies.get(data_type, data.__class__) if issubclass(enum_type, Enum): return Serializer.serialize_enum(data, enum_obj=enum_type) iter_type = data_type[0] + data_type[-1] if iter_type in self.serialize_type: return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." raise SerializationError(msg.format(data, data_type)) from err return self._serialize(data, **kwargs) @classmethod def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) if custom_serializer: return custom_serializer if kwargs.get("is_xml", False): return cls._xml_basic_types_serializers.get(data_type) @classmethod def serialize_basic(cls, data, data_type, **kwargs): """Serialize basic builting data type. Serializes objects to str, int, float or bool. Possible kwargs: - basic_types_serializers dict[str, callable] : If set, use the callable as serializer - is_xml bool : If set, use xml_basic_types_serializers :param obj data: Object to be serialized. :param str data_type: Type of object in the iterable. :rtype: str, int, float, bool :return: serialized object """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) return eval(data_type)(data) # nosec # pylint: disable=eval-used @classmethod def serialize_unicode(cls, data): """Special handling for serializing unicode strings in Py2. Encode to UTF-8 if unicode, otherwise handle as a str. :param str data: Object to be serialized. :rtype: str :return: serialized object """ try: # If I received an enum, return its value return data.value except AttributeError: pass try: if isinstance(data, unicode): # type: ignore # Don't change it, JSON and XML ElementTree are totally able # to serialize correctly u'' strings return data except NameError: return str(data) return str(data) def serialize_iter(self, data, iter_type, div=None, **kwargs): """Serialize iterable. Supported kwargs: - serialization_ctxt dict : The current entry of _attribute_map, or same format. serialization_ctxt['type'] should be same as data_type. - is_xml bool : If set, serialize as XML :param list data: Object to be serialized. :param str iter_type: Type of object in the iterable. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. Defaults to False. :rtype: list, str :return: serialized iterable """ if isinstance(data, str): raise SerializationError("Refuse str type as a valid iter type.") serialization_ctxt = kwargs.get("serialization_ctxt", {}) is_xml = kwargs.get("is_xml", False) serialized = [] for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) except ValueError as err: if isinstance(err, SerializationError): raise serialized.append(None) if kwargs.get("do_quote", False): serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) if "xml" in serialization_ctxt or is_xml: # XML serialization is more complicated xml_desc = serialization_ctxt.get("xml", {}) xml_name = xml_desc.get("name") if not xml_name: xml_name = serialization_ctxt["key"] # Create a wrap node if necessary (use the fact that Element and list have "append") is_wrapped = xml_desc.get("wrapped", False) node_name = xml_desc.get("itemsName", xml_name) if is_wrapped: final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) else: final_result = [] # All list elements to "local_node" for el in serialized: if isinstance(el, ET.Element): el_node = el else: el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) if el is not None: # Otherwise it writes "None" :-p el_node.text = str(el) final_result.append(el_node) return final_result return serialized def serialize_dict(self, attr, dict_type, **kwargs): """Serialize a dictionary of objects. :param dict attr: Object to be serialized. :param str dict_type: Type of object in the dictionary. :rtype: dict :return: serialized dictionary """ serialization_ctxt = kwargs.get("serialization_ctxt", {}) serialized = {} for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) except ValueError as err: if isinstance(err, SerializationError): raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: # XML serialization is more complicated xml_desc = serialization_ctxt["xml"] xml_name = xml_desc["name"] final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) for key, value in serialized.items(): ET.SubElement(final_result, key).text = value return final_result return serialized def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Serialize a generic object. This will be handled as a dictionary. If object passed in is not a basic type (str, int, float, dict, list) it will simply be cast to str. :param dict attr: Object to be serialized. :rtype: dict or str :return: serialized object """ if attr is None: return None if isinstance(attr, ET.Element): return attr obj_type = type(attr) if obj_type in self.basic_types: return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) if obj_type is _long_type: return self.serialize_long(attr) if obj_type is str: return self.serialize_unicode(attr) if obj_type is datetime.datetime: return self.serialize_iso(attr) if obj_type is datetime.date: return self.serialize_date(attr) if obj_type is datetime.time: return self.serialize_time(attr) if obj_type is datetime.timedelta: return self.serialize_duration(attr) if obj_type is decimal.Decimal: return self.serialize_decimal(attr) # If it's a model or I know this dependency, serialize as a Model if obj_type in self.dependencies.values() or isinstance(attr, Model): return self._serialize(attr) if obj_type == dict: serialized = {} for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) except ValueError: serialized[self.serialize_unicode(key)] = None return serialized if obj_type == list: serialized = [] for obj in attr: try: serialized.append(self.serialize_object(obj, **kwargs)) except ValueError: pass return serialized return str(attr) @staticmethod def serialize_enum(attr, enum_obj=None): try: result = attr.value except AttributeError: result = attr try: enum_obj(result) # type: ignore return result except ValueError as exc: for enum_value in enum_obj: # type: ignore if enum_value.value.lower() == str(attr).lower(): return enum_value.value error = "{!r} is not valid value for enum {!r}" raise SerializationError(error.format(attr, enum_obj)) from exc @staticmethod def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument """Serialize bytearray into base-64 string. :param str attr: Object to be serialized. :rtype: str :return: serialized base64 """ return b64encode(attr).decode() @staticmethod def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument """Serialize str into base-64 string. :param str attr: Object to be serialized. :rtype: str :return: serialized base64 """ encoded = b64encode(attr).decode("ascii") return encoded.strip("=").replace("+", "-").replace("/", "_") @staticmethod def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument """Serialize Decimal object to float. :param decimal attr: Object to be serialized. :rtype: float :return: serialized decimal """ return float(attr) @staticmethod def serialize_long(attr, **kwargs): # pylint: disable=unused-argument """Serialize long (Py2) or int (Py3). :param int attr: Object to be serialized. :rtype: int/long :return: serialized long """ return _long_type(attr) @staticmethod def serialize_date(attr, **kwargs): # pylint: disable=unused-argument """Serialize Date object into ISO-8601 formatted string. :param Date attr: Object to be serialized. :rtype: str :return: serialized date """ if isinstance(attr, str): attr = isodate.parse_date(attr) t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) return t @staticmethod def serialize_time(attr, **kwargs): # pylint: disable=unused-argument """Serialize Time object into ISO-8601 formatted string. :param datetime.time attr: Object to be serialized. :rtype: str :return: serialized time """ if isinstance(attr, str): attr = isodate.parse_time(attr) t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) if attr.microsecond: t += ".{:02}".format(attr.microsecond) return t @staticmethod def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument """Serialize TimeDelta object into ISO-8601 formatted string. :param TimeDelta attr: Object to be serialized. :rtype: str :return: serialized duration """ if isinstance(attr, str): attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. :param Datetime attr: Object to be serialized. :rtype: str :raises: TypeError if format invalid. :return: serialized rfc """ try: if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") utc = attr.utctimetuple() except AttributeError as exc: raise TypeError("RFC1123 object must be valid Datetime object.") from exc return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( Serializer.days[utc.tm_wday], utc.tm_mday, Serializer.months[utc.tm_mon], utc.tm_year, utc.tm_hour, utc.tm_min, utc.tm_sec, ) @staticmethod def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into ISO-8601 formatted string. :param Datetime attr: Object to be serialized. :rtype: str :raises: SerializationError if format invalid. :return: serialized iso """ if isinstance(attr, str): attr = isodate.parse_datetime(attr) try: if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") utc = attr.utctimetuple() if utc.tm_year > 9999 or utc.tm_year < 1: raise OverflowError("Hit max or min date") microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") if microseconds: microseconds = "." + microseconds date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec ) return date + microseconds + "Z" except (ValueError, OverflowError) as err: msg = "Unable to serialize datetime object." raise SerializationError(msg) from err except AttributeError as err: msg = "ISO-8601 object must be valid Datetime object." raise TypeError(msg) from err @staticmethod def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into IntTime format. This is represented as seconds. :param Datetime attr: Object to be serialized. :rtype: int :raises: SerializationError if format invalid :return: serialied unix """ if isinstance(attr, int): return attr try: if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") return int(calendar.timegm(attr.utctimetuple())) except AttributeError as exc: raise TypeError("Unix time object must be valid Datetime object.") from exc
class Serializer(object): '''Request object model serializer.''' def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: pass def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals self, target_obj, data_type=None, **kwargs ): '''Serialize data into a string according to type. :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict :raises: SerializationError if serialization fails. :returns: The serialized data. ''' pass def body(self, data, data_type, **kwargs): '''Serialize data intended for a request body. :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict :raises: SerializationError if serialization fails. :raises: ValueError if data is None :returns: The serialized request body ''' pass def url(self, name, data, data_type, **kwargs): '''Serialize data intended for a URL path. :param str name: The name of the URL path parameter. :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str :returns: The serialized URL path :raises: TypeError if serialization fails. :raises: ValueError if data is None ''' pass def query(self, name, data, data_type, **kwargs): '''Serialize data intended for a URL query. :param str name: The name of the query parameter. :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, list :raises: TypeError if serialization fails. :raises: ValueError if data is None :returns: The serialized query parameter ''' pass def header(self, name, data, data_type, **kwargs): '''Serialize data intended for a request header. :param str name: The name of the header. :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None :returns: The serialized header ''' pass def serialize_data(self, data, data_type, **kwargs): '''Serialize generic data according to supplied data type. :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :raises: AttributeError if required data is None. :raises: ValueError if data is None :raises: SerializationError if serialization fails. :returns: The serialized data. :rtype: str, int, float, bool, dict, list ''' pass @classmethod def _get_custom_serializers(cls, data_type, **kwargs): pass @classmethod def serialize_basic(cls, data, data_type, **kwargs): '''Serialize basic builting data type. Serializes objects to str, int, float or bool. Possible kwargs: - basic_types_serializers dict[str, callable] : If set, use the callable as serializer - is_xml bool : If set, use xml_basic_types_serializers :param obj data: Object to be serialized. :param str data_type: Type of object in the iterable. :rtype: str, int, float, bool :return: serialized object ''' pass @classmethod def serialize_unicode(cls, data): '''Special handling for serializing unicode strings in Py2. Encode to UTF-8 if unicode, otherwise handle as a str. :param str data: Object to be serialized. :rtype: str :return: serialized object ''' pass def serialize_iter(self, data, iter_type, div=None, **kwargs): '''Serialize iterable. Supported kwargs: - serialization_ctxt dict : The current entry of _attribute_map, or same format. serialization_ctxt['type'] should be same as data_type. - is_xml bool : If set, serialize as XML :param list data: Object to be serialized. :param str iter_type: Type of object in the iterable. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. Defaults to False. :rtype: list, str :return: serialized iterable ''' pass def serialize_dict(self, attr, dict_type, **kwargs): '''Serialize a dictionary of objects. :param dict attr: Object to be serialized. :param str dict_type: Type of object in the dictionary. :rtype: dict :return: serialized dictionary ''' pass def serialize_object(self, attr, **kwargs): '''Serialize a generic object. This will be handled as a dictionary. If object passed in is not a basic type (str, int, float, dict, list) it will simply be cast to str. :param dict attr: Object to be serialized. :rtype: dict or str :return: serialized object ''' pass @staticmethod def serialize_enum(attr, enum_obj=None): pass @staticmethod def serialize_bytearray(attr, **kwargs): '''Serialize bytearray into base-64 string. :param str attr: Object to be serialized. :rtype: str :return: serialized base64 ''' pass @staticmethod def serialize_base64(attr, **kwargs): '''Serialize str into base-64 string. :param str attr: Object to be serialized. :rtype: str :return: serialized base64 ''' pass @staticmethod def serialize_decimal(attr, **kwargs): '''Serialize Decimal object to float. :param decimal attr: Object to be serialized. :rtype: float :return: serialized decimal ''' pass @staticmethod def serialize_long(attr, **kwargs): '''Serialize long (Py2) or int (Py3). :param int attr: Object to be serialized. :rtype: int/long :return: serialized long ''' pass @staticmethod def serialize_date(attr, **kwargs): '''Serialize Date object into ISO-8601 formatted string. :param Date attr: Object to be serialized. :rtype: str :return: serialized date ''' pass @staticmethod def serialize_time(attr, **kwargs): '''Serialize Time object into ISO-8601 formatted string. :param datetime.time attr: Object to be serialized. :rtype: str :return: serialized time ''' pass @staticmethod def serialize_duration(attr, **kwargs): '''Serialize TimeDelta object into ISO-8601 formatted string. :param TimeDelta attr: Object to be serialized. :rtype: str :return: serialized duration ''' pass @staticmethod def serialize_rfc(attr, **kwargs): '''Serialize Datetime object into RFC-1123 formatted string. :param Datetime attr: Object to be serialized. :rtype: str :raises: TypeError if format invalid. :return: serialized rfc ''' pass @staticmethod def serialize_iso(attr, **kwargs): '''Serialize Datetime object into ISO-8601 formatted string. :param Datetime attr: Object to be serialized. :rtype: str :raises: SerializationError if format invalid. :return: serialized iso ''' pass @staticmethod def serialize_unix(attr, **kwargs): '''Serialize Datetime object into IntTime format. This is represented as seconds. :param Datetime attr: Object to be serialized. :rtype: int :raises: SerializationError if format invalid :return: serialied unix ''' pass
39
22
26
2
17
9
6
0.46
1
23
2
0
10
4
24
24
699
85
447
129
406
206
363
101
338
27
1
7
136
8,806
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/_serialization.py
azext_datafactory.vendored_sdks.datafactory._serialization.UTC
class UTC(datetime.tzinfo): """Time Zone info for handling UTC""" def utcoffset(self, dt): """UTF offset for UTC is 0. :param datetime.datetime dt: The datetime :returns: The offset :rtype: datetime.timedelta """ return datetime.timedelta(0) def tzname(self, dt): """Timestamp representation. :param datetime.datetime dt: The datetime :returns: The timestamp representation :rtype: str """ return "Z" def dst(self, dt): """No daylight saving for UTC. :param datetime.datetime dt: The datetime :returns: The daylight saving time :rtype: datetime.timedelta """ return datetime.timedelta(hours=1)
class UTC(datetime.tzinfo): '''Time Zone info for handling UTC''' def utcoffset(self, dt): '''UTF offset for UTC is 0. :param datetime.datetime dt: The datetime :returns: The offset :rtype: datetime.timedelta ''' pass def tzname(self, dt): '''Timestamp representation. :param datetime.datetime dt: The datetime :returns: The timestamp representation :rtype: str ''' pass def dst(self, dt): '''No daylight saving for UTC. :param datetime.datetime dt: The datetime :returns: The daylight saving time :rtype: datetime.timedelta ''' pass
4
4
8
1
2
5
1
2.29
1
1
0
0
3
0
3
8
29
6
7
4
3
16
7
4
3
1
1
0
3
8,807
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/_configuration.py
azext_datafactory.vendored_sdks.datafactory.aio._configuration.DataFactoryManagementClientConfiguration
class DataFactoryManagementClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for DataFactoryManagementClient. Note that all parameters used to create this instance are saved as instance attributes. :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription identifier. Required. :type subscription_id: str :keyword api_version: Api Version. Default value is "2018-06-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: api_version: str = kwargs.pop("api_version", "2018-06-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") self.credential = credential self.subscription_id = subscription_id self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-datafactory/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) def _configure(self, **kwargs: Any) -> None: self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( self.credential, *self.credential_scopes, **kwargs )
class DataFactoryManagementClientConfiguration: '''Configuration for DataFactoryManagementClient. Note that all parameters used to create this instance are saved as instance attributes. :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription identifier. Required. :type subscription_id: str :keyword api_version: Api Version. Default value is "2018-06-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str ''' def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: pass def _configure(self, **kwargs: Any) -> None: pass
3
1
15
1
14
0
3
0.43
0
3
0
0
2
14
2
2
45
6
28
18
25
12
26
18
23
3
0
1
5
8,808
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/_data_factory_management_client.py
azext_datafactory.vendored_sdks.datafactory.aio._data_factory_management_client.DataFactoryManagementClient
class DataFactoryManagementClient: # pylint: disable=too-many-instance-attributes """The Azure Data Factory V2 management API provides a RESTful set of web services that interact with Azure Data Factory V2 services. :ivar operations: Operations operations :vartype operations: azure.mgmt.datafactory.aio.operations.Operations :ivar factories: FactoriesOperations operations :vartype factories: azure.mgmt.datafactory.aio.operations.FactoriesOperations :ivar exposure_control: ExposureControlOperations operations :vartype exposure_control: azure.mgmt.datafactory.aio.operations.ExposureControlOperations :ivar integration_runtimes: IntegrationRuntimesOperations operations :vartype integration_runtimes: azure.mgmt.datafactory.aio.operations.IntegrationRuntimesOperations :ivar integration_runtime_object_metadata: IntegrationRuntimeObjectMetadataOperations operations :vartype integration_runtime_object_metadata: azure.mgmt.datafactory.aio.operations.IntegrationRuntimeObjectMetadataOperations :ivar integration_runtime_nodes: IntegrationRuntimeNodesOperations operations :vartype integration_runtime_nodes: azure.mgmt.datafactory.aio.operations.IntegrationRuntimeNodesOperations :ivar linked_services: LinkedServicesOperations operations :vartype linked_services: azure.mgmt.datafactory.aio.operations.LinkedServicesOperations :ivar datasets: DatasetsOperations operations :vartype datasets: azure.mgmt.datafactory.aio.operations.DatasetsOperations :ivar pipelines: PipelinesOperations operations :vartype pipelines: azure.mgmt.datafactory.aio.operations.PipelinesOperations :ivar pipeline_runs: PipelineRunsOperations operations :vartype pipeline_runs: azure.mgmt.datafactory.aio.operations.PipelineRunsOperations :ivar activity_runs: ActivityRunsOperations operations :vartype activity_runs: azure.mgmt.datafactory.aio.operations.ActivityRunsOperations :ivar triggers: TriggersOperations operations :vartype triggers: azure.mgmt.datafactory.aio.operations.TriggersOperations :ivar trigger_runs: TriggerRunsOperations operations :vartype trigger_runs: azure.mgmt.datafactory.aio.operations.TriggerRunsOperations :ivar data_flows: DataFlowsOperations operations :vartype data_flows: azure.mgmt.datafactory.aio.operations.DataFlowsOperations :ivar data_flow_debug_session: DataFlowDebugSessionOperations operations :vartype data_flow_debug_session: azure.mgmt.datafactory.aio.operations.DataFlowDebugSessionOperations :ivar managed_virtual_networks: ManagedVirtualNetworksOperations operations :vartype managed_virtual_networks: azure.mgmt.datafactory.aio.operations.ManagedVirtualNetworksOperations :ivar managed_private_endpoints: ManagedPrivateEndpointsOperations operations :vartype managed_private_endpoints: azure.mgmt.datafactory.aio.operations.ManagedPrivateEndpointsOperations :ivar credential_operations: CredentialOperationsOperations operations :vartype credential_operations: azure.mgmt.datafactory.aio.operations.CredentialOperationsOperations :ivar private_end_point_connections: PrivateEndPointConnectionsOperations operations :vartype private_end_point_connections: azure.mgmt.datafactory.aio.operations.PrivateEndPointConnectionsOperations :ivar private_endpoint_connection: PrivateEndpointConnectionOperations operations :vartype private_endpoint_connection: azure.mgmt.datafactory.aio.operations.PrivateEndpointConnectionOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: azure.mgmt.datafactory.aio.operations.PrivateLinkResourcesOperations :ivar global_parameters: GlobalParametersOperations operations :vartype global_parameters: azure.mgmt.datafactory.aio.operations.GlobalParametersOperations :ivar change_data_capture: ChangeDataCaptureOperations operations :vartype change_data_capture: azure.mgmt.datafactory.aio.operations.ChangeDataCaptureOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription identifier. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str :keyword api_version: Api Version. Default value is "2018-06-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = DataFactoryManagementClientConfiguration( credential=credential, subscription_id=subscription_id, **kwargs ) _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ policies.RequestIdPolicy(**kwargs), self._config.headers_policy, self._config.user_agent_policy, self._config.proxy_policy, policies.ContentDecodePolicy(**kwargs), AsyncARMAutoResourceProviderRegistrationPolicy(), self._config.redirect_policy, self._config.retry_policy, self._config.authentication_policy, self._config.custom_hook_policy, self._config.logging_policy, policies.DistributedTracingPolicy(**kwargs), policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.factories = FactoriesOperations(self._client, self._config, self._serialize, self._deserialize) self.exposure_control = ExposureControlOperations( self._client, self._config, self._serialize, self._deserialize ) self.integration_runtimes = IntegrationRuntimesOperations( self._client, self._config, self._serialize, self._deserialize ) self.integration_runtime_object_metadata = IntegrationRuntimeObjectMetadataOperations( self._client, self._config, self._serialize, self._deserialize ) self.integration_runtime_nodes = IntegrationRuntimeNodesOperations( self._client, self._config, self._serialize, self._deserialize ) self.linked_services = LinkedServicesOperations(self._client, self._config, self._serialize, self._deserialize) self.datasets = DatasetsOperations(self._client, self._config, self._serialize, self._deserialize) self.pipelines = PipelinesOperations(self._client, self._config, self._serialize, self._deserialize) self.pipeline_runs = PipelineRunsOperations(self._client, self._config, self._serialize, self._deserialize) self.activity_runs = ActivityRunsOperations(self._client, self._config, self._serialize, self._deserialize) self.triggers = TriggersOperations(self._client, self._config, self._serialize, self._deserialize) self.trigger_runs = TriggerRunsOperations(self._client, self._config, self._serialize, self._deserialize) self.data_flows = DataFlowsOperations(self._client, self._config, self._serialize, self._deserialize) self.data_flow_debug_session = DataFlowDebugSessionOperations( self._client, self._config, self._serialize, self._deserialize ) self.managed_virtual_networks = ManagedVirtualNetworksOperations( self._client, self._config, self._serialize, self._deserialize ) self.managed_private_endpoints = ManagedPrivateEndpointsOperations( self._client, self._config, self._serialize, self._deserialize ) self.credential_operations = CredentialOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) self.private_end_point_connections = PrivateEndPointConnectionsOperations( self._client, self._config, self._serialize, self._deserialize ) self.private_endpoint_connection = PrivateEndpointConnectionOperations( self._client, self._config, self._serialize, self._deserialize ) self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) self.global_parameters = GlobalParametersOperations( self._client, self._config, self._serialize, self._deserialize ) self.change_data_capture = ChangeDataCaptureOperations( self._client, self._config, self._serialize, self._deserialize ) def _send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") <HttpRequest [GET], url: 'https://www.example.org/'> >>> response = await client._send_request(request) <AsyncHttpResponse: 200 OK> For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request :param request: The network request you want to make. Required. :type request: ~azure.core.rest.HttpRequest :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. :rtype: ~azure.core.rest.AsyncHttpResponse """ request_copy = deepcopy(request) request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: await self._client.close() async def __aenter__(self) -> Self: await self._client.__aenter__() return self async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details)
class DataFactoryManagementClient: '''The Azure Data Factory V2 management API provides a RESTful set of web services that interact with Azure Data Factory V2 services. :ivar operations: Operations operations :vartype operations: azure.mgmt.datafactory.aio.operations.Operations :ivar factories: FactoriesOperations operations :vartype factories: azure.mgmt.datafactory.aio.operations.FactoriesOperations :ivar exposure_control: ExposureControlOperations operations :vartype exposure_control: azure.mgmt.datafactory.aio.operations.ExposureControlOperations :ivar integration_runtimes: IntegrationRuntimesOperations operations :vartype integration_runtimes: azure.mgmt.datafactory.aio.operations.IntegrationRuntimesOperations :ivar integration_runtime_object_metadata: IntegrationRuntimeObjectMetadataOperations operations :vartype integration_runtime_object_metadata: azure.mgmt.datafactory.aio.operations.IntegrationRuntimeObjectMetadataOperations :ivar integration_runtime_nodes: IntegrationRuntimeNodesOperations operations :vartype integration_runtime_nodes: azure.mgmt.datafactory.aio.operations.IntegrationRuntimeNodesOperations :ivar linked_services: LinkedServicesOperations operations :vartype linked_services: azure.mgmt.datafactory.aio.operations.LinkedServicesOperations :ivar datasets: DatasetsOperations operations :vartype datasets: azure.mgmt.datafactory.aio.operations.DatasetsOperations :ivar pipelines: PipelinesOperations operations :vartype pipelines: azure.mgmt.datafactory.aio.operations.PipelinesOperations :ivar pipeline_runs: PipelineRunsOperations operations :vartype pipeline_runs: azure.mgmt.datafactory.aio.operations.PipelineRunsOperations :ivar activity_runs: ActivityRunsOperations operations :vartype activity_runs: azure.mgmt.datafactory.aio.operations.ActivityRunsOperations :ivar triggers: TriggersOperations operations :vartype triggers: azure.mgmt.datafactory.aio.operations.TriggersOperations :ivar trigger_runs: TriggerRunsOperations operations :vartype trigger_runs: azure.mgmt.datafactory.aio.operations.TriggerRunsOperations :ivar data_flows: DataFlowsOperations operations :vartype data_flows: azure.mgmt.datafactory.aio.operations.DataFlowsOperations :ivar data_flow_debug_session: DataFlowDebugSessionOperations operations :vartype data_flow_debug_session: azure.mgmt.datafactory.aio.operations.DataFlowDebugSessionOperations :ivar managed_virtual_networks: ManagedVirtualNetworksOperations operations :vartype managed_virtual_networks: azure.mgmt.datafactory.aio.operations.ManagedVirtualNetworksOperations :ivar managed_private_endpoints: ManagedPrivateEndpointsOperations operations :vartype managed_private_endpoints: azure.mgmt.datafactory.aio.operations.ManagedPrivateEndpointsOperations :ivar credential_operations: CredentialOperationsOperations operations :vartype credential_operations: azure.mgmt.datafactory.aio.operations.CredentialOperationsOperations :ivar private_end_point_connections: PrivateEndPointConnectionsOperations operations :vartype private_end_point_connections: azure.mgmt.datafactory.aio.operations.PrivateEndPointConnectionsOperations :ivar private_endpoint_connection: PrivateEndpointConnectionOperations operations :vartype private_endpoint_connection: azure.mgmt.datafactory.aio.operations.PrivateEndpointConnectionOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: azure.mgmt.datafactory.aio.operations.PrivateLinkResourcesOperations :ivar global_parameters: GlobalParametersOperations operations :vartype global_parameters: azure.mgmt.datafactory.aio.operations.GlobalParametersOperations :ivar change_data_capture: ChangeDataCaptureOperations operations :vartype change_data_capture: azure.mgmt.datafactory.aio.operations.ChangeDataCaptureOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription identifier. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str :keyword api_version: Api Version. Default value is "2018-06-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. ''' def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: pass def _send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: '''Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") <HttpRequest [GET], url: 'https://www.example.org/'> >>> response = await client._send_request(request) <AsyncHttpResponse: 200 OK> For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request :param request: The network request you want to make. Required. :type request: ~azure.core.rest.HttpRequest :keyword bool stream: Whether the response payload will be streamed. Defaults to False. :return: The response of your network call. Does not do error handling on your response. :rtype: ~azure.core.rest.AsyncHttpResponse ''' pass async def close(self) -> None: pass async def __aenter__(self) -> Self: pass async def __aexit__(self, *exc_details: Any) -> None: pass
6
2
23
1
19
3
1
0.9
0
30
26
0
5
27
5
5
191
11
96
44
82
86
45
36
39
3
0
1
7
8,809
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_activity_runs_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._activity_runs_operations.ActivityRunsOperations
class ActivityRunsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`activity_runs` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload async def query_by_pipeline_run( self, resource_group_name: str, factory_name: str, run_id: str, filter_parameters: _models.RunFilterParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ActivityRunsQueryResponse: """Query activity runs based on input filter conditions. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param run_id: The pipeline run identifier. Required. :type run_id: str :param filter_parameters: Parameters to filter the activity runs. Required. :type filter_parameters: ~azure.mgmt.datafactory.models.RunFilterParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: ActivityRunsQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ActivityRunsQueryResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def query_by_pipeline_run( self, resource_group_name: str, factory_name: str, run_id: str, filter_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.ActivityRunsQueryResponse: """Query activity runs based on input filter conditions. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param run_id: The pipeline run identifier. Required. :type run_id: str :param filter_parameters: Parameters to filter the activity runs. Required. :type filter_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: ActivityRunsQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ActivityRunsQueryResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def query_by_pipeline_run( self, resource_group_name: str, factory_name: str, run_id: str, filter_parameters: Union[_models.RunFilterParameters, IO[bytes]], **kwargs: Any ) -> _models.ActivityRunsQueryResponse: """Query activity runs based on input filter conditions. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param run_id: The pipeline run identifier. Required. :type run_id: str :param filter_parameters: Parameters to filter the activity runs. Is either a RunFilterParameters type or a IO[bytes] type. Required. :type filter_parameters: ~azure.mgmt.datafactory.models.RunFilterParameters or IO[bytes] :return: ActivityRunsQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ActivityRunsQueryResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ActivityRunsQueryResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(filter_parameters, (IOBase, bytes)): _content = filter_parameters else: _json = self._serialize.body(filter_parameters, "RunFilterParameters") _request = build_query_by_pipeline_run_request( resource_group_name=resource_group_name, factory_name=factory_name, run_id=run_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("ActivityRunsQueryResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized
class ActivityRunsOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`activity_runs` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @overload async def query_by_pipeline_run( self, resource_group_name: str, factory_name: str, run_id: str, filter_parameters: _models.RunFilterParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ActivityRunsQueryResponse: '''Query activity runs based on input filter conditions. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param run_id: The pipeline run identifier. Required. :type run_id: str :param filter_parameters: Parameters to filter the activity runs. Required. :type filter_parameters: ~azure.mgmt.datafactory.models.RunFilterParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: ActivityRunsQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ActivityRunsQueryResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def query_by_pipeline_run( self, resource_group_name: str, factory_name: str, run_id: str, filter_parameters: _models.RunFilterParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ActivityRunsQueryResponse: '''Query activity runs based on input filter conditions. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param run_id: The pipeline run identifier. Required. :type run_id: str :param filter_parameters: Parameters to filter the activity runs. Required. :type filter_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: ActivityRunsQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ActivityRunsQueryResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def query_by_pipeline_run( self, resource_group_name: str, factory_name: str, run_id: str, filter_parameters: _models.RunFilterParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ActivityRunsQueryResponse: '''Query activity runs based on input filter conditions. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param run_id: The pipeline run identifier. Required. :type run_id: str :param filter_parameters: Parameters to filter the activity runs. Is either a RunFilterParameters type or a IO[bytes] type. Required. :type filter_parameters: ~azure.mgmt.datafactory.models.RunFilterParameters or IO[bytes] :return: ActivityRunsQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ActivityRunsQueryResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass
8
4
34
3
20
12
3
0.67
0
7
0
0
4
4
4
4
155
19
83
52
50
56
36
24
31
5
0
1
11
8,810
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_change_data_capture_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._change_data_capture_operations.ChangeDataCaptureOperations
class ChangeDataCaptureOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`change_data_capture` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.ChangeDataCaptureResource"]: """Lists all resources of type change data capture. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either ChangeDataCaptureResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.ChangeDataCaptureResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ChangeDataCaptureListResponse] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): if not next_link: _request = build_list_by_factory_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version _parsed_next_link = urllib.parse.urlparse(next_link) _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ChangeDataCaptureListResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) @overload async def create_or_update( self, resource_group_name: str, factory_name: str, change_data_capture_name: str, change_data_capture: _models.ChangeDataCaptureResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ChangeDataCaptureResource: """Creates or updates a change data capture resource. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param change_data_capture_name: The change data capture name. Required. :type change_data_capture_name: str :param change_data_capture: Change data capture resource definition. Required. :type change_data_capture: ~azure.mgmt.datafactory.models.ChangeDataCaptureResource :param if_match: ETag of the change data capture entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: ChangeDataCaptureResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ChangeDataCaptureResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_or_update( self, resource_group_name: str, factory_name: str, change_data_capture_name: str, change_data_capture: IO[bytes], if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ChangeDataCaptureResource: """Creates or updates a change data capture resource. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param change_data_capture_name: The change data capture name. Required. :type change_data_capture_name: str :param change_data_capture: Change data capture resource definition. Required. :type change_data_capture: IO[bytes] :param if_match: ETag of the change data capture entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: ChangeDataCaptureResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ChangeDataCaptureResource :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, change_data_capture_name: str, change_data_capture: Union[_models.ChangeDataCaptureResource, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any ) -> _models.ChangeDataCaptureResource: """Creates or updates a change data capture resource. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param change_data_capture_name: The change data capture name. Required. :type change_data_capture_name: str :param change_data_capture: Change data capture resource definition. Is either a ChangeDataCaptureResource type or a IO[bytes] type. Required. :type change_data_capture: ~azure.mgmt.datafactory.models.ChangeDataCaptureResource or IO[bytes] :param if_match: ETag of the change data capture entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: ChangeDataCaptureResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ChangeDataCaptureResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ChangeDataCaptureResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(change_data_capture, (IOBase, bytes)): _content = change_data_capture else: _json = self._serialize.body(change_data_capture, "ChangeDataCaptureResource") _request = build_create_or_update_request( resource_group_name=resource_group_name, factory_name=factory_name, change_data_capture_name=change_data_capture_name, subscription_id=self._config.subscription_id, if_match=if_match, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("ChangeDataCaptureResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, change_data_capture_name: str, if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.ChangeDataCaptureResource: """Gets a change data capture. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param change_data_capture_name: The change data capture name. Required. :type change_data_capture_name: str :param if_none_match: ETag of the change data capture entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: ChangeDataCaptureResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ChangeDataCaptureResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ChangeDataCaptureResource] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, factory_name=factory_name, change_data_capture_name=change_data_capture_name, subscription_id=self._config.subscription_id, if_none_match=if_none_match, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("ChangeDataCaptureResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def delete( self, resource_group_name: str, factory_name: str, change_data_capture_name: str, **kwargs: Any ) -> None: """Deletes a change data capture. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param change_data_capture_name: The change data capture name. Required. :type change_data_capture_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, factory_name=factory_name, change_data_capture_name=change_data_capture_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def start( self, resource_group_name: str, factory_name: str, change_data_capture_name: str, **kwargs: Any ) -> None: """Starts a change data capture. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param change_data_capture_name: The change data capture name. Required. :type change_data_capture_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_start_request( resource_group_name=resource_group_name, factory_name=factory_name, change_data_capture_name=change_data_capture_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def stop( self, resource_group_name: str, factory_name: str, change_data_capture_name: str, **kwargs: Any ) -> None: """Stops a change data capture. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param change_data_capture_name: The change data capture name. Required. :type change_data_capture_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_stop_request( resource_group_name=resource_group_name, factory_name=factory_name, change_data_capture_name=change_data_capture_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def status( self, resource_group_name: str, factory_name: str, change_data_capture_name: str, **kwargs: Any ) -> str: """Gets the current status for the change data capture resource. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param change_data_capture_name: The change data capture name. Required. :type change_data_capture_name: str :return: str or the result of cls(response) :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[str] = kwargs.pop("cls", None) _request = build_status_request( resource_group_name=resource_group_name, factory_name=factory_name, change_data_capture_name=change_data_capture_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("str", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized
class ChangeDataCaptureOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`change_data_capture` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.ChangeDataCaptureResource"]: '''Lists all resources of type change data capture. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either ChangeDataCaptureResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.ChangeDataCaptureResource] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, change_data_capture_name: str, change_data_capture: _models.ChangeDataCaptureResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ChangeDataCaptureResource: '''Creates or updates a change data capture resource. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param change_data_capture_name: The change data capture name. Required. :type change_data_capture_name: str :param change_data_capture: Change data capture resource definition. Required. :type change_data_capture: ~azure.mgmt.datafactory.models.ChangeDataCaptureResource :param if_match: ETag of the change data capture entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: ChangeDataCaptureResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ChangeDataCaptureResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, change_data_capture_name: str, change_data_capture: _models.ChangeDataCaptureResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ChangeDataCaptureResource: '''Creates or updates a change data capture resource. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param change_data_capture_name: The change data capture name. Required. :type change_data_capture_name: str :param change_data_capture: Change data capture resource definition. Required. :type change_data_capture: IO[bytes] :param if_match: ETag of the change data capture entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: ChangeDataCaptureResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ChangeDataCaptureResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, change_data_capture_name: str, change_data_capture: _models.ChangeDataCaptureResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ChangeDataCaptureResource: '''Creates or updates a change data capture resource. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param change_data_capture_name: The change data capture name. Required. :type change_data_capture_name: str :param change_data_capture: Change data capture resource definition. Is either a ChangeDataCaptureResource type or a IO[bytes] type. Required. :type change_data_capture: ~azure.mgmt.datafactory.models.ChangeDataCaptureResource or IO[bytes] :param if_match: ETag of the change data capture entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: ChangeDataCaptureResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ChangeDataCaptureResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get_next(next_link=None): '''Gets a change data capture. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param change_data_capture_name: The change data capture name. Required. :type change_data_capture_name: str :param if_none_match: ETag of the change data capture entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: ChangeDataCaptureResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ChangeDataCaptureResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def delete( self, resource_group_name: str, factory_name: str, change_data_capture_name: str, **kwargs: Any ) -> None: '''Deletes a change data capture. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param change_data_capture_name: The change data capture name. Required. :type change_data_capture_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def start( self, resource_group_name: str, factory_name: str, change_data_capture_name: str, **kwargs: Any ) -> None: '''Starts a change data capture. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param change_data_capture_name: The change data capture name. Required. :type change_data_capture_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def stop( self, resource_group_name: str, factory_name: str, change_data_capture_name: str, **kwargs: Any ) -> None: '''Stops a change data capture. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param change_data_capture_name: The change data capture name. Required. :type change_data_capture_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def status( self, resource_group_name: str, factory_name: str, change_data_capture_name: str, **kwargs: Any ) -> str: '''Gets the current status for the change data capture resource. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param change_data_capture_name: The change data capture name. Required. :type change_data_capture_name: str :return: str or the result of cls(response) :rtype: str :raises ~azure.core.exceptions.HttpResponseError: ''' pass
23
10
44
6
28
12
3
0.47
0
7
0
0
10
4
10
10
549
81
331
148
263
154
159
94
145
5
0
1
33
8,811
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_credential_operations_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._credential_operations_operations.CredentialOperationsOperations
class CredentialOperationsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`credential_operations` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.CredentialResource"]: """List credentials. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either CredentialResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.CredentialResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CredentialListResponse] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): if not next_link: _request = build_list_by_factory_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version _parsed_next_link = urllib.parse.urlparse(next_link) _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): deserialized = self._deserialize("CredentialListResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) @overload async def create_or_update( self, resource_group_name: str, factory_name: str, credential_name: str, credential: _models.CredentialResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CredentialResource: """Creates or updates a credential. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param credential_name: Credential name. Required. :type credential_name: str :param credential: Credential resource definition. Required. :type credential: ~azure.mgmt.datafactory.models.CredentialResource :param if_match: ETag of the credential entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: CredentialResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.CredentialResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_or_update( self, resource_group_name: str, factory_name: str, credential_name: str, credential: IO[bytes], if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CredentialResource: """Creates or updates a credential. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param credential_name: Credential name. Required. :type credential_name: str :param credential: Credential resource definition. Required. :type credential: IO[bytes] :param if_match: ETag of the credential entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: CredentialResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.CredentialResource :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, credential_name: str, credential: Union[_models.CredentialResource, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any ) -> _models.CredentialResource: """Creates or updates a credential. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param credential_name: Credential name. Required. :type credential_name: str :param credential: Credential resource definition. Is either a CredentialResource type or a IO[bytes] type. Required. :type credential: ~azure.mgmt.datafactory.models.CredentialResource or IO[bytes] :param if_match: ETag of the credential entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: CredentialResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.CredentialResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CredentialResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(credential, (IOBase, bytes)): _content = credential else: _json = self._serialize.body(credential, "CredentialResource") _request = build_create_or_update_request( resource_group_name=resource_group_name, factory_name=factory_name, credential_name=credential_name, subscription_id=self._config.subscription_id, if_match=if_match, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("CredentialResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, credential_name: str, if_none_match: Optional[str] = None, **kwargs: Any ) -> Optional[_models.CredentialResource]: """Gets a credential. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param credential_name: Credential name. Required. :type credential_name: str :param if_none_match: ETag of the credential entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: CredentialResource or None or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.CredentialResource or None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Optional[_models.CredentialResource]] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, factory_name=factory_name, credential_name=credential_name, subscription_id=self._config.subscription_id, if_none_match=if_none_match, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 304]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: deserialized = self._deserialize("CredentialResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def delete(self, resource_group_name: str, factory_name: str, credential_name: str, **kwargs: Any) -> None: """Deletes a credential. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param credential_name: Credential name. Required. :type credential_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, factory_name=factory_name, credential_name=credential_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {})
class CredentialOperationsOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`credential_operations` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.CredentialResource"]: '''List credentials. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either CredentialResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.CredentialResource] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, credential_name: str, credential: _models.CredentialResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CredentialResource: '''Creates or updates a credential. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param credential_name: Credential name. Required. :type credential_name: str :param credential: Credential resource definition. Required. :type credential: ~azure.mgmt.datafactory.models.CredentialResource :param if_match: ETag of the credential entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: CredentialResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.CredentialResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, credential_name: str, credential: _models.CredentialResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CredentialResource: '''Creates or updates a credential. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param credential_name: Credential name. Required. :type credential_name: str :param credential: Credential resource definition. Required. :type credential: IO[bytes] :param if_match: ETag of the credential entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: CredentialResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.CredentialResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, credential_name: str, credential: _models.CredentialResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CredentialResource: '''Creates or updates a credential. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param credential_name: Credential name. Required. :type credential_name: str :param credential: Credential resource definition. Is either a CredentialResource type or a IO[bytes] type. Required. :type credential: ~azure.mgmt.datafactory.models.CredentialResource or IO[bytes] :param if_match: ETag of the credential entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: CredentialResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.CredentialResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get_next(next_link=None): '''Gets a credential. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param credential_name: Credential name. Required. :type credential_name: str :param if_none_match: ETag of the credential entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: CredentialResource or None or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.CredentialResource or None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def delete(self, resource_group_name: str, factory_name: str, credential_name: str, **kwargs: Any) -> None: '''Deletes a credential. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param credential_name: Credential name. Required. :type credential_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass
17
7
40
5
26
11
3
0.49
0
7
0
0
7
4
7
7
375
52
224
106
170
109
108
63
97
5
0
1
25
8,812
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/operations/_tag_rules_operations.py
azext_datadog.vendored_sdks.datadog.operations._tag_rules_operations.TagRulesOperations
class TagRulesOperations(object): """TagRulesOperations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~microsoft_datadog_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. """ models = models def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self._config = config def list( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): # type: (...) -> Iterable["models.MonitoringTagRulesListResponse"] """List the tag rules for a given monitor resource. List the tag rules for a given monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either MonitoringTagRulesListResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.MonitoringTagRulesListResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoringTagRulesListResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): deserialized = self._deserialize('MonitoringTagRulesListResponse', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules'} # type: ignore def create_or_update( self, resource_group_name, # type: str monitor_name, # type: str rule_set_name, # type: str body=None, # type: Optional["models.MonitoringTagRules"] **kwargs # type: Any ): # type: (...) -> "models.MonitoringTagRules" """Create or update a tag rule set for a given monitor resource. Create or update a tag rule set for a given monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param rule_set_name: Rule set name. :type rule_set_name: str :param body: :type body: ~microsoft_datadog_client.models.MonitoringTagRules :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringTagRules, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.MonitoringTagRules :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoringTagRules"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] if body is not None: body_content = self._serialize.body(body, 'MonitoringTagRules') else: body_content = None body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MonitoringTagRules', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}'} # type: ignore def get( self, resource_group_name, # type: str monitor_name, # type: str rule_set_name, # type: str **kwargs # type: Any ): # type: (...) -> "models.MonitoringTagRules" """Get a tag rule set for a given monitor resource. Get a tag rule set for a given monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param rule_set_name: Rule set name. :type rule_set_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringTagRules, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.MonitoringTagRules :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoringTagRules"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), 'ruleSetName': self._serialize.url("rule_set_name", rule_set_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MonitoringTagRules', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/tagRules/{ruleSetName}'}
class TagRulesOperations(object): '''TagRulesOperations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~microsoft_datadog_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. ''' def __init__(self, client, config, serializer, deserializer): pass def list( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): '''List the tag rules for a given monitor resource. List the tag rules for a given monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either MonitoringTagRulesListResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.MonitoringTagRulesListResponse] :raises: ~azure.core.exceptions.HttpResponseError ''' pass def prepare_request(next_link=None): pass def extract_data(pipeline_response): pass def get_next(next_link=None): pass def create_or_update( self, resource_group_name, # type: str monitor_name, # type: str rule_set_name, # type: str body=None, # type: Optional["models.MonitoringTagRules"] **kwargs # type: Any ): '''Create or update a tag rule set for a given monitor resource. Create or update a tag rule set for a given monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param rule_set_name: Rule set name. :type rule_set_name: str :param body: :type body: ~microsoft_datadog_client.models.MonitoringTagRules :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringTagRules, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.MonitoringTagRules :raises: ~azure.core.exceptions.HttpResponseError ''' pass def get_next(next_link=None): '''Get a tag rule set for a given monitor resource. Get a tag rule set for a given monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param rule_set_name: Rule set name. :type rule_set_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: MonitoringTagRules, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.MonitoringTagRules :raises: ~azure.core.exceptions.HttpResponseError ''' pass
8
4
37
5
25
12
2
0.63
1
0
0
0
4
4
4
4
242
38
143
75
117
90
101
57
93
4
1
1
15
8,813
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_data_flow_debug_session_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._data_flow_debug_session_operations.DataFlowDebugSessionOperations
class DataFlowDebugSessionOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`data_flow_debug_session` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") async def _create_initial( self, resource_group_name: str, factory_name: str, request: Union[_models.CreateDataFlowDebugSessionRequest, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(request, (IOBase, bytes)): _content = request else: _json = self._serialize.body(request, "CreateDataFlowDebugSessionRequest") _request = build_create_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) response_headers = {} if response.status_code == 202: response_headers["location"] = self._deserialize("str", response.headers.get("location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @overload async def begin_create( self, resource_group_name: str, factory_name: str, request: _models.CreateDataFlowDebugSessionRequest, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.CreateDataFlowDebugSessionResponse]: """Creates a data flow debug session. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug session definition. Required. :type request: ~azure.mgmt.datafactory.models.CreateDataFlowDebugSessionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either CreateDataFlowDebugSessionResponse or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.CreateDataFlowDebugSessionResponse] :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def begin_create( self, resource_group_name: str, factory_name: str, request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.CreateDataFlowDebugSessionResponse]: """Creates a data flow debug session. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug session definition. Required. :type request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either CreateDataFlowDebugSessionResponse or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.CreateDataFlowDebugSessionResponse] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def begin_create( self, resource_group_name: str, factory_name: str, request: Union[_models.CreateDataFlowDebugSessionRequest, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.CreateDataFlowDebugSessionResponse]: """Creates a data flow debug session. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug session definition. Is either a CreateDataFlowDebugSessionRequest type or a IO[bytes] type. Required. :type request: ~azure.mgmt.datafactory.models.CreateDataFlowDebugSessionRequest or IO[bytes] :return: An instance of AsyncLROPoller that returns either CreateDataFlowDebugSessionResponse or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.CreateDataFlowDebugSessionResponse] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CreateDataFlowDebugSessionResponse] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._create_initial( resource_group_name=resource_group_name, factory_name=factory_name, request=request, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): deserialized = self._deserialize("CreateDataFlowDebugSessionResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: return AsyncLROPoller[_models.CreateDataFlowDebugSessionResponse].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) return AsyncLROPoller[_models.CreateDataFlowDebugSessionResponse]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @distributed_trace def query_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.DataFlowDebugSessionInfo"]: """Query all active data flow debug sessions. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either DataFlowDebugSessionInfo or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.DataFlowDebugSessionInfo] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.QueryDataFlowDebugSessionsResponse] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): if not next_link: _request = build_query_by_factory_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version _parsed_next_link = urllib.parse.urlparse(next_link) _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): deserialized = self._deserialize("QueryDataFlowDebugSessionsResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) @overload async def add_data_flow( self, resource_group_name: str, factory_name: str, request: _models.DataFlowDebugPackage, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AddDataFlowToDebugSessionResponse: """Add a data flow into debug session. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug session definition with debug content. Required. :type request: ~azure.mgmt.datafactory.models.DataFlowDebugPackage :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: AddDataFlowToDebugSessionResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.AddDataFlowToDebugSessionResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def add_data_flow( self, resource_group_name: str, factory_name: str, request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.AddDataFlowToDebugSessionResponse: """Add a data flow into debug session. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug session definition with debug content. Required. :type request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: AddDataFlowToDebugSessionResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.AddDataFlowToDebugSessionResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def add_data_flow( self, resource_group_name: str, factory_name: str, request: Union[_models.DataFlowDebugPackage, IO[bytes]], **kwargs: Any ) -> _models.AddDataFlowToDebugSessionResponse: """Add a data flow into debug session. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug session definition with debug content. Is either a DataFlowDebugPackage type or a IO[bytes] type. Required. :type request: ~azure.mgmt.datafactory.models.DataFlowDebugPackage or IO[bytes] :return: AddDataFlowToDebugSessionResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.AddDataFlowToDebugSessionResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AddDataFlowToDebugSessionResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(request, (IOBase, bytes)): _content = request else: _json = self._serialize.body(request, "DataFlowDebugPackage") _request = build_add_data_flow_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("AddDataFlowToDebugSessionResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload async def delete( self, resource_group_name: str, factory_name: str, request: _models.DeleteDataFlowDebugSessionRequest, *, content_type: str = "application/json", **kwargs: Any ) -> None: """Deletes a data flow debug session. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug session definition for deletion. Required. :type request: ~azure.mgmt.datafactory.models.DeleteDataFlowDebugSessionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def delete( self, resource_group_name: str, factory_name: str, request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> None: """Deletes a data flow debug session. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug session definition for deletion. Required. :type request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def delete( self, resource_group_name: str, factory_name: str, request: Union[_models.DeleteDataFlowDebugSessionRequest, IO[bytes]], **kwargs: Any ) -> None: """Deletes a data flow debug session. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug session definition for deletion. Is either a DeleteDataFlowDebugSessionRequest type or a IO[bytes] type. Required. :type request: ~azure.mgmt.datafactory.models.DeleteDataFlowDebugSessionRequest or IO[bytes] :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(request, (IOBase, bytes)): _content = request else: _json = self._serialize.body(request, "DeleteDataFlowDebugSessionRequest") _request = build_delete_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore async def _execute_command_initial( self, resource_group_name: str, factory_name: str, request: Union[_models.DataFlowDebugCommandRequest, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(request, (IOBase, bytes)): _content = request else: _json = self._serialize.body(request, "DataFlowDebugCommandRequest") _request = build_execute_command_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) response_headers = {} if response.status_code == 202: response_headers["location"] = self._deserialize("str", response.headers.get("location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @overload async def begin_execute_command( self, resource_group_name: str, factory_name: str, request: _models.DataFlowDebugCommandRequest, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.DataFlowDebugCommandResponse]: """Execute a data flow debug command. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug command definition. Required. :type request: ~azure.mgmt.datafactory.models.DataFlowDebugCommandRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either DataFlowDebugCommandResponse or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.DataFlowDebugCommandResponse] :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def begin_execute_command( self, resource_group_name: str, factory_name: str, request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.DataFlowDebugCommandResponse]: """Execute a data flow debug command. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug command definition. Required. :type request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either DataFlowDebugCommandResponse or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.DataFlowDebugCommandResponse] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def begin_execute_command( self, resource_group_name: str, factory_name: str, request: Union[_models.DataFlowDebugCommandRequest, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.DataFlowDebugCommandResponse]: """Execute a data flow debug command. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug command definition. Is either a DataFlowDebugCommandRequest type or a IO[bytes] type. Required. :type request: ~azure.mgmt.datafactory.models.DataFlowDebugCommandRequest or IO[bytes] :return: An instance of AsyncLROPoller that returns either DataFlowDebugCommandResponse or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.DataFlowDebugCommandResponse] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DataFlowDebugCommandResponse] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._execute_command_initial( resource_group_name=resource_group_name, factory_name=factory_name, request=request, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): deserialized = self._deserialize("DataFlowDebugCommandResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: return AsyncLROPoller[_models.DataFlowDebugCommandResponse].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) return AsyncLROPoller[_models.DataFlowDebugCommandResponse]( self._client, raw_result, get_long_running_output, polling_method # type: ignore )
class DataFlowDebugSessionOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`data_flow_debug_session` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass async def _create_initial( self, resource_group_name: str, factory_name: str, request: Union[_models.CreateDataFlowDebugSessionRequest, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: pass @overload async def begin_create( self, resource_group_name: str, factory_name: str, request: _models.CreateDataFlowDebugSessionRequest, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.CreateDataFlowDebugSessionResponse]: '''Creates a data flow debug session. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug session definition. Required. :type request: ~azure.mgmt.datafactory.models.CreateDataFlowDebugSessionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either CreateDataFlowDebugSessionResponse or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.CreateDataFlowDebugSessionResponse] :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def begin_create( self, resource_group_name: str, factory_name: str, request: _models.CreateDataFlowDebugSessionRequest, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.CreateDataFlowDebugSessionResponse]: '''Creates a data flow debug session. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug session definition. Required. :type request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either CreateDataFlowDebugSessionResponse or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.CreateDataFlowDebugSessionResponse] :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def begin_create( self, resource_group_name: str, factory_name: str, request: _models.CreateDataFlowDebugSessionRequest, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.CreateDataFlowDebugSessionResponse]: '''Creates a data flow debug session. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug session definition. Is either a CreateDataFlowDebugSessionRequest type or a IO[bytes] type. Required. :type request: ~azure.mgmt.datafactory.models.CreateDataFlowDebugSessionRequest or IO[bytes] :return: An instance of AsyncLROPoller that returns either CreateDataFlowDebugSessionResponse or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.CreateDataFlowDebugSessionResponse] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def get_long_running_output(pipeline_response): pass @distributed_trace def query_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.DataFlowDebugSessionInfo"]: '''Query all active data flow debug sessions. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either DataFlowDebugSessionInfo or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.DataFlowDebugSessionInfo] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass @overload async def add_data_flow( self, resource_group_name: str, factory_name: str, request: _models.DataFlowDebugPackage, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AddDataFlowToDebugSessionResponse: '''Add a data flow into debug session. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug session definition with debug content. Required. :type request: ~azure.mgmt.datafactory.models.DataFlowDebugPackage :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: AddDataFlowToDebugSessionResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.AddDataFlowToDebugSessionResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def add_data_flow( self, resource_group_name: str, factory_name: str, request: _models.DataFlowDebugPackage, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AddDataFlowToDebugSessionResponse: '''Add a data flow into debug session. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug session definition with debug content. Required. :type request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: AddDataFlowToDebugSessionResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.AddDataFlowToDebugSessionResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def add_data_flow( self, resource_group_name: str, factory_name: str, request: _models.DataFlowDebugPackage, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AddDataFlowToDebugSessionResponse: '''Add a data flow into debug session. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug session definition with debug content. Is either a DataFlowDebugPackage type or a IO[bytes] type. Required. :type request: ~azure.mgmt.datafactory.models.DataFlowDebugPackage or IO[bytes] :return: AddDataFlowToDebugSessionResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.AddDataFlowToDebugSessionResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def delete( self, resource_group_name: str, factory_name: str, request: _models.DeleteDataFlowDebugSessionRequest, *, content_type: str = "application/json", **kwargs: Any ) -> None: '''Deletes a data flow debug session. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug session definition for deletion. Required. :type request: ~azure.mgmt.datafactory.models.DeleteDataFlowDebugSessionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def delete( self, resource_group_name: str, factory_name: str, request: _models.DeleteDataFlowDebugSessionRequest, *, content_type: str = "application/json", **kwargs: Any ) -> None: '''Deletes a data flow debug session. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug session definition for deletion. Required. :type request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def delete( self, resource_group_name: str, factory_name: str, request: _models.DeleteDataFlowDebugSessionRequest, *, content_type: str = "application/json", **kwargs: Any ) -> None: '''Deletes a data flow debug session. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug session definition for deletion. Is either a DeleteDataFlowDebugSessionRequest type or a IO[bytes] type. Required. :type request: ~azure.mgmt.datafactory.models.DeleteDataFlowDebugSessionRequest or IO[bytes] :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass async def _execute_command_initial( self, resource_group_name: str, factory_name: str, request: Union[_models.DataFlowDebugCommandRequest, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: pass @overload async def begin_execute_command( self, resource_group_name: str, factory_name: str, request: _models.DataFlowDebugCommandRequest, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.DataFlowDebugCommandResponse]: '''Execute a data flow debug command. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug command definition. Required. :type request: ~azure.mgmt.datafactory.models.DataFlowDebugCommandRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either DataFlowDebugCommandResponse or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.DataFlowDebugCommandResponse] :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def begin_execute_command( self, resource_group_name: str, factory_name: str, request: _models.DataFlowDebugCommandRequest, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.DataFlowDebugCommandResponse]: '''Execute a data flow debug command. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug command definition. Required. :type request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns either DataFlowDebugCommandResponse or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.DataFlowDebugCommandResponse] :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def begin_execute_command( self, resource_group_name: str, factory_name: str, request: _models.DataFlowDebugCommandRequest, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.DataFlowDebugCommandResponse]: '''Execute a data flow debug command. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param request: Data flow debug command definition. Is either a DataFlowDebugCommandRequest type or a IO[bytes] type. Required. :type request: ~azure.mgmt.datafactory.models.DataFlowDebugCommandRequest or IO[bytes] :return: An instance of AsyncLROPoller that returns either DataFlowDebugCommandResponse or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.DataFlowDebugCommandResponse] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def get_long_running_output(pipeline_response): pass
35
14
36
4
24
10
3
0.46
0
8
0
0
16
4
16
16
744
88
465
234
328
212
218
119
196
6
0
2
54
8,814
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/operations/_single_sign_on_configurations_operations.py
azext_datadog.vendored_sdks.datadog.operations._single_sign_on_configurations_operations.SingleSignOnConfigurationsOperations
class SingleSignOnConfigurationsOperations(object): """SingleSignOnConfigurationsOperations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~microsoft_datadog_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. """ models = models def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self._config = config def list( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): # type: (...) -> Iterable["models.DatadogSingleSignOnResourceListResponse"] """List the single sign-on configurations for a given monitor resource. List the single sign-on configurations for a given monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogSingleSignOnResourceListResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.DatadogSingleSignOnResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogSingleSignOnResourceListResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): deserialized = self._deserialize('DatadogSingleSignOnResourceListResponse', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations'} # type: ignore def _create_or_update_initial( self, resource_group_name, # type: str monitor_name, # type: str configuration_name, # type: str body=None, # type: Optional["models.DatadogSingleSignOnResource"] **kwargs # type: Any ): # type: (...) -> "models.DatadogSingleSignOnResource" cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogSingleSignOnResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] if body is not None: body_content = self._serialize.body(body, 'DatadogSingleSignOnResource') else: body_content = None body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize('DatadogSingleSignOnResource', pipeline_response) if response.status_code == 201: deserialized = self._deserialize('DatadogSingleSignOnResource', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}'} # type: ignore def begin_create_or_update( self, resource_group_name, # type: str monitor_name, # type: str configuration_name, # type: str body=None, # type: Optional["models.DatadogSingleSignOnResource"] **kwargs # type: Any ): # type: (...) -> LROPoller["models.DatadogSingleSignOnResource"] """Configures single-sign-on for this resource. Configures single-sign-on for this resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param configuration_name: Configuration name. :type configuration_name: str :param body: :type body: ~microsoft_datadog_client.models.DatadogSingleSignOnResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either DatadogSingleSignOnResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~microsoft_datadog_client.models.DatadogSingleSignOnResource] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogSingleSignOnResource"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, monitor_name=monitor_name, configuration_name=configuration_name, body=body, cls=lambda x,y,z: x, **kwargs ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): deserialized = self._deserialize('DatadogSingleSignOnResource', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), } if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}'} # type: ignore def get( self, resource_group_name, # type: str monitor_name, # type: str configuration_name, # type: str **kwargs # type: Any ): # type: (...) -> "models.DatadogSingleSignOnResource" """Gets the datadog single sign-on resource for the given Monitor. Gets the datadog single sign-on resource for the given Monitor. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param configuration_name: Configuration name. :type configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatadogSingleSignOnResource, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.DatadogSingleSignOnResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogSingleSignOnResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), 'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DatadogSingleSignOnResource', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/singleSignOnConfigurations/{configurationName}'}
class SingleSignOnConfigurationsOperations(object): '''SingleSignOnConfigurationsOperations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~microsoft_datadog_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. ''' def __init__(self, client, config, serializer, deserializer): pass def list( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): '''List the single sign-on configurations for a given monitor resource. List the single sign-on configurations for a given monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogSingleSignOnResourceListResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.DatadogSingleSignOnResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError ''' pass def prepare_request(next_link=None): pass def extract_data(pipeline_response): pass def get_next(next_link=None): pass def _create_or_update_initial( self, resource_group_name, # type: str monitor_name, # type: str configuration_name, # type: str body=None, # type: Optional["models.DatadogSingleSignOnResource"] **kwargs # type: Any ): pass def begin_create_or_update( self, resource_group_name, # type: str monitor_name, # type: str configuration_name, # type: str body=None, # type: Optional["models.DatadogSingleSignOnResource"] **kwargs # type: Any ): '''Configures single-sign-on for this resource. Configures single-sign-on for this resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param configuration_name: Configuration name. :type configuration_name: str :param body: :type body: ~microsoft_datadog_client.models.DatadogSingleSignOnResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either DatadogSingleSignOnResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~microsoft_datadog_client.models.DatadogSingleSignOnResource] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def get_long_running_output(pipeline_response): pass def get_next(next_link=None): '''Gets the datadog single sign-on resource for the given Monitor. Gets the datadog single sign-on resource for the given Monitor. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param configuration_name: Configuration name. :type configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatadogSingleSignOnResource, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.DatadogSingleSignOnResource :raises: ~azure.core.exceptions.HttpResponseError ''' pass
10
4
37
5
25
11
3
0.54
1
0
0
0
5
4
5
5
308
45
196
92
161
105
127
67
117
6
1
1
24
8,815
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/operations/_monitors_operations.py
azext_datadog.vendored_sdks.datadog.operations._monitors_operations.MonitorsOperations
class MonitorsOperations(object): """MonitorsOperations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~microsoft_datadog_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. """ models = models def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self._config = config def list_api_keys( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): # type: (...) -> Iterable["models.DatadogApiKeyListResponse"] """List the api keys for a given monitor resource. List the api keys for a given monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogApiKeyListResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.DatadogApiKeyListResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogApiKeyListResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list_api_keys.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.post(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): deserialized = self._deserialize('DatadogApiKeyListResponse', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) list_api_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listApiKeys'} # type: ignore def get_default_key( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): # type: (...) -> "models.DatadogApiKey" """Get the default api key. Get the default api key. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatadogApiKey, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.DatadogApiKey :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogApiKey"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" # Construct URL url = self.get_default_key.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DatadogApiKey', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized get_default_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/getDefaultKey'} # type: ignore def set_default_key( self, resource_group_name, # type: str monitor_name, # type: str body=None, # type: Optional["models.DatadogApiKey"] **kwargs # type: Any ): # type: (...) -> None """Set the default api key. Set the default api key. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param body: :type body: ~microsoft_datadog_client.models.DatadogApiKey :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL url = self.set_default_key.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] if body is not None: body_content = self._serialize.body(body, 'DatadogApiKey') else: body_content = None body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) set_default_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/setDefaultKey'} # type: ignore def list_hosts( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): # type: (...) -> Iterable["models.DatadogHostListResponse"] """List the hosts for a given monitor resource. List the hosts for a given monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogHostListResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.DatadogHostListResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogHostListResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list_hosts.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.post(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): deserialized = self._deserialize('DatadogHostListResponse', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) list_hosts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listHosts'} # type: ignore def list_linked_resources( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): # type: (...) -> Iterable["models.LinkedResourceListResponse"] """List all Azure resources associated to the same Datadog organization as the target resource. List all Azure resources associated to the same Datadog organization as the target resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either LinkedResourceListResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.LinkedResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LinkedResourceListResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list_linked_resources.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.post(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): deserialized = self._deserialize('LinkedResourceListResponse', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) list_linked_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listLinkedResources'} # type: ignore def list_monitored_resources( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): # type: (...) -> Iterable["models.MonitoredResourceListResponse"] """List the resources currently being monitored by the Datadog monitor resource. List the resources currently being monitored by the Datadog monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either MonitoredResourceListResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.MonitoredResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MonitoredResourceListResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list_monitored_resources.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.post(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): deserialized = self._deserialize('MonitoredResourceListResponse', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) list_monitored_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/listMonitoredResources'} # type: ignore def list( self, **kwargs # type: Any ): # type: (...) -> Iterable["models.DatadogMonitorResourceListResponse"] """List all monitors under the specified subscription. List all monitors under the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogMonitorResourceListResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.DatadogMonitorResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogMonitorResourceListResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): deserialized = self._deserialize('DatadogMonitorResourceListResponse', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/monitors'} # type: ignore def list_by_resource_group( self, resource_group_name, # type: str **kwargs # type: Any ): # type: (...) -> Iterable["models.DatadogMonitorResourceListResponse"] """List all monitors under the specified resource group. List all monitors under the specified resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogMonitorResourceListResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.DatadogMonitorResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogMonitorResourceListResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): deserialized = self._deserialize('DatadogMonitorResourceListResponse', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors'} # type: ignore def get( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): # type: (...) -> "models.DatadogMonitorResource" """Get the properties of a specific monitor resource. Get the properties of a specific monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatadogMonitorResource, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.DatadogMonitorResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogMonitorResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DatadogMonitorResource', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'} # type: ignore def _create_initial( self, resource_group_name, # type: str monitor_name, # type: str body=None, # type: Optional["models.DatadogMonitorResource"] **kwargs # type: Any ): # type: (...) -> "models.DatadogMonitorResource" cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogMonitorResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] if body is not None: body_content = self._serialize.body(body, 'DatadogMonitorResource') else: body_content = None body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize('DatadogMonitorResource', pipeline_response) if response.status_code == 201: deserialized = self._deserialize('DatadogMonitorResource', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'} # type: ignore def begin_create( self, resource_group_name, # type: str monitor_name, # type: str body=None, # type: Optional["models.DatadogMonitorResource"] **kwargs # type: Any ): # type: (...) -> LROPoller["models.DatadogMonitorResource"] """Create a monitor resource. Create a monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param body: :type body: ~microsoft_datadog_client.models.DatadogMonitorResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either DatadogMonitorResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~microsoft_datadog_client.models.DatadogMonitorResource] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogMonitorResource"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._create_initial( resource_group_name=resource_group_name, monitor_name=monitor_name, body=body, cls=lambda x,y,z: x, **kwargs ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): deserialized = self._deserialize('DatadogMonitorResource', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'} # type: ignore def _update_initial( self, resource_group_name, # type: str monitor_name, # type: str body=None, # type: Optional["models.DatadogMonitorResourceUpdateParameters"] **kwargs # type: Any ): # type: (...) -> "models.DatadogMonitorResource" cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogMonitorResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] if body is not None: body_content = self._serialize.body(body, 'DatadogMonitorResourceUpdateParameters') else: body_content = None body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: deserialized = self._deserialize('DatadogMonitorResource', pipeline_response) if response.status_code == 201: deserialized = self._deserialize('DatadogMonitorResource', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'} # type: ignore def begin_update( self, resource_group_name, # type: str monitor_name, # type: str body=None, # type: Optional["models.DatadogMonitorResourceUpdateParameters"] **kwargs # type: Any ): # type: (...) -> LROPoller["models.DatadogMonitorResource"] """Update a monitor resource. Update a monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param body: :type body: ~microsoft_datadog_client.models.DatadogMonitorResourceUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either DatadogMonitorResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~microsoft_datadog_client.models.DatadogMonitorResource] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogMonitorResource"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, monitor_name=monitor_name, body=body, cls=lambda x,y,z: x, **kwargs ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): deserialized = self._deserialize('DatadogMonitorResource', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'} # type: ignore def _delete_initial( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'} # type: ignore def begin_delete( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): # type: (...) -> LROPoller[None] """Delete a monitor resource. Delete a monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, monitor_name=monitor_name, cls=lambda x,y,z: x, **kwargs ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}'} # type: ignore def refresh_set_password_link( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): # type: (...) -> "models.DatadogSetPasswordLink" """Refresh the set password link and return a latest one. Refresh the set password link and return a latest one. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatadogSetPasswordLink, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.DatadogSetPasswordLink :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogSetPasswordLink"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" # Construct URL url = self.refresh_set_password_link.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), 'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.post(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DatadogSetPasswordLink', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized refresh_set_password_link.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Datadog/monitors/{monitorName}/refreshSetPasswordLink'}
class MonitorsOperations(object): '''MonitorsOperations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~microsoft_datadog_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. ''' def __init__(self, client, config, serializer, deserializer): pass def list_api_keys( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): '''List the api keys for a given monitor resource. List the api keys for a given monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogApiKeyListResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.DatadogApiKeyListResponse] :raises: ~azure.core.exceptions.HttpResponseError ''' pass def prepare_request(next_link=None): pass def extract_data(pipeline_response): pass def get_next(next_link=None): pass def get_default_key( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): '''Get the default api key. Get the default api key. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatadogApiKey, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.DatadogApiKey :raises: ~azure.core.exceptions.HttpResponseError ''' pass def set_default_key( self, resource_group_name, # type: str monitor_name, # type: str body=None, # type: Optional["models.DatadogApiKey"] **kwargs # type: Any ): '''Set the default api key. Set the default api key. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param body: :type body: ~microsoft_datadog_client.models.DatadogApiKey :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None :raises: ~azure.core.exceptions.HttpResponseError ''' pass def list_hosts( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): '''List the hosts for a given monitor resource. List the hosts for a given monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogHostListResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.DatadogHostListResponse] :raises: ~azure.core.exceptions.HttpResponseError ''' pass def prepare_request(next_link=None): pass def extract_data(pipeline_response): pass def get_next(next_link=None): pass def list_linked_resources( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): '''List all Azure resources associated to the same Datadog organization as the target resource. List all Azure resources associated to the same Datadog organization as the target resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either LinkedResourceListResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.LinkedResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError ''' pass def prepare_request(next_link=None): pass def extract_data(pipeline_response): pass def get_next(next_link=None): pass def list_monitored_resources( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): '''List the resources currently being monitored by the Datadog monitor resource. List the resources currently being monitored by the Datadog monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either MonitoredResourceListResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.MonitoredResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError ''' pass def prepare_request(next_link=None): pass def extract_data(pipeline_response): pass def get_next(next_link=None): pass def list_api_keys( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): '''List all monitors under the specified subscription. List all monitors under the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogMonitorResourceListResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.DatadogMonitorResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError ''' pass def prepare_request(next_link=None): pass def extract_data(pipeline_response): pass def get_next(next_link=None): pass def list_by_resource_group( self, resource_group_name, # type: str **kwargs # type: Any ): '''List all monitors under the specified resource group. List all monitors under the specified resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogMonitorResourceListResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.DatadogMonitorResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError ''' pass def prepare_request(next_link=None): pass def extract_data(pipeline_response): pass def get_next(next_link=None): pass def get_next(next_link=None): '''Get the properties of a specific monitor resource. Get the properties of a specific monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatadogMonitorResource, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.DatadogMonitorResource :raises: ~azure.core.exceptions.HttpResponseError ''' pass def _create_initial( self, resource_group_name, # type: str monitor_name, # type: str body=None, # type: Optional["models.DatadogMonitorResource"] **kwargs # type: Any ): pass def begin_create( self, resource_group_name, # type: str monitor_name, # type: str body=None, # type: Optional["models.DatadogMonitorResource"] **kwargs # type: Any ): '''Create a monitor resource. Create a monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param body: :type body: ~microsoft_datadog_client.models.DatadogMonitorResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either DatadogMonitorResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~microsoft_datadog_client.models.DatadogMonitorResource] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def get_long_running_output(pipeline_response): pass def _update_initial( self, resource_group_name, # type: str monitor_name, # type: str body=None, # type: Optional["models.DatadogMonitorResourceUpdateParameters"] **kwargs # type: Any ): pass def begin_update( self, resource_group_name, # type: str monitor_name, # type: str body=None, # type: Optional["models.DatadogMonitorResourceUpdateParameters"] **kwargs # type: Any ): '''Update a monitor resource. Update a monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :param body: :type body: ~microsoft_datadog_client.models.DatadogMonitorResourceUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either DatadogMonitorResource or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~microsoft_datadog_client.models.DatadogMonitorResource] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def get_long_running_output(pipeline_response): pass def _delete_initial( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): pass def begin_delete( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): '''Delete a monitor resource. Delete a monitor resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def get_long_running_output(pipeline_response): pass def refresh_set_password_link( self, resource_group_name, # type: str monitor_name, # type: str **kwargs # type: Any ): '''Refresh the set password link and return a latest one. Refresh the set password link and return a latest one. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param monitor_name: Monitor resource name. :type monitor_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DatadogSetPasswordLink, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.DatadogSetPasswordLink :raises: ~azure.core.exceptions.HttpResponseError ''' pass
39
14
35
5
24
10
2
0.5
1
0
0
0
17
4
17
17
1,118
170
725
337
604
359
494
255
455
6
1
1
92
8,816
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.LinkedResourceListResponse
class LinkedResourceListResponse(msrest.serialization.Model): """Response of a list operation. :param value: Results of a list operation. :type value: list[~microsoft_datadog_client.models.LinkedResource] :param next_link: Link to the next set of results, if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[LinkedResource]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, value: Optional[List["LinkedResource"]] = None, next_link: Optional[str] = None, **kwargs ): super(LinkedResourceListResponse, self).__init__(**kwargs) self.value = value self.next_link = next_link
class LinkedResourceListResponse(msrest.serialization.Model): '''Response of a list operation. :param value: Results of a list operation. :type value: list[~microsoft_datadog_client.models.LinkedResource] :param next_link: Link to the next set of results, if any. :type next_link: str ''' def __init__( self, *, value: Optional[List["LinkedResource"]] = None, next_link: Optional[str] = None, **kwargs ): pass
2
1
10
0
10
0
1
0.4
1
2
0
0
1
2
1
1
24
3
15
11
7
6
6
5
4
1
1
0
1
8,817
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.LogRules
class LogRules(msrest.serialization.Model): """Set of rules for sending logs for the Monitor resource. :param send_aad_logs: Flag specifying if AAD logs should be sent for the Monitor resource. :type send_aad_logs: bool :param send_subscription_logs: Flag specifying if Azure subscription logs should be sent for the Monitor resource. :type send_subscription_logs: bool :param send_resource_logs: Flag specifying if Azure resource logs should be sent for the Monitor resource. :type send_resource_logs: bool :param filtering_tags: List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. :type filtering_tags: list[~microsoft_datadog_client.models.FilteringTag] """ _attribute_map = { 'send_aad_logs': {'key': 'sendAadLogs', 'type': 'bool'}, 'send_subscription_logs': {'key': 'sendSubscriptionLogs', 'type': 'bool'}, 'send_resource_logs': {'key': 'sendResourceLogs', 'type': 'bool'}, 'filtering_tags': {'key': 'filteringTags', 'type': '[FilteringTag]'}, } def __init__( self, *, send_aad_logs: Optional[bool] = None, send_subscription_logs: Optional[bool] = None, send_resource_logs: Optional[bool] = None, filtering_tags: Optional[List["FilteringTag"]] = None, **kwargs ): super(LogRules, self).__init__(**kwargs) self.send_aad_logs = send_aad_logs self.send_subscription_logs = send_subscription_logs self.send_resource_logs = send_resource_logs self.filtering_tags = filtering_tags
class LogRules(msrest.serialization.Model): '''Set of rules for sending logs for the Monitor resource. :param send_aad_logs: Flag specifying if AAD logs should be sent for the Monitor resource. :type send_aad_logs: bool :param send_subscription_logs: Flag specifying if Azure subscription logs should be sent for the Monitor resource. :type send_subscription_logs: bool :param send_resource_logs: Flag specifying if Azure resource logs should be sent for the Monitor resource. :type send_resource_logs: bool :param filtering_tags: List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. :type filtering_tags: list[~microsoft_datadog_client.models.FilteringTag] ''' def __init__( self, *, send_aad_logs: Optional[bool] = None, send_subscription_logs: Optional[bool] = None, send_resource_logs: Optional[bool] = None, filtering_tags: Optional[List["FilteringTag"]] = None, **kwargs ): pass
2
1
14
0
14
0
1
0.71
1
2
0
0
1
4
1
1
39
3
21
15
11
15
8
7
6
1
1
0
1
8,818
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.MetricRules
class MetricRules(msrest.serialization.Model): """Set of rules for sending metrics for the Monitor resource. :param filtering_tags: List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. :type filtering_tags: list[~microsoft_datadog_client.models.FilteringTag] """ _attribute_map = { 'filtering_tags': {'key': 'filteringTags', 'type': '[FilteringTag]'}, } def __init__( self, *, filtering_tags: Optional[List["FilteringTag"]] = None, **kwargs ): super(MetricRules, self).__init__(**kwargs) self.filtering_tags = filtering_tags
class MetricRules(msrest.serialization.Model): '''Set of rules for sending metrics for the Monitor resource. :param filtering_tags: List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags. :type filtering_tags: list[~microsoft_datadog_client.models.FilteringTag] ''' def __init__( self, *, filtering_tags: Optional[List["FilteringTag"]] = None, **kwargs ): pass
2
1
8
0
8
0
1
0.58
1
1
0
0
1
1
1
1
22
3
12
9
5
7
5
4
3
1
1
0
1
8,819
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.MonitorProperties
class MonitorProperties(msrest.serialization.Model): """Properties specific to the monitor resource. Variables are only populated by the server, and will be ignored when sending a request. :ivar provisioning_state: Possible values include: "Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified". :vartype provisioning_state: str or ~microsoft_datadog_client.models.ProvisioningState :param monitoring_status: Flag specifying if the resource monitoring is enabled or disabled. Possible values include: "Enabled", "Disabled". Default value: "Enabled". :type monitoring_status: str or ~microsoft_datadog_client.models.MonitoringStatus :ivar marketplace_subscription_status: Flag specifying the Marketplace Subscription Status of the resource. If payment is not made in time, the resource will go in Suspended state. Possible values include: "Provisioning", "Active", "Suspended", "Unsubscribed". :vartype marketplace_subscription_status: str or ~microsoft_datadog_client.models.MarketplaceSubscriptionStatus :param datadog_organization_properties: Datadog organization properties. :type datadog_organization_properties: ~microsoft_datadog_client.models.DatadogOrganizationProperties :param user_info: User info. :type user_info: ~microsoft_datadog_client.models.UserInfo :ivar liftr_resource_category: Possible values include: "Unknown", "MonitorLogs". :vartype liftr_resource_category: str or ~microsoft_datadog_client.models.LiftrResourceCategories :ivar liftr_resource_preference: The priority of the resource. :vartype liftr_resource_preference: int """ _validation = { 'provisioning_state': {'readonly': True}, 'marketplace_subscription_status': {'readonly': True}, 'liftr_resource_category': {'readonly': True}, 'liftr_resource_preference': {'readonly': True}, } _attribute_map = { 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'monitoring_status': {'key': 'monitoringStatus', 'type': 'str'}, 'marketplace_subscription_status': {'key': 'marketplaceSubscriptionStatus', 'type': 'str'}, 'datadog_organization_properties': {'key': 'datadogOrganizationProperties', 'type': 'DatadogOrganizationProperties'}, 'user_info': {'key': 'userInfo', 'type': 'UserInfo'}, 'liftr_resource_category': {'key': 'liftrResourceCategory', 'type': 'str'}, 'liftr_resource_preference': {'key': 'liftrResourcePreference', 'type': 'int'}, } def __init__( self, *, monitoring_status: Optional[Union[str, "MonitoringStatus"]] = "Enabled", datadog_organization_properties: Optional["DatadogOrganizationProperties"] = None, user_info: Optional["UserInfo"] = None, **kwargs ): super(MonitorProperties, self).__init__(**kwargs) self.provisioning_state = None self.monitoring_status = monitoring_status self.marketplace_subscription_status = None self.datadog_organization_properties = datadog_organization_properties self.user_info = user_info self.liftr_resource_category = None self.liftr_resource_preference = None
class MonitorProperties(msrest.serialization.Model): '''Properties specific to the monitor resource. Variables are only populated by the server, and will be ignored when sending a request. :ivar provisioning_state: Possible values include: "Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified". :vartype provisioning_state: str or ~microsoft_datadog_client.models.ProvisioningState :param monitoring_status: Flag specifying if the resource monitoring is enabled or disabled. Possible values include: "Enabled", "Disabled". Default value: "Enabled". :type monitoring_status: str or ~microsoft_datadog_client.models.MonitoringStatus :ivar marketplace_subscription_status: Flag specifying the Marketplace Subscription Status of the resource. If payment is not made in time, the resource will go in Suspended state. Possible values include: "Provisioning", "Active", "Suspended", "Unsubscribed". :vartype marketplace_subscription_status: str or ~microsoft_datadog_client.models.MarketplaceSubscriptionStatus :param datadog_organization_properties: Datadog organization properties. :type datadog_organization_properties: ~microsoft_datadog_client.models.DatadogOrganizationProperties :param user_info: User info. :type user_info: ~microsoft_datadog_client.models.UserInfo :ivar liftr_resource_category: Possible values include: "Unknown", "MonitorLogs". :vartype liftr_resource_category: str or ~microsoft_datadog_client.models.LiftrResourceCategories :ivar liftr_resource_preference: The priority of the resource. :vartype liftr_resource_preference: int ''' def __init__( self, *, monitoring_status: Optional[Union[str, "MonitoringStatus"]] = "Enabled", datadog_organization_properties: Optional["DatadogOrganizationProperties"] = None, user_info: Optional["UserInfo"] = None, **kwargs ): pass
2
1
16
0
16
0
1
0.75
1
2
0
0
1
7
1
1
61
5
32
18
23
24
12
11
10
1
1
0
1
8,820
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.MonitorUpdateProperties
class MonitorUpdateProperties(msrest.serialization.Model): """The set of properties that can be update in a PATCH request to a monitor resource. :param monitoring_status: Flag specifying if the resource monitoring is enabled or disabled. Possible values include: "Enabled", "Disabled". Default value: "Enabled". :type monitoring_status: str or ~microsoft_datadog_client.models.MonitoringStatus """ _attribute_map = { 'monitoring_status': {'key': 'monitoringStatus', 'type': 'str'}, } def __init__( self, *, monitoring_status: Optional[Union[str, "MonitoringStatus"]] = "Enabled", **kwargs ): super(MonitorUpdateProperties, self).__init__(**kwargs) self.monitoring_status = monitoring_status
class MonitorUpdateProperties(msrest.serialization.Model): '''The set of properties that can be update in a PATCH request to a monitor resource. :param monitoring_status: Flag specifying if the resource monitoring is enabled or disabled. Possible values include: "Enabled", "Disabled". Default value: "Enabled". :type monitoring_status: str or ~microsoft_datadog_client.models.MonitoringStatus ''' def __init__( self, *, monitoring_status: Optional[Union[str, "MonitoringStatus"]] = "Enabled", **kwargs ): pass
2
1
8
0
8
0
1
0.42
1
2
0
0
1
1
1
1
20
3
12
9
5
5
5
4
3
1
1
0
1
8,821
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.MonitoredResource
class MonitoredResource(msrest.serialization.Model): """The properties of a resource currently being monitored by the Datadog monitor resource. :param id: The ARM id of the resource. :type id: str :param sending_metrics: Flag indicating if resource is sending metrics to Datadog. :type sending_metrics: bool :param reason_for_metrics_status: Reason for why the resource is sending metrics (or why it is not sending). :type reason_for_metrics_status: str :param sending_logs: Flag indicating if resource is sending logs to Datadog. :type sending_logs: bool :param reason_for_logs_status: Reason for why the resource is sending logs (or why it is not sending). :type reason_for_logs_status: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'sending_metrics': {'key': 'sendingMetrics', 'type': 'bool'}, 'reason_for_metrics_status': {'key': 'reasonForMetricsStatus', 'type': 'str'}, 'sending_logs': {'key': 'sendingLogs', 'type': 'bool'}, 'reason_for_logs_status': {'key': 'reasonForLogsStatus', 'type': 'str'}, } def __init__( self, *, id: Optional[str] = None, sending_metrics: Optional[bool] = None, reason_for_metrics_status: Optional[str] = None, sending_logs: Optional[bool] = None, reason_for_logs_status: Optional[str] = None, **kwargs ): super(MonitoredResource, self).__init__(**kwargs) self.id = id self.sending_metrics = sending_metrics self.reason_for_metrics_status = reason_for_metrics_status self.sending_logs = sending_logs self.reason_for_logs_status = reason_for_logs_status
class MonitoredResource(msrest.serialization.Model): '''The properties of a resource currently being monitored by the Datadog monitor resource. :param id: The ARM id of the resource. :type id: str :param sending_metrics: Flag indicating if resource is sending metrics to Datadog. :type sending_metrics: bool :param reason_for_metrics_status: Reason for why the resource is sending metrics (or why it is not sending). :type reason_for_metrics_status: str :param sending_logs: Flag indicating if resource is sending logs to Datadog. :type sending_logs: bool :param reason_for_logs_status: Reason for why the resource is sending logs (or why it is not sending). :type reason_for_logs_status: str ''' def __init__( self, *, id: Optional[str] = None, sending_metrics: Optional[bool] = None, reason_for_metrics_status: Optional[str] = None, sending_logs: Optional[bool] = None, reason_for_logs_status: Optional[str] = None, **kwargs ): pass
2
1
16
0
16
0
1
0.58
1
3
0
0
1
5
1
1
41
3
24
17
13
14
9
8
7
1
1
0
1
8,822
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.MonitoredResourceListResponse
class MonitoredResourceListResponse(msrest.serialization.Model): """Response of a list operation. :param value: Results of a list operation. :type value: list[~microsoft_datadog_client.models.MonitoredResource] :param next_link: Link to the next set of results, if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[MonitoredResource]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, value: Optional[List["MonitoredResource"]] = None, next_link: Optional[str] = None, **kwargs ): super(MonitoredResourceListResponse, self).__init__(**kwargs) self.value = value self.next_link = next_link
class MonitoredResourceListResponse(msrest.serialization.Model): '''Response of a list operation. :param value: Results of a list operation. :type value: list[~microsoft_datadog_client.models.MonitoredResource] :param next_link: Link to the next set of results, if any. :type next_link: str ''' def __init__( self, *, value: Optional[List["MonitoredResource"]] = None, next_link: Optional[str] = None, **kwargs ): pass
2
1
10
0
10
0
1
0.4
1
2
0
0
1
2
1
1
24
3
15
11
7
6
6
5
4
1
1
0
1
8,823
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.MonitoringTagRules
class MonitoringTagRules(msrest.serialization.Model): """Capture logs and metrics of Azure resources based on ARM tags. Variables are only populated by the server, and will be ignored when sending a request. :ivar name: Name of the rule set. :vartype name: str :ivar id: The id of the rule set. :vartype id: str :ivar type: The type of the rule set. :vartype type: str :param properties: Definition of the properties for a TagRules resource. :type properties: ~microsoft_datadog_client.models.MonitoringTagRulesProperties :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~microsoft_datadog_client.models.SystemData """ _validation = { 'name': {'readonly': True}, 'id': {'readonly': True}, 'type': {'readonly': True}, 'system_data': {'readonly': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'MonitoringTagRulesProperties'}, 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__( self, *, properties: Optional["MonitoringTagRulesProperties"] = None, **kwargs ): super(MonitoringTagRules, self).__init__(**kwargs) self.name = None self.id = None self.type = None self.properties = properties self.system_data = None
class MonitoringTagRules(msrest.serialization.Model): '''Capture logs and metrics of Azure resources based on ARM tags. Variables are only populated by the server, and will be ignored when sending a request. :ivar name: Name of the rule set. :vartype name: str :ivar id: The id of the rule set. :vartype id: str :ivar type: The type of the rule set. :vartype type: str :param properties: Definition of the properties for a TagRules resource. :type properties: ~microsoft_datadog_client.models.MonitoringTagRulesProperties :ivar system_data: Metadata pertaining to creation and last modification of the resource. :vartype system_data: ~microsoft_datadog_client.models.SystemData ''' def __init__( self, *, properties: Optional["MonitoringTagRulesProperties"] = None, **kwargs ): pass
2
1
12
0
12
0
1
0.5
1
1
0
0
1
5
1
1
44
5
26
14
19
13
10
9
8
1
1
0
1
8,824
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.MonitoringTagRulesListResponse
class MonitoringTagRulesListResponse(msrest.serialization.Model): """Response of a list operation. :param value: Results of a list operation. :type value: list[~microsoft_datadog_client.models.MonitoringTagRules] :param next_link: Link to the next set of results, if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[MonitoringTagRules]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, value: Optional[List["MonitoringTagRules"]] = None, next_link: Optional[str] = None, **kwargs ): super(MonitoringTagRulesListResponse, self).__init__(**kwargs) self.value = value self.next_link = next_link
class MonitoringTagRulesListResponse(msrest.serialization.Model): '''Response of a list operation. :param value: Results of a list operation. :type value: list[~microsoft_datadog_client.models.MonitoringTagRules] :param next_link: Link to the next set of results, if any. :type next_link: str ''' def __init__( self, *, value: Optional[List["MonitoringTagRules"]] = None, next_link: Optional[str] = None, **kwargs ): pass
2
1
10
0
10
0
1
0.4
1
2
0
0
1
2
1
1
24
3
15
11
7
6
6
5
4
1
1
0
1
8,825
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.MonitoringTagRulesProperties
class MonitoringTagRulesProperties(msrest.serialization.Model): """Definition of the properties for a TagRules resource. Variables are only populated by the server, and will be ignored when sending a request. :ivar provisioning_state: Possible values include: "Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified". :vartype provisioning_state: str or ~microsoft_datadog_client.models.ProvisioningState :param log_rules: Set of rules for sending logs for the Monitor resource. :type log_rules: ~microsoft_datadog_client.models.LogRules :param metric_rules: Set of rules for sending metrics for the Monitor resource. :type metric_rules: ~microsoft_datadog_client.models.MetricRules """ _validation = { 'provisioning_state': {'readonly': True}, } _attribute_map = { 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'log_rules': {'key': 'logRules', 'type': 'LogRules'}, 'metric_rules': {'key': 'metricRules', 'type': 'MetricRules'}, } def __init__( self, *, log_rules: Optional["LogRules"] = None, metric_rules: Optional["MetricRules"] = None, **kwargs ): super(MonitoringTagRulesProperties, self).__init__(**kwargs) self.provisioning_state = None self.log_rules = log_rules self.metric_rules = metric_rules
class MonitoringTagRulesProperties(msrest.serialization.Model): '''Definition of the properties for a TagRules resource. Variables are only populated by the server, and will be ignored when sending a request. :ivar provisioning_state: Possible values include: "Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified". :vartype provisioning_state: str or ~microsoft_datadog_client.models.ProvisioningState :param log_rules: Set of rules for sending logs for the Monitor resource. :type log_rules: ~microsoft_datadog_client.models.LogRules :param metric_rules: Set of rules for sending metrics for the Monitor resource. :type metric_rules: ~microsoft_datadog_client.models.MetricRules ''' def __init__( self, *, log_rules: Optional["LogRules"] = None, metric_rules: Optional["MetricRules"] = None, **kwargs ): pass
2
1
11
0
11
0
1
0.5
1
1
0
0
1
3
1
1
35
5
20
13
12
10
8
7
6
1
1
0
1
8,826
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.OperationDisplay
class OperationDisplay(msrest.serialization.Model): """The object that represents the operation. :param provider: Service provider, i.e., Microsoft.Datadog. :type provider: str :param resource: Type on which the operation is performed, e.g., 'monitors'. :type resource: str :param operation: Operation type, e.g., read, write, delete, etc. :type operation: str :param description: Description of the operation, e.g., 'Write monitors'. :type description: str """ _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, 'operation': {'key': 'operation', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, } def __init__( self, *, provider: Optional[str] = None, resource: Optional[str] = None, operation: Optional[str] = None, description: Optional[str] = None, **kwargs ): super(OperationDisplay, self).__init__(**kwargs) self.provider = provider self.resource = resource self.operation = operation self.description = description
class OperationDisplay(msrest.serialization.Model): '''The object that represents the operation. :param provider: Service provider, i.e., Microsoft.Datadog. :type provider: str :param resource: Type on which the operation is performed, e.g., 'monitors'. :type resource: str :param operation: Operation type, e.g., read, write, delete, etc. :type operation: str :param description: Description of the operation, e.g., 'Write monitors'. :type description: str ''' def __init__( self, *, provider: Optional[str] = None, resource: Optional[str] = None, operation: Optional[str] = None, description: Optional[str] = None, **kwargs ): pass
2
1
14
0
14
0
1
0.48
1
2
0
0
1
4
1
1
34
3
21
15
11
10
8
7
6
1
1
0
1
8,827
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.OperationListResult
class OperationListResult(msrest.serialization.Model): """Result of GET request to list the Microsoft.Datadog operations. :param value: List of operations supported by the Microsoft.Datadog provider. :type value: list[~microsoft_datadog_client.models.OperationResult] :param next_link: URL to get the next set of operation list results if there are any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[OperationResult]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, *, value: Optional[List["OperationResult"]] = None, next_link: Optional[str] = None, **kwargs ): super(OperationListResult, self).__init__(**kwargs) self.value = value self.next_link = next_link
class OperationListResult(msrest.serialization.Model): '''Result of GET request to list the Microsoft.Datadog operations. :param value: List of operations supported by the Microsoft.Datadog provider. :type value: list[~microsoft_datadog_client.models.OperationResult] :param next_link: URL to get the next set of operation list results if there are any. :type next_link: str ''' def __init__( self, *, value: Optional[List["OperationResult"]] = None, next_link: Optional[str] = None, **kwargs ): pass
2
1
10
0
10
0
1
0.4
1
2
0
0
1
2
1
1
24
3
15
11
7
6
6
5
4
1
1
0
1
8,828
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.OperationResult
class OperationResult(msrest.serialization.Model): """A Microsoft.Datadog REST API operation. :param name: Operation name, i.e., {provider}/{resource}/{operation}. :type name: str :param display: The object that represents the operation. :type display: ~microsoft_datadog_client.models.OperationDisplay :param is_data_action: Indicates whether the operation is a data action. :type is_data_action: bool """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, } def __init__( self, *, name: Optional[str] = None, display: Optional["OperationDisplay"] = None, is_data_action: Optional[bool] = None, **kwargs ): super(OperationResult, self).__init__(**kwargs) self.name = name self.display = display self.is_data_action = is_data_action
class OperationResult(msrest.serialization.Model): '''A Microsoft.Datadog REST API operation. :param name: Operation name, i.e., {provider}/{resource}/{operation}. :type name: str :param display: The object that represents the operation. :type display: ~microsoft_datadog_client.models.OperationDisplay :param is_data_action: Indicates whether the operation is a data action. :type is_data_action: bool ''' def __init__( self, *, name: Optional[str] = None, display: Optional["OperationDisplay"] = None, is_data_action: Optional[bool] = None, **kwargs ): pass
2
1
12
0
12
0
1
0.44
1
3
0
0
1
3
1
1
29
3
18
13
9
8
7
6
5
1
1
0
1
8,829
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.ResourceSku
class ResourceSku(msrest.serialization.Model): """ResourceSku. All required parameters must be populated in order to send to Azure. :param name: Required. Name of the SKU. :type name: str """ _validation = { 'name': {'required': True}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, } def __init__( self, *, name: str, **kwargs ): super(ResourceSku, self).__init__(**kwargs) self.name = name
class ResourceSku(msrest.serialization.Model): '''ResourceSku. All required parameters must be populated in order to send to Azure. :param name: Required. Name of the SKU. :type name: str ''' def __init__( self, *, name: str, **kwargs ): pass
2
1
8
0
8
0
1
0.33
1
2
0
0
1
1
1
1
25
5
15
10
8
5
6
5
4
1
1
0
1
8,830
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.SystemData
class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. :param created_by: The identity that created the resource. :type created_by: str :param created_by_type: The type of identity that created the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". :type created_by_type: str or ~microsoft_datadog_client.models.CreatedByType :param created_at: The timestamp of resource creation (UTC). :type created_at: ~datetime.datetime :param last_modified_by: The identity that last modified the resource. :type last_modified_by: str :param last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". :type last_modified_by_type: str or ~microsoft_datadog_client.models.CreatedByType :param last_modified_at: The timestamp of resource last modification (UTC). :type last_modified_at: ~datetime.datetime """ _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'str'}, 'created_by_type': {'key': 'createdByType', 'type': 'str'}, 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, } def __init__( self, *, created_by: Optional[str] = None, created_by_type: Optional[Union[str, "CreatedByType"]] = None, created_at: Optional[datetime.datetime] = None, last_modified_by: Optional[str] = None, last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, **kwargs ): super(SystemData, self).__init__(**kwargs) self.created_by = created_by self.created_by_type = created_by_type self.created_at = created_at self.last_modified_by = last_modified_by self.last_modified_by_type = last_modified_by_type self.last_modified_at = last_modified_at
class SystemData(msrest.serialization.Model): '''Metadata pertaining to creation and last modification of the resource. :param created_by: The identity that created the resource. :type created_by: str :param created_by_type: The type of identity that created the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". :type created_by_type: str or ~microsoft_datadog_client.models.CreatedByType :param created_at: The timestamp of resource creation (UTC). :type created_at: ~datetime.datetime :param last_modified_by: The identity that last modified the resource. :type last_modified_by: str :param last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". :type last_modified_by_type: str or ~microsoft_datadog_client.models.CreatedByType :param last_modified_at: The timestamp of resource last modification (UTC). :type last_modified_at: ~datetime.datetime ''' def __init__( self, *, created_by: Optional[str] = None, created_by_type: Optional[Union[str, "CreatedByType"]] = None, created_at: Optional[datetime.datetime] = None, last_modified_by: Optional[str] = None, last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, **kwargs ): pass
2
1
18
0
18
0
1
0.59
1
3
0
0
1
6
1
1
46
3
27
19
15
16
10
9
8
1
1
0
1
8,831
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.UserInfo
class UserInfo(msrest.serialization.Model): """User info. :param name: Name of the user. :type name: str :param email_address: Email of the user used by Datadog for contacting them if needed. :type email_address: str :param phone_number: Phone number of the user used by Datadog for contacting them if needed. :type phone_number: str """ _validation = { 'name': {'max_length': 50, 'min_length': 0}, 'email_address': {'pattern': r'^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\.)+[A-Za-z]{2,}$'}, 'phone_number': {'max_length': 40, 'min_length': 0}, } _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'email_address': {'key': 'emailAddress', 'type': 'str'}, 'phone_number': {'key': 'phoneNumber', 'type': 'str'}, } def __init__( self, *, name: Optional[str] = None, email_address: Optional[str] = None, phone_number: Optional[str] = None, **kwargs ): super(UserInfo, self).__init__(**kwargs) self.name = name self.email_address = email_address self.phone_number = phone_number
class UserInfo(msrest.serialization.Model): '''User info. :param name: Name of the user. :type name: str :param email_address: Email of the user used by Datadog for contacting them if needed. :type email_address: str :param phone_number: Phone number of the user used by Datadog for contacting them if needed. :type phone_number: str ''' def __init__( self, *, name: Optional[str] = None, email_address: Optional[str] = None, phone_number: Optional[str] = None, **kwargs ): pass
2
1
12
0
12
0
1
0.35
1
2
0
0
1
3
1
1
35
4
23
14
14
8
8
7
6
1
1
0
1
8,832
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/operations/_marketplace_agreements_operations.py
azext_datadog.vendored_sdks.datadog.operations._marketplace_agreements_operations.MarketplaceAgreementsOperations
class MarketplaceAgreementsOperations(object): """MarketplaceAgreementsOperations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~microsoft_datadog_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. """ models = models def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self._config = config def list( self, **kwargs # type: Any ): # type: (...) -> Iterable["models.DatadogAgreementResourceListResponse"] """List Datadog marketplace agreements in the subscription. List Datadog marketplace agreements in the subscription. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogAgreementResourceListResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.DatadogAgreementResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogAgreementResourceListResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): deserialized = self._deserialize('DatadogAgreementResourceListResponse', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements'} # type: ignore def create_or_update( self, body=None, # type: Optional["models.DatadogAgreementResource"] **kwargs # type: Any ): # type: (...) -> "models.DatadogAgreementResource" """Create Datadog marketplace agreement in the subscription. Create Datadog marketplace agreement in the subscription. :param body: :type body: ~microsoft_datadog_client.models.DatadogAgreementResource :keyword callable cls: A custom type or function that will be passed the direct response :return: DatadogAgreementResource, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.DatadogAgreementResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogAgreementResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] if body is not None: body_content = self._serialize.body(body, 'DatadogAgreementResource') else: body_content = None body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('DatadogAgreementResource', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements/default'}
class MarketplaceAgreementsOperations(object): '''MarketplaceAgreementsOperations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~microsoft_datadog_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. ''' def __init__(self, client, config, serializer, deserializer): pass def list( self, **kwargs # type: Any ): '''List Datadog marketplace agreements in the subscription. List Datadog marketplace agreements in the subscription. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DatadogAgreementResourceListResponse or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.DatadogAgreementResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError ''' pass def prepare_request(next_link=None): pass def extract_data(pipeline_response): pass def get_next(next_link=None): pass def create_or_update( self, body=None, # type: Optional["models.DatadogAgreementResource"] **kwargs # type: Any ): '''Create Datadog marketplace agreement in the subscription. Create Datadog marketplace agreement in the subscription. :param body: :type body: ~microsoft_datadog_client.models.DatadogAgreementResource :keyword callable cls: A custom type or function that will be passed the direct response :return: DatadogAgreementResource, or the result of cls(response) :rtype: ~microsoft_datadog_client.models.DatadogAgreementResource :raises: ~azure.core.exceptions.HttpResponseError ''' pass
7
3
29
4
21
7
2
0.52
1
0
0
0
3
4
3
3
156
27
95
50
81
49
76
43
69
4
1
1
12
8,833
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/operations/_operations.py
azext_datadog.vendored_sdks.datadog.operations._operations.Operations
class Operations(object): """Operations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~microsoft_datadog_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. """ models = models def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self._config = config def list( self, **kwargs # type: Any ): # type: (...) -> Iterable["models.OperationListResult"] """List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): deserialized = self._deserialize('OperationListResult', pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: error = self._deserialize(models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) list.metadata = {'url': '/providers/Microsoft.Datadog/operations'}
class Operations(object): '''Operations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~microsoft_datadog_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. ''' def __init__(self, client, config, serializer, deserializer): pass def list( self, **kwargs # type: Any ): '''List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. List all operations provided by Microsoft.Datadog for the 2021-03-01 api version. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~microsoft_datadog_client.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError ''' pass def prepare_request(next_link=None): pass def extract_data(pipeline_response): pass def get_next(next_link=None): pass
6
2
21
3
15
5
2
0.56
1
0
0
0
2
4
2
2
87
16
50
28
41
28
42
25
36
2
1
1
8
8,834
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_data_flows_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._data_flows_operations.DataFlowsOperations
class DataFlowsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`data_flows` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload async def create_or_update( self, resource_group_name: str, factory_name: str, data_flow_name: str, data_flow: _models.DataFlowResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DataFlowResource: """Creates or updates a data flow. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param data_flow_name: The data flow name. Required. :type data_flow_name: str :param data_flow: Data flow resource definition. Required. :type data_flow: ~azure.mgmt.datafactory.models.DataFlowResource :param if_match: ETag of the data flow entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: DataFlowResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.DataFlowResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_or_update( self, resource_group_name: str, factory_name: str, data_flow_name: str, data_flow: IO[bytes], if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DataFlowResource: """Creates or updates a data flow. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param data_flow_name: The data flow name. Required. :type data_flow_name: str :param data_flow: Data flow resource definition. Required. :type data_flow: IO[bytes] :param if_match: ETag of the data flow entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: DataFlowResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.DataFlowResource :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, data_flow_name: str, data_flow: Union[_models.DataFlowResource, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any ) -> _models.DataFlowResource: """Creates or updates a data flow. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param data_flow_name: The data flow name. Required. :type data_flow_name: str :param data_flow: Data flow resource definition. Is either a DataFlowResource type or a IO[bytes] type. Required. :type data_flow: ~azure.mgmt.datafactory.models.DataFlowResource or IO[bytes] :param if_match: ETag of the data flow entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: DataFlowResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.DataFlowResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DataFlowResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(data_flow, (IOBase, bytes)): _content = data_flow else: _json = self._serialize.body(data_flow, "DataFlowResource") _request = build_create_or_update_request( resource_group_name=resource_group_name, factory_name=factory_name, data_flow_name=data_flow_name, subscription_id=self._config.subscription_id, if_match=if_match, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("DataFlowResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, data_flow_name: str, if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.DataFlowResource: """Gets a data flow. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param data_flow_name: The data flow name. Required. :type data_flow_name: str :param if_none_match: ETag of the data flow entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: DataFlowResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.DataFlowResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataFlowResource] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, factory_name=factory_name, data_flow_name=data_flow_name, subscription_id=self._config.subscription_id, if_none_match=if_none_match, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("DataFlowResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def delete(self, resource_group_name: str, factory_name: str, data_flow_name: str, **kwargs: Any) -> None: """Deletes a data flow. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param data_flow_name: The data flow name. Required. :type data_flow_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, factory_name=factory_name, data_flow_name=data_flow_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.DataFlowResource"]: """Lists data flows. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either DataFlowResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.DataFlowResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataFlowListResponse] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): if not next_link: _request = build_list_by_factory_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version _parsed_next_link = urllib.parse.urlparse(next_link) _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DataFlowListResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data)
class DataFlowsOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`data_flows` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, data_flow_name: str, data_flow: _models.DataFlowResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DataFlowResource: '''Creates or updates a data flow. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param data_flow_name: The data flow name. Required. :type data_flow_name: str :param data_flow: Data flow resource definition. Required. :type data_flow: ~azure.mgmt.datafactory.models.DataFlowResource :param if_match: ETag of the data flow entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: DataFlowResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.DataFlowResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, data_flow_name: str, data_flow: _models.DataFlowResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DataFlowResource: '''Creates or updates a data flow. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param data_flow_name: The data flow name. Required. :type data_flow_name: str :param data_flow: Data flow resource definition. Required. :type data_flow: IO[bytes] :param if_match: ETag of the data flow entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: DataFlowResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.DataFlowResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, data_flow_name: str, data_flow: _models.DataFlowResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DataFlowResource: '''Creates or updates a data flow. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param data_flow_name: The data flow name. Required. :type data_flow_name: str :param data_flow: Data flow resource definition. Is either a DataFlowResource type or a IO[bytes] type. Required. :type data_flow: ~azure.mgmt.datafactory.models.DataFlowResource or IO[bytes] :param if_match: ETag of the data flow entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: DataFlowResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.DataFlowResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, data_flow_name: str, if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.DataFlowResource: '''Gets a data flow. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param data_flow_name: The data flow name. Required. :type data_flow_name: str :param if_none_match: ETag of the data flow entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: DataFlowResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.DataFlowResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def delete(self, resource_group_name: str, factory_name: str, data_flow_name: str, **kwargs: Any) -> None: '''Deletes a data flow. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param data_flow_name: The data flow name. Required. :type data_flow_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.DataFlowResource"]: '''Lists data flows. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either DataFlowResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.DataFlowResource] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass
17
7
40
5
26
11
2
0.49
0
7
0
0
7
4
7
7
373
52
222
106
168
109
106
63
95
5
0
1
24
8,835
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_datasets_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._datasets_operations.DatasetsOperations
class DatasetsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`datasets` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.DatasetResource"]: """Lists datasets. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either DatasetResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.DatasetResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatasetListResponse] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): if not next_link: _request = build_list_by_factory_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version _parsed_next_link = urllib.parse.urlparse(next_link) _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): deserialized = self._deserialize("DatasetListResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) @overload async def create_or_update( self, resource_group_name: str, factory_name: str, dataset_name: str, dataset: _models.DatasetResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetResource: """Creates or updates a dataset. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param dataset_name: The dataset name. Required. :type dataset_name: str :param dataset: Dataset resource definition. Required. :type dataset: ~azure.mgmt.datafactory.models.DatasetResource :param if_match: ETag of the dataset entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: DatasetResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.DatasetResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_or_update( self, resource_group_name: str, factory_name: str, dataset_name: str, dataset: IO[bytes], if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetResource: """Creates or updates a dataset. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param dataset_name: The dataset name. Required. :type dataset_name: str :param dataset: Dataset resource definition. Required. :type dataset: IO[bytes] :param if_match: ETag of the dataset entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: DatasetResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.DatasetResource :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, dataset_name: str, dataset: Union[_models.DatasetResource, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any ) -> _models.DatasetResource: """Creates or updates a dataset. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param dataset_name: The dataset name. Required. :type dataset_name: str :param dataset: Dataset resource definition. Is either a DatasetResource type or a IO[bytes] type. Required. :type dataset: ~azure.mgmt.datafactory.models.DatasetResource or IO[bytes] :param if_match: ETag of the dataset entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: DatasetResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.DatasetResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatasetResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(dataset, (IOBase, bytes)): _content = dataset else: _json = self._serialize.body(dataset, "DatasetResource") _request = build_create_or_update_request( resource_group_name=resource_group_name, factory_name=factory_name, dataset_name=dataset_name, subscription_id=self._config.subscription_id, if_match=if_match, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("DatasetResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, dataset_name: str, if_none_match: Optional[str] = None, **kwargs: Any ) -> Optional[_models.DatasetResource]: """Gets a dataset. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param dataset_name: The dataset name. Required. :type dataset_name: str :param if_none_match: ETag of the dataset entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: DatasetResource or None or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.DatasetResource or None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Optional[_models.DatasetResource]] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, factory_name=factory_name, dataset_name=dataset_name, subscription_id=self._config.subscription_id, if_none_match=if_none_match, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 304]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: deserialized = self._deserialize("DatasetResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def delete(self, resource_group_name: str, factory_name: str, dataset_name: str, **kwargs: Any) -> None: """Deletes a dataset. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param dataset_name: The dataset name. Required. :type dataset_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, factory_name=factory_name, dataset_name=dataset_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {})
class DatasetsOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`datasets` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.DatasetResource"]: '''Lists datasets. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either DatasetResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.DatasetResource] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, dataset_name: str, dataset: _models.DatasetResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetResource: '''Creates or updates a dataset. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param dataset_name: The dataset name. Required. :type dataset_name: str :param dataset: Dataset resource definition. Required. :type dataset: ~azure.mgmt.datafactory.models.DatasetResource :param if_match: ETag of the dataset entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: DatasetResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.DatasetResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, dataset_name: str, dataset: _models.DatasetResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetResource: '''Creates or updates a dataset. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param dataset_name: The dataset name. Required. :type dataset_name: str :param dataset: Dataset resource definition. Required. :type dataset: IO[bytes] :param if_match: ETag of the dataset entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: DatasetResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.DatasetResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, dataset_name: str, dataset: _models.DatasetResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.DatasetResource: '''Creates or updates a dataset. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param dataset_name: The dataset name. Required. :type dataset_name: str :param dataset: Dataset resource definition. Is either a DatasetResource type or a IO[bytes] type. Required. :type dataset: ~azure.mgmt.datafactory.models.DatasetResource or IO[bytes] :param if_match: ETag of the dataset entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: DatasetResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.DatasetResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get_next(next_link=None): '''Gets a dataset. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param dataset_name: The dataset name. Required. :type dataset_name: str :param if_none_match: ETag of the dataset entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: DatasetResource or None or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.DatasetResource or None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def delete(self, resource_group_name: str, factory_name: str, dataset_name: str, **kwargs: Any) -> None: '''Deletes a dataset. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param dataset_name: The dataset name. Required. :type dataset_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass
17
7
40
5
26
10
3
0.48
0
7
0
0
7
4
7
7
374
52
224
106
170
108
108
63
97
5
0
1
25
8,836
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_exposure_control_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._exposure_control_operations.ExposureControlOperations
class ExposureControlOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`exposure_control` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload async def get_feature_value( self, location_id: str, exposure_control_request: _models.ExposureControlRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ExposureControlResponse: """Get exposure control feature for specific location. :param location_id: The location identifier. Required. :type location_id: str :param exposure_control_request: The exposure control request. Required. :type exposure_control_request: ~azure.mgmt.datafactory.models.ExposureControlRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: ExposureControlResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ExposureControlResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def get_feature_value( self, location_id: str, exposure_control_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.ExposureControlResponse: """Get exposure control feature for specific location. :param location_id: The location identifier. Required. :type location_id: str :param exposure_control_request: The exposure control request. Required. :type exposure_control_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: ExposureControlResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ExposureControlResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def get_feature_value( self, location_id: str, exposure_control_request: Union[_models.ExposureControlRequest, IO[bytes]], **kwargs: Any ) -> _models.ExposureControlResponse: """Get exposure control feature for specific location. :param location_id: The location identifier. Required. :type location_id: str :param exposure_control_request: The exposure control request. Is either a ExposureControlRequest type or a IO[bytes] type. Required. :type exposure_control_request: ~azure.mgmt.datafactory.models.ExposureControlRequest or IO[bytes] :return: ExposureControlResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ExposureControlResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ExposureControlResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(exposure_control_request, (IOBase, bytes)): _content = exposure_control_request else: _json = self._serialize.body(exposure_control_request, "ExposureControlRequest") _request = build_get_feature_value_request( location_id=location_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("ExposureControlResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload async def get_feature_value_by_factory( self, resource_group_name: str, factory_name: str, exposure_control_request: _models.ExposureControlRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ExposureControlResponse: """Get exposure control feature for specific factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param exposure_control_request: The exposure control request. Required. :type exposure_control_request: ~azure.mgmt.datafactory.models.ExposureControlRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: ExposureControlResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ExposureControlResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def get_feature_value_by_factory( self, resource_group_name: str, factory_name: str, exposure_control_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.ExposureControlResponse: """Get exposure control feature for specific factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param exposure_control_request: The exposure control request. Required. :type exposure_control_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: ExposureControlResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ExposureControlResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def get_feature_value_by_factory( self, resource_group_name: str, factory_name: str, exposure_control_request: Union[_models.ExposureControlRequest, IO[bytes]], **kwargs: Any ) -> _models.ExposureControlResponse: """Get exposure control feature for specific factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param exposure_control_request: The exposure control request. Is either a ExposureControlRequest type or a IO[bytes] type. Required. :type exposure_control_request: ~azure.mgmt.datafactory.models.ExposureControlRequest or IO[bytes] :return: ExposureControlResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ExposureControlResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ExposureControlResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(exposure_control_request, (IOBase, bytes)): _content = exposure_control_request else: _json = self._serialize.body(exposure_control_request, "ExposureControlRequest") _request = build_get_feature_value_by_factory_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("ExposureControlResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload async def query_feature_values_by_factory( self, resource_group_name: str, factory_name: str, exposure_control_batch_request: _models.ExposureControlBatchRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ExposureControlBatchResponse: """Get list of exposure control features for specific factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param exposure_control_batch_request: The exposure control request for list of features. Required. :type exposure_control_batch_request: ~azure.mgmt.datafactory.models.ExposureControlBatchRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: ExposureControlBatchResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ExposureControlBatchResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def query_feature_values_by_factory( self, resource_group_name: str, factory_name: str, exposure_control_batch_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.ExposureControlBatchResponse: """Get list of exposure control features for specific factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param exposure_control_batch_request: The exposure control request for list of features. Required. :type exposure_control_batch_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: ExposureControlBatchResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ExposureControlBatchResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def query_feature_values_by_factory( self, resource_group_name: str, factory_name: str, exposure_control_batch_request: Union[_models.ExposureControlBatchRequest, IO[bytes]], **kwargs: Any ) -> _models.ExposureControlBatchResponse: """Get list of exposure control features for specific factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param exposure_control_batch_request: The exposure control request for list of features. Is either a ExposureControlBatchRequest type or a IO[bytes] type. Required. :type exposure_control_batch_request: ~azure.mgmt.datafactory.models.ExposureControlBatchRequest or IO[bytes] :return: ExposureControlBatchResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ExposureControlBatchResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ExposureControlBatchResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(exposure_control_batch_request, (IOBase, bytes)): _content = exposure_control_batch_request else: _json = self._serialize.body(exposure_control_batch_request, "ExposureControlBatchRequest") _request = build_query_feature_values_by_factory_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("ExposureControlBatchResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized
class ExposureControlOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`exposure_control` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @overload async def get_feature_value( self, location_id: str, exposure_control_request: _models.ExposureControlRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ExposureControlResponse: '''Get exposure control feature for specific location. :param location_id: The location identifier. Required. :type location_id: str :param exposure_control_request: The exposure control request. Required. :type exposure_control_request: ~azure.mgmt.datafactory.models.ExposureControlRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: ExposureControlResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ExposureControlResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def get_feature_value( self, location_id: str, exposure_control_request: _models.ExposureControlRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ExposureControlResponse: '''Get exposure control feature for specific location. :param location_id: The location identifier. Required. :type location_id: str :param exposure_control_request: The exposure control request. Required. :type exposure_control_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: ExposureControlResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ExposureControlResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get_feature_value( self, location_id: str, exposure_control_request: _models.ExposureControlRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ExposureControlResponse: '''Get exposure control feature for specific location. :param location_id: The location identifier. Required. :type location_id: str :param exposure_control_request: The exposure control request. Is either a ExposureControlRequest type or a IO[bytes] type. Required. :type exposure_control_request: ~azure.mgmt.datafactory.models.ExposureControlRequest or IO[bytes] :return: ExposureControlResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ExposureControlResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def get_feature_value_by_factory( self, resource_group_name: str, factory_name: str, exposure_control_request: _models.ExposureControlRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ExposureControlResponse: '''Get exposure control feature for specific factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param exposure_control_request: The exposure control request. Required. :type exposure_control_request: ~azure.mgmt.datafactory.models.ExposureControlRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: ExposureControlResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ExposureControlResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def get_feature_value_by_factory( self, resource_group_name: str, factory_name: str, exposure_control_request: _models.ExposureControlRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ExposureControlResponse: '''Get exposure control feature for specific factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param exposure_control_request: The exposure control request. Required. :type exposure_control_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: ExposureControlResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ExposureControlResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get_feature_value_by_factory( self, resource_group_name: str, factory_name: str, exposure_control_request: _models.ExposureControlRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ExposureControlResponse: '''Get exposure control feature for specific factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param exposure_control_request: The exposure control request. Is either a ExposureControlRequest type or a IO[bytes] type. Required. :type exposure_control_request: ~azure.mgmt.datafactory.models.ExposureControlRequest or IO[bytes] :return: ExposureControlResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ExposureControlResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def query_feature_values_by_factory( self, resource_group_name: str, factory_name: str, exposure_control_batch_request: _models.ExposureControlBatchRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ExposureControlBatchResponse: '''Get list of exposure control features for specific factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param exposure_control_batch_request: The exposure control request for list of features. Required. :type exposure_control_batch_request: ~azure.mgmt.datafactory.models.ExposureControlBatchRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: ExposureControlBatchResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ExposureControlBatchResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def query_feature_values_by_factory( self, resource_group_name: str, factory_name: str, exposure_control_batch_request: _models.ExposureControlBatchRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ExposureControlBatchResponse: '''Get list of exposure control features for specific factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param exposure_control_batch_request: The exposure control request for list of features. Required. :type exposure_control_batch_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: ExposureControlBatchResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ExposureControlBatchResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def query_feature_values_by_factory( self, resource_group_name: str, factory_name: str, exposure_control_batch_request: _models.ExposureControlBatchRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ExposureControlBatchResponse: '''Get list of exposure control features for specific factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param exposure_control_batch_request: The exposure control request for list of features. Is either a ExposureControlBatchRequest type or a IO[bytes] type. Required. :type exposure_control_batch_request: ~azure.mgmt.datafactory.models.ExposureControlBatchRequest or IO[bytes] :return: ExposureControlBatchResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ExposureControlBatchResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass
20
10
37
4
21
13
2
0.63
0
7
0
0
10
4
10
10
395
51
217
128
134
136
92
56
81
5
0
1
23
8,837
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.AzureSearchIndexWriteBehaviorType
class AzureSearchIndexWriteBehaviorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specify the write behavior when upserting documents into Azure Search Index.""" MERGE = "Merge" UPLOAD = "Upload"
class AzureSearchIndexWriteBehaviorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''Specify the write behavior when upserting documents into Azure Search Index.''' pass
1
1
0
0
0
0
0
0.33
3
0
0
0
0
0
0
115
5
1
3
3
2
1
3
3
2
0
4
0
0
8,838
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.AzureSqlDWAuthenticationType
class AzureSqlDWAuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type used for authentication. Type: string.""" SQL = "SQL" SERVICE_PRINCIPAL = "ServicePrincipal" SYSTEM_ASSIGNED_MANAGED_IDENTITY = "SystemAssignedManagedIdentity" USER_ASSIGNED_MANAGED_IDENTITY = "UserAssignedManagedIdentity"
class AzureSqlDWAuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''The type used for authentication. Type: string.''' pass
1
1
0
0
0
0
0
0.2
3
0
0
0
0
0
0
115
7
1
5
5
4
1
5
5
4
0
4
0
0
8,839
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.AzureSqlDatabaseAuthenticationType
class AzureSqlDatabaseAuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type used for authentication. Type: string.""" SQL = "SQL" SERVICE_PRINCIPAL = "ServicePrincipal" SYSTEM_ASSIGNED_MANAGED_IDENTITY = "SystemAssignedManagedIdentity" USER_ASSIGNED_MANAGED_IDENTITY = "UserAssignedManagedIdentity"
class AzureSqlDatabaseAuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''The type used for authentication. Type: string.''' pass
1
1
0
0
0
0
0
0.2
3
0
0
0
0
0
0
115
7
1
5
5
4
1
5
5
4
0
4
0
0
8,840
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.AzureSqlMIAuthenticationType
class AzureSqlMIAuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type used for authentication. Type: string.""" SQL = "SQL" SERVICE_PRINCIPAL = "ServicePrincipal" SYSTEM_ASSIGNED_MANAGED_IDENTITY = "SystemAssignedManagedIdentity" USER_ASSIGNED_MANAGED_IDENTITY = "UserAssignedManagedIdentity"
class AzureSqlMIAuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''The type used for authentication. Type: string.''' pass
1
1
0
0
0
0
0
0.2
3
0
0
0
0
0
0
115
7
1
5
5
4
1
5
5
4
0
4
0
0
8,841
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.AzureStorageAuthenticationType
class AzureStorageAuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type used for authentication. Type: string.""" ANONYMOUS = "Anonymous" ACCOUNT_KEY = "AccountKey" SAS_URI = "SasUri" SERVICE_PRINCIPAL = "ServicePrincipal" MSI = "Msi"
class AzureStorageAuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''The type used for authentication. Type: string.''' pass
1
1
0
0
0
0
0
0.17
3
0
0
0
0
0
0
115
8
1
6
6
5
1
6
6
5
0
4
0
0
8,842
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.BigDataPoolReferenceType
class BigDataPoolReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Big data pool reference type.""" BIG_DATA_POOL_REFERENCE = "BigDataPoolReference"
class BigDataPoolReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''Big data pool reference type.''' pass
1
1
0
0
0
0
0
0.5
3
0
0
0
0
0
0
115
4
1
2
2
1
1
2
2
1
0
4
0
0
8,843
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.BlobEventTypes
class BlobEventTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """BlobEventTypes.""" MICROSOFT_STORAGE_BLOB_CREATED = "Microsoft.Storage.BlobCreated" MICROSOFT_STORAGE_BLOB_DELETED = "Microsoft.Storage.BlobDeleted"
class BlobEventTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''BlobEventTypes.''' pass
1
1
0
0
0
0
0
0.33
3
0
0
0
0
0
0
115
5
1
3
3
2
1
3
3
2
0
4
0
0
8,844
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.CassandraSourceReadConsistencyLevels
class CassandraSourceReadConsistencyLevels(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The consistency level specifies how many Cassandra servers must respond to a read request before returning data to the client application. Cassandra checks the specified number of Cassandra servers for data to satisfy the read request. Must be one of cassandraSourceReadConsistencyLevels. The default value is 'ONE'. It is case-insensitive. """ ALL = "ALL" EACH_QUORUM = "EACH_QUORUM" QUORUM = "QUORUM" LOCAL_QUORUM = "LOCAL_QUORUM" ONE = "ONE" TWO = "TWO" THREE = "THREE" LOCAL_ONE = "LOCAL_ONE" SERIAL = "SERIAL" LOCAL_SERIAL = "LOCAL_SERIAL"
class CassandraSourceReadConsistencyLevels(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''The consistency level specifies how many Cassandra servers must respond to a read request before returning data to the client application. Cassandra checks the specified number of Cassandra servers for data to satisfy the read request. Must be one of cassandraSourceReadConsistencyLevels. The default value is 'ONE'. It is case-insensitive. '''
1
1
0
0
0
0
0
0.45
3
0
0
0
0
0
0
115
17
1
11
11
10
5
11
11
10
0
4
0
0
8,845
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.CompressionCodec
class CompressionCodec(str, Enum, metaclass=CaseInsensitiveEnumMeta): """All available compressionCodec values.""" NONE = "none" LZO = "lzo" BZIP2 = "bzip2" GZIP = "gzip" DEFLATE = "deflate" ZIP_DEFLATE = "zipDeflate" SNAPPY = "snappy" LZ4 = "lz4" TAR = "tar" TAR_G_ZIP = "tarGZip"
class CompressionCodec(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''All available compressionCodec values.''' pass
1
1
0
0
0
0
0
0.09
3
0
0
0
0
0
0
115
13
1
11
11
10
1
11
11
10
0
4
0
0
8,846
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.ConfigurationType
class ConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of the spark config.""" DEFAULT = "Default" CUSTOMIZED = "Customized" ARTIFACT = "Artifact"
class ConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''The type of the spark config.''' pass
1
1
0
0
0
0
0
0.25
3
0
0
0
0
0
0
115
6
1
4
4
3
1
4
4
3
0
4
0
0
8,847
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.ConnectionType
class ConnectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of connection via linked service or dataset.""" LINKEDSERVICETYPE = "linkedservicetype"
class ConnectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''Type of connection via linked service or dataset.''' pass
1
1
0
0
0
0
0
0.5
3
0
0
0
0
0
0
115
4
1
2
2
1
1
2
2
1
0
4
0
0
8,848
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.CopyBehaviorType
class CopyBehaviorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """All available types of copy behavior.""" PRESERVE_HIERARCHY = "PreserveHierarchy" FLATTEN_HIERARCHY = "FlattenHierarchy" MERGE_FILES = "MergeFiles"
class CopyBehaviorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''All available types of copy behavior.''' pass
1
1
0
0
0
0
0
0.25
3
0
0
0
0
0
0
115
6
1
4
4
3
1
4
4
3
0
4
0
0
8,849
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.CosmosDbConnectionMode
class CosmosDbConnectionMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The connection mode used to access CosmosDB account. Type: string.""" GATEWAY = "Gateway" DIRECT = "Direct"
class CosmosDbConnectionMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''The connection mode used to access CosmosDB account. Type: string.''' pass
1
1
0
0
0
0
0
0.33
3
0
0
0
0
0
0
115
5
1
3
3
2
1
3
3
2
0
4
0
0
8,850
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.CredentialReferenceType
class CredentialReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Credential reference type.""" CREDENTIAL_REFERENCE = "CredentialReference"
class CredentialReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''Credential reference type.''' pass
1
1
0
0
0
0
0
0.5
3
0
0
0
0
0
0
115
4
1
2
2
1
1
2
2
1
0
4
0
0
8,851
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.DataFlowComputeType
class DataFlowComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Compute type of the cluster which will execute data flow job.""" GENERAL = "General" MEMORY_OPTIMIZED = "MemoryOptimized" COMPUTE_OPTIMIZED = "ComputeOptimized"
class DataFlowComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''Compute type of the cluster which will execute data flow job.''' pass
1
1
0
0
0
0
0
0.25
3
0
0
0
0
0
0
115
6
1
4
4
3
1
4
4
3
0
4
0
0
8,852
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.DataFlowDebugCommandType
class DataFlowDebugCommandType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The command type.""" EXECUTE_PREVIEW_QUERY = "executePreviewQuery" EXECUTE_STATISTICS_QUERY = "executeStatisticsQuery" EXECUTE_EXPRESSION_QUERY = "executeExpressionQuery"
class DataFlowDebugCommandType(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''The command type.''' pass
1
1
0
0
0
0
0
0.25
3
0
0
0
0
0
0
115
6
1
4
4
3
1
4
4
3
0
4
0
0
8,853
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.DataFlowReferenceType
class DataFlowReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Data flow reference type.""" DATA_FLOW_REFERENCE = "DataFlowReference"
class DataFlowReferenceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''Data flow reference type.''' pass
1
1
0
0
0
0
0
0.5
3
0
0
0
0
0
0
115
4
1
2
2
1
1
2
2
1
0
4
0
0
8,854
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.AzureFunctionActivityMethod
class AzureFunctionActivityMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The list of HTTP methods supported by a AzureFunctionActivity.""" GET = "GET" POST = "POST" PUT = "PUT" DELETE = "DELETE" OPTIONS = "OPTIONS" HEAD = "HEAD" TRACE = "TRACE"
class AzureFunctionActivityMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''The list of HTTP methods supported by a AzureFunctionActivity.''' pass
1
1
0
0
0
0
0
0.13
3
0
0
0
0
0
0
115
10
1
8
8
7
1
8
8
7
0
4
0
0
8,855
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.AvroCompressionCodec
class AvroCompressionCodec(str, Enum, metaclass=CaseInsensitiveEnumMeta): """AvroCompressionCodec.""" NONE = "none" DEFLATE = "deflate" SNAPPY = "snappy" XZ = "xz" BZIP2 = "bzip2"
class AvroCompressionCodec(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''AvroCompressionCodec.''' pass
1
1
0
0
0
0
0
0.17
3
0
0
0
0
0
0
115
8
1
6
6
5
1
6
6
5
0
4
0
0
8,856
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.AmazonRdsForSqlAuthenticationType
class AmazonRdsForSqlAuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type used for authentication. Type: string.""" SQL = "SQL" WINDOWS = "Windows"
class AmazonRdsForSqlAuthenticationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''The type used for authentication. Type: string.''' pass
1
1
0
0
0
0
0
0.33
3
0
0
0
0
0
0
115
5
1
3
3
2
1
3
3
2
0
4
0
0
8,857
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.AmazonRdsForOraclePartitionOption
class AmazonRdsForOraclePartitionOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): """AmazonRdsForOraclePartitionOption.""" NONE = "None" PHYSICAL_PARTITIONS_OF_TABLE = "PhysicalPartitionsOfTable" DYNAMIC_RANGE = "DynamicRange"
class AmazonRdsForOraclePartitionOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''AmazonRdsForOraclePartitionOption.''' pass
1
1
0
0
0
0
0
0.25
3
0
0
0
0
0
0
115
6
1
4
4
3
1
4
4
3
0
4
0
0
8,858
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_factories_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._factories_operations.FactoriesOperations
class FactoriesOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`factories` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Factory"]: """Lists factories under the specified subscription. :return: An iterator like instance of either Factory or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.Factory] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.FactoryListResponse] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): if not next_link: _request = build_list_request( subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version _parsed_next_link = urllib.parse.urlparse(next_link) _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): deserialized = self._deserialize("FactoryListResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) @overload async def configure_factory_repo( self, location_id: str, factory_repo_update: _models.FactoryRepoUpdate, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Factory: """Updates a factory's repo information. :param location_id: The location identifier. Required. :type location_id: str :param factory_repo_update: Update factory repo request definition. Required. :type factory_repo_update: ~azure.mgmt.datafactory.models.FactoryRepoUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Factory or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def configure_factory_repo( self, location_id: str, factory_repo_update: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.Factory: """Updates a factory's repo information. :param location_id: The location identifier. Required. :type location_id: str :param factory_repo_update: Update factory repo request definition. Required. :type factory_repo_update: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: Factory or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def configure_factory_repo( self, location_id: str, factory_repo_update: Union[_models.FactoryRepoUpdate, IO[bytes]], **kwargs: Any ) -> _models.Factory: """Updates a factory's repo information. :param location_id: The location identifier. Required. :type location_id: str :param factory_repo_update: Update factory repo request definition. Is either a FactoryRepoUpdate type or a IO[bytes] type. Required. :type factory_repo_update: ~azure.mgmt.datafactory.models.FactoryRepoUpdate or IO[bytes] :return: Factory or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Factory] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(factory_repo_update, (IOBase, bytes)): _content = factory_repo_update else: _json = self._serialize.body(factory_repo_update, "FactoryRepoUpdate") _request = build_configure_factory_repo_request( location_id=location_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("Factory", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Factory"]: """Lists factories. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either Factory or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.Factory] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.FactoryListResponse] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): if not next_link: _request = build_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version _parsed_next_link = urllib.parse.urlparse(next_link) _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): deserialized = self._deserialize("FactoryListResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) @overload async def create_or_update( self, resource_group_name: str, factory_name: str, factory: _models.Factory, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Factory: """Creates or updates a factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param factory: Factory resource definition. Required. :type factory: ~azure.mgmt.datafactory.models.Factory :param if_match: ETag of the factory entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Factory or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_or_update( self, resource_group_name: str, factory_name: str, factory: IO[bytes], if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Factory: """Creates or updates a factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param factory: Factory resource definition. Required. :type factory: IO[bytes] :param if_match: ETag of the factory entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: Factory or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, factory: Union[_models.Factory, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any ) -> _models.Factory: """Creates or updates a factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param factory: Factory resource definition. Is either a Factory type or a IO[bytes] type. Required. :type factory: ~azure.mgmt.datafactory.models.Factory or IO[bytes] :param if_match: ETag of the factory entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: Factory or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Factory] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(factory, (IOBase, bytes)): _content = factory else: _json = self._serialize.body(factory, "Factory") _request = build_create_or_update_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, if_match=if_match, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("Factory", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload async def update( self, resource_group_name: str, factory_name: str, factory_update_parameters: _models.FactoryUpdateParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Factory: """Updates a factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param factory_update_parameters: The parameters for updating a factory. Required. :type factory_update_parameters: ~azure.mgmt.datafactory.models.FactoryUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Factory or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def update( self, resource_group_name: str, factory_name: str, factory_update_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.Factory: """Updates a factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param factory_update_parameters: The parameters for updating a factory. Required. :type factory_update_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: Factory or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def update( self, resource_group_name: str, factory_name: str, factory_update_parameters: Union[_models.FactoryUpdateParameters, IO[bytes]], **kwargs: Any ) -> _models.Factory: """Updates a factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param factory_update_parameters: The parameters for updating a factory. Is either a FactoryUpdateParameters type or a IO[bytes] type. Required. :type factory_update_parameters: ~azure.mgmt.datafactory.models.FactoryUpdateParameters or IO[bytes] :return: Factory or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Factory] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(factory_update_parameters, (IOBase, bytes)): _content = factory_update_parameters else: _json = self._serialize.body(factory_update_parameters, "FactoryUpdateParameters") _request = build_update_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("Factory", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, if_none_match: Optional[str] = None, **kwargs: Any ) -> Optional[_models.Factory]: """Gets a factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param if_none_match: ETag of the factory entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: Factory or None or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory or None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Optional[_models.Factory]] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, if_none_match=if_none_match, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 304]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: deserialized = self._deserialize("Factory", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def delete(self, resource_group_name: str, factory_name: str, **kwargs: Any) -> None: """Deletes a factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @overload async def get_git_hub_access_token( self, resource_group_name: str, factory_name: str, git_hub_access_token_request: _models.GitHubAccessTokenRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.GitHubAccessTokenResponse: """Get GitHub Access Token. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param git_hub_access_token_request: Get GitHub access token request definition. Required. :type git_hub_access_token_request: ~azure.mgmt.datafactory.models.GitHubAccessTokenRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: GitHubAccessTokenResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.GitHubAccessTokenResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def get_git_hub_access_token( self, resource_group_name: str, factory_name: str, git_hub_access_token_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.GitHubAccessTokenResponse: """Get GitHub Access Token. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param git_hub_access_token_request: Get GitHub access token request definition. Required. :type git_hub_access_token_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: GitHubAccessTokenResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.GitHubAccessTokenResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def get_git_hub_access_token( self, resource_group_name: str, factory_name: str, git_hub_access_token_request: Union[_models.GitHubAccessTokenRequest, IO[bytes]], **kwargs: Any ) -> _models.GitHubAccessTokenResponse: """Get GitHub Access Token. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param git_hub_access_token_request: Get GitHub access token request definition. Is either a GitHubAccessTokenRequest type or a IO[bytes] type. Required. :type git_hub_access_token_request: ~azure.mgmt.datafactory.models.GitHubAccessTokenRequest or IO[bytes] :return: GitHubAccessTokenResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.GitHubAccessTokenResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.GitHubAccessTokenResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(git_hub_access_token_request, (IOBase, bytes)): _content = git_hub_access_token_request else: _json = self._serialize.body(git_hub_access_token_request, "GitHubAccessTokenRequest") _request = build_get_git_hub_access_token_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("GitHubAccessTokenResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload async def get_data_plane_access( self, resource_group_name: str, factory_name: str, policy: _models.UserAccessPolicy, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AccessPolicyResponse: """Get Data Plane access. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param policy: Data Plane user access policy definition. Required. :type policy: ~azure.mgmt.datafactory.models.UserAccessPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: AccessPolicyResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.AccessPolicyResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def get_data_plane_access( self, resource_group_name: str, factory_name: str, policy: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.AccessPolicyResponse: """Get Data Plane access. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param policy: Data Plane user access policy definition. Required. :type policy: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: AccessPolicyResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.AccessPolicyResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def get_data_plane_access( self, resource_group_name: str, factory_name: str, policy: Union[_models.UserAccessPolicy, IO[bytes]], **kwargs: Any ) -> _models.AccessPolicyResponse: """Get Data Plane access. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param policy: Data Plane user access policy definition. Is either a UserAccessPolicy type or a IO[bytes] type. Required. :type policy: ~azure.mgmt.datafactory.models.UserAccessPolicy or IO[bytes] :return: AccessPolicyResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.AccessPolicyResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AccessPolicyResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(policy, (IOBase, bytes)): _content = policy else: _json = self._serialize.body(policy, "UserAccessPolicy") _request = build_get_data_plane_access_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("AccessPolicyResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized
class FactoriesOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`factories` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Factory"]: '''Lists factories under the specified subscription. :return: An iterator like instance of either Factory or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.Factory] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass @overload async def configure_factory_repo( self, location_id: str, factory_repo_update: _models.FactoryRepoUpdate, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Factory: '''Updates a factory's repo information. :param location_id: The location identifier. Required. :type location_id: str :param factory_repo_update: Update factory repo request definition. Required. :type factory_repo_update: ~azure.mgmt.datafactory.models.FactoryRepoUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Factory or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def configure_factory_repo( self, location_id: str, factory_repo_update: _models.FactoryRepoUpdate, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Factory: '''Updates a factory's repo information. :param location_id: The location identifier. Required. :type location_id: str :param factory_repo_update: Update factory repo request definition. Required. :type factory_repo_update: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: Factory or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def configure_factory_repo( self, location_id: str, factory_repo_update: _models.FactoryRepoUpdate, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Factory: '''Updates a factory's repo information. :param location_id: The location identifier. Required. :type location_id: str :param factory_repo_update: Update factory repo request definition. Is either a FactoryRepoUpdate type or a IO[bytes] type. Required. :type factory_repo_update: ~azure.mgmt.datafactory.models.FactoryRepoUpdate or IO[bytes] :return: Factory or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Factory"]: '''Lists factories. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :return: An iterator like instance of either Factory or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.Factory] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, factory: _models.Factory, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Factory: '''Creates or updates a factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param factory: Factory resource definition. Required. :type factory: ~azure.mgmt.datafactory.models.Factory :param if_match: ETag of the factory entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Factory or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, factory: _models.Factory, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Factory: '''Creates or updates a factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param factory: Factory resource definition. Required. :type factory: IO[bytes] :param if_match: ETag of the factory entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: Factory or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, factory: _models.Factory, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Factory: '''Creates or updates a factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param factory: Factory resource definition. Is either a Factory type or a IO[bytes] type. Required. :type factory: ~azure.mgmt.datafactory.models.Factory or IO[bytes] :param if_match: ETag of the factory entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: Factory or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def update( self, resource_group_name: str, factory_name: str, factory_update_parameters: _models.FactoryUpdateParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Factory: '''Updates a factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param factory_update_parameters: The parameters for updating a factory. Required. :type factory_update_parameters: ~azure.mgmt.datafactory.models.FactoryUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Factory or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def update( self, resource_group_name: str, factory_name: str, factory_update_parameters: _models.FactoryUpdateParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Factory: '''Updates a factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param factory_update_parameters: The parameters for updating a factory. Required. :type factory_update_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: Factory or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def update( self, resource_group_name: str, factory_name: str, factory_update_parameters: _models.FactoryUpdateParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Factory: '''Updates a factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param factory_update_parameters: The parameters for updating a factory. Is either a FactoryUpdateParameters type or a IO[bytes] type. Required. :type factory_update_parameters: ~azure.mgmt.datafactory.models.FactoryUpdateParameters or IO[bytes] :return: Factory or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get_next(next_link=None): '''Gets a factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param if_none_match: ETag of the factory entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: Factory or None or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.Factory or None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def delete(self, resource_group_name: str, factory_name: str, **kwargs: Any) -> None: '''Deletes a factory. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def get_git_hub_access_token( self, resource_group_name: str, factory_name: str, git_hub_access_token_request: _models.GitHubAccessTokenRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.GitHubAccessTokenResponse: '''Get GitHub Access Token. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param git_hub_access_token_request: Get GitHub access token request definition. Required. :type git_hub_access_token_request: ~azure.mgmt.datafactory.models.GitHubAccessTokenRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: GitHubAccessTokenResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.GitHubAccessTokenResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def get_git_hub_access_token( self, resource_group_name: str, factory_name: str, git_hub_access_token_request: _models.GitHubAccessTokenRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.GitHubAccessTokenResponse: '''Get GitHub Access Token. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param git_hub_access_token_request: Get GitHub access token request definition. Required. :type git_hub_access_token_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: GitHubAccessTokenResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.GitHubAccessTokenResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get_git_hub_access_token( self, resource_group_name: str, factory_name: str, git_hub_access_token_request: _models.GitHubAccessTokenRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.GitHubAccessTokenResponse: '''Get GitHub Access Token. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param git_hub_access_token_request: Get GitHub access token request definition. Is either a GitHubAccessTokenRequest type or a IO[bytes] type. Required. :type git_hub_access_token_request: ~azure.mgmt.datafactory.models.GitHubAccessTokenRequest or IO[bytes] :return: GitHubAccessTokenResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.GitHubAccessTokenResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def get_data_plane_access( self, resource_group_name: str, factory_name: str, policy: _models.UserAccessPolicy, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AccessPolicyResponse: '''Get Data Plane access. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param policy: Data Plane user access policy definition. Required. :type policy: ~azure.mgmt.datafactory.models.UserAccessPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: AccessPolicyResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.AccessPolicyResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def get_data_plane_access( self, resource_group_name: str, factory_name: str, policy: _models.UserAccessPolicy, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AccessPolicyResponse: '''Get Data Plane access. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param policy: Data Plane user access policy definition. Required. :type policy: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: AccessPolicyResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.AccessPolicyResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get_data_plane_access( self, resource_group_name: str, factory_name: str, policy: _models.UserAccessPolicy, *, content_type: str = "application/json", **kwargs: Any ) -> _models.AccessPolicyResponse: '''Get Data Plane access. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param policy: Data Plane user access policy definition. Is either a UserAccessPolicy type or a IO[bytes] type. Required. :type policy: ~azure.mgmt.datafactory.models.UserAccessPolicy or IO[bytes] :return: AccessPolicyResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.AccessPolicyResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass
46
20
37
5
23
10
2
0.51
0
7
0
0
20
4
20
20
914
129
537
268
387
272
254
145
227
5
0
1
56
8,859
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_global_parameters_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._global_parameters_operations.GlobalParametersOperations
class GlobalParametersOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`global_parameters` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.GlobalParameterResource"]: """Lists Global parameters. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either GlobalParameterResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.GlobalParameterResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GlobalParameterListResponse] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): if not next_link: _request = build_list_by_factory_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version _parsed_next_link = urllib.parse.urlparse(next_link) _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): deserialized = self._deserialize("GlobalParameterListResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, global_parameter_name: str, **kwargs: Any ) -> _models.GlobalParameterResource: """Gets a Global parameter. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param global_parameter_name: The global parameter name. Required. :type global_parameter_name: str :return: GlobalParameterResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.GlobalParameterResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.GlobalParameterResource] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, factory_name=factory_name, global_parameter_name=global_parameter_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("GlobalParameterResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload async def create_or_update( self, resource_group_name: str, factory_name: str, global_parameter_name: str, default: _models.GlobalParameterResource, *, content_type: str = "application/json", **kwargs: Any ) -> _models.GlobalParameterResource: """Creates or updates a Global parameter. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param global_parameter_name: The global parameter name. Required. :type global_parameter_name: str :param default: Global parameter resource definition. Required. :type default: ~azure.mgmt.datafactory.models.GlobalParameterResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: GlobalParameterResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.GlobalParameterResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_or_update( self, resource_group_name: str, factory_name: str, global_parameter_name: str, default: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.GlobalParameterResource: """Creates or updates a Global parameter. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param global_parameter_name: The global parameter name. Required. :type global_parameter_name: str :param default: Global parameter resource definition. Required. :type default: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: GlobalParameterResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.GlobalParameterResource :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, global_parameter_name: str, default: Union[_models.GlobalParameterResource, IO[bytes]], **kwargs: Any ) -> _models.GlobalParameterResource: """Creates or updates a Global parameter. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param global_parameter_name: The global parameter name. Required. :type global_parameter_name: str :param default: Global parameter resource definition. Is either a GlobalParameterResource type or a IO[bytes] type. Required. :type default: ~azure.mgmt.datafactory.models.GlobalParameterResource or IO[bytes] :return: GlobalParameterResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.GlobalParameterResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.GlobalParameterResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(default, (IOBase, bytes)): _content = default else: _json = self._serialize.body(default, "GlobalParameterResource") _request = build_create_or_update_request( resource_group_name=resource_group_name, factory_name=factory_name, global_parameter_name=global_parameter_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("GlobalParameterResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def delete( self, resource_group_name: str, factory_name: str, global_parameter_name: str, **kwargs: Any ) -> None: """Deletes a Global parameter. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param global_parameter_name: The global parameter name. Required. :type global_parameter_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, factory_name=factory_name, global_parameter_name=global_parameter_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {})
class GlobalParametersOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`global_parameters` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.GlobalParameterResource"]: '''Lists Global parameters. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either GlobalParameterResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.GlobalParameterResource] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass @distributed_trace_async async def get_next(next_link=None): '''Gets a Global parameter. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param global_parameter_name: The global parameter name. Required. :type global_parameter_name: str :return: GlobalParameterResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.GlobalParameterResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, global_parameter_name: str, default: _models.GlobalParameterResource, *, content_type: str = "application/json", **kwargs: Any ) -> _models.GlobalParameterResource: '''Creates or updates a Global parameter. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param global_parameter_name: The global parameter name. Required. :type global_parameter_name: str :param default: Global parameter resource definition. Required. :type default: ~azure.mgmt.datafactory.models.GlobalParameterResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: GlobalParameterResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.GlobalParameterResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, global_parameter_name: str, default: _models.GlobalParameterResource, *, content_type: str = "application/json", **kwargs: Any ) -> _models.GlobalParameterResource: '''Creates or updates a Global parameter. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param global_parameter_name: The global parameter name. Required. :type global_parameter_name: str :param default: Global parameter resource definition. Required. :type default: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: GlobalParameterResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.GlobalParameterResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, global_parameter_name: str, default: _models.GlobalParameterResource, *, content_type: str = "application/json", **kwargs: Any ) -> _models.GlobalParameterResource: '''Creates or updates a Global parameter. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param global_parameter_name: The global parameter name. Required. :type global_parameter_name: str :param default: Global parameter resource definition. Is either a GlobalParameterResource type or a IO[bytes] type. Required. :type default: ~azure.mgmt.datafactory.models.GlobalParameterResource or IO[bytes] :return: GlobalParameterResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.GlobalParameterResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def delete( self, resource_group_name: str, factory_name: str, global_parameter_name: str, **kwargs: Any ) -> None: '''Deletes a Global parameter. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param global_parameter_name: The global parameter name. Required. :type global_parameter_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass
17
7
38
5
25
9
2
0.45
0
7
0
0
7
4
7
7
353
52
214
100
166
97
106
63
95
5
0
1
24
8,860
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_integration_runtime_nodes_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._integration_runtime_nodes_operations.IntegrationRuntimeNodesOperations
class IntegrationRuntimeNodesOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`integration_runtime_nodes` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, node_name: str, **kwargs: Any ) -> _models.SelfHostedIntegrationRuntimeNode: """Gets a self-hosted integration runtime node. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param node_name: The integration runtime node name. Required. :type node_name: str :return: SelfHostedIntegrationRuntimeNode or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.SelfHostedIntegrationRuntimeNode :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SelfHostedIntegrationRuntimeNode] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, node_name=node_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("SelfHostedIntegrationRuntimeNode", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def delete( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, node_name: str, **kwargs: Any ) -> None: """Deletes a self-hosted integration runtime node. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param node_name: The integration runtime node name. Required. :type node_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, node_name=node_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @overload async def update( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, node_name: str, update_integration_runtime_node_request: _models.UpdateIntegrationRuntimeNodeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SelfHostedIntegrationRuntimeNode: """Updates a self-hosted integration runtime node. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param node_name: The integration runtime node name. Required. :type node_name: str :param update_integration_runtime_node_request: The parameters for updating an integration runtime node. Required. :type update_integration_runtime_node_request: ~azure.mgmt.datafactory.models.UpdateIntegrationRuntimeNodeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: SelfHostedIntegrationRuntimeNode or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.SelfHostedIntegrationRuntimeNode :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def update( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, node_name: str, update_integration_runtime_node_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.SelfHostedIntegrationRuntimeNode: """Updates a self-hosted integration runtime node. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param node_name: The integration runtime node name. Required. :type node_name: str :param update_integration_runtime_node_request: The parameters for updating an integration runtime node. Required. :type update_integration_runtime_node_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: SelfHostedIntegrationRuntimeNode or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.SelfHostedIntegrationRuntimeNode :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def update( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, node_name: str, update_integration_runtime_node_request: Union[_models.UpdateIntegrationRuntimeNodeRequest, IO[bytes]], **kwargs: Any ) -> _models.SelfHostedIntegrationRuntimeNode: """Updates a self-hosted integration runtime node. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param node_name: The integration runtime node name. Required. :type node_name: str :param update_integration_runtime_node_request: The parameters for updating an integration runtime node. Is either a UpdateIntegrationRuntimeNodeRequest type or a IO[bytes] type. Required. :type update_integration_runtime_node_request: ~azure.mgmt.datafactory.models.UpdateIntegrationRuntimeNodeRequest or IO[bytes] :return: SelfHostedIntegrationRuntimeNode or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.SelfHostedIntegrationRuntimeNode :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SelfHostedIntegrationRuntimeNode] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(update_integration_runtime_node_request, (IOBase, bytes)): _content = update_integration_runtime_node_request else: _json = self._serialize.body(update_integration_runtime_node_request, "UpdateIntegrationRuntimeNodeRequest") _request = build_update_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, node_name=node_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("SelfHostedIntegrationRuntimeNode", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def get_ip_address( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, node_name: str, **kwargs: Any ) -> _models.IntegrationRuntimeNodeIpAddress: """Get the IP address of self-hosted integration runtime node. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param node_name: The integration runtime node name. Required. :type node_name: str :return: IntegrationRuntimeNodeIpAddress or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeNodeIpAddress :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IntegrationRuntimeNodeIpAddress] = kwargs.pop("cls", None) _request = build_get_ip_address_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, node_name=node_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("IntegrationRuntimeNodeIpAddress", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized
class IntegrationRuntimeNodesOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`integration_runtime_nodes` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, node_name: str, **kwargs: Any ) -> _models.SelfHostedIntegrationRuntimeNode: '''Gets a self-hosted integration runtime node. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param node_name: The integration runtime node name. Required. :type node_name: str :return: SelfHostedIntegrationRuntimeNode or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.SelfHostedIntegrationRuntimeNode :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def delete( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, node_name: str, **kwargs: Any ) -> None: '''Deletes a self-hosted integration runtime node. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param node_name: The integration runtime node name. Required. :type node_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def update( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, node_name: str, update_integration_runtime_node_request: _models.UpdateIntegrationRuntimeNodeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SelfHostedIntegrationRuntimeNode: '''Updates a self-hosted integration runtime node. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param node_name: The integration runtime node name. Required. :type node_name: str :param update_integration_runtime_node_request: The parameters for updating an integration runtime node. Required. :type update_integration_runtime_node_request: ~azure.mgmt.datafactory.models.UpdateIntegrationRuntimeNodeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: SelfHostedIntegrationRuntimeNode or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.SelfHostedIntegrationRuntimeNode :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def update( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, node_name: str, update_integration_runtime_node_request: _models.UpdateIntegrationRuntimeNodeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SelfHostedIntegrationRuntimeNode: '''Updates a self-hosted integration runtime node. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param node_name: The integration runtime node name. Required. :type node_name: str :param update_integration_runtime_node_request: The parameters for updating an integration runtime node. Required. :type update_integration_runtime_node_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: SelfHostedIntegrationRuntimeNode or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.SelfHostedIntegrationRuntimeNode :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def update( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, node_name: str, update_integration_runtime_node_request: _models.UpdateIntegrationRuntimeNodeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SelfHostedIntegrationRuntimeNode: '''Updates a self-hosted integration runtime node. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param node_name: The integration runtime node name. Required. :type node_name: str :param update_integration_runtime_node_request: The parameters for updating an integration runtime node. Is either a UpdateIntegrationRuntimeNodeRequest type or a IO[bytes] type. Required. :type update_integration_runtime_node_request: ~azure.mgmt.datafactory.models.UpdateIntegrationRuntimeNodeRequest or IO[bytes] :return: SelfHostedIntegrationRuntimeNode or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.SelfHostedIntegrationRuntimeNode :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get_ip_address( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, node_name: str, **kwargs: Any ) -> _models.IntegrationRuntimeNodeIpAddress: '''Get the IP address of self-hosted integration runtime node. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param node_name: The integration runtime node name. Required. :type node_name: str :return: IntegrationRuntimeNodeIpAddress or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeNodeIpAddress :raises ~azure.core.exceptions.HttpResponseError: ''' pass
14
7
47
6
27
15
3
0.57
0
7
0
0
7
4
7
7
352
50
199
96
151
114
91
56
83
5
0
1
20
8,861
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_integration_runtime_object_metadata_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._integration_runtime_object_metadata_operations.IntegrationRuntimeObjectMetadataOperations
class IntegrationRuntimeObjectMetadataOperations: # pylint: disable=name-too-long """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`integration_runtime_object_metadata` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") async def _refresh_initial( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_refresh_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def begin_refresh( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> AsyncLROPoller[_models.SsisObjectMetadataStatusResponse]: """Refresh a SSIS integration runtime object metadata. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: An instance of AsyncLROPoller that returns either SsisObjectMetadataStatusResponse or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.SsisObjectMetadataStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SsisObjectMetadataStatusResponse] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._refresh_initial( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): deserialized = self._deserialize("SsisObjectMetadataStatusResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: return AsyncLROPoller[_models.SsisObjectMetadataStatusResponse].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) return AsyncLROPoller[_models.SsisObjectMetadataStatusResponse]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @overload async def get( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, get_metadata_request: Optional[_models.GetSsisObjectMetadataRequest] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SsisObjectMetadataListResponse: """Get a SSIS integration runtime object metadata by specified path. The return is pageable metadata list. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param get_metadata_request: The parameters for getting a SSIS object metadata. Default value is None. :type get_metadata_request: ~azure.mgmt.datafactory.models.GetSsisObjectMetadataRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: SsisObjectMetadataListResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.SsisObjectMetadataListResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def get( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, get_metadata_request: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SsisObjectMetadataListResponse: """Get a SSIS integration runtime object metadata by specified path. The return is pageable metadata list. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param get_metadata_request: The parameters for getting a SSIS object metadata. Default value is None. :type get_metadata_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: SsisObjectMetadataListResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.SsisObjectMetadataListResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, get_metadata_request: Optional[Union[_models.GetSsisObjectMetadataRequest, IO[bytes]]] = None, **kwargs: Any ) -> _models.SsisObjectMetadataListResponse: """Get a SSIS integration runtime object metadata by specified path. The return is pageable metadata list. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param get_metadata_request: The parameters for getting a SSIS object metadata. Is either a GetSsisObjectMetadataRequest type or a IO[bytes] type. Default value is None. :type get_metadata_request: ~azure.mgmt.datafactory.models.GetSsisObjectMetadataRequest or IO[bytes] :return: SsisObjectMetadataListResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.SsisObjectMetadataListResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SsisObjectMetadataListResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(get_metadata_request, (IOBase, bytes)): _content = get_metadata_request else: if get_metadata_request is not None: _json = self._serialize.body(get_metadata_request, "GetSsisObjectMetadataRequest") else: _json = None _request = build_get_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("SsisObjectMetadataListResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized
class IntegrationRuntimeObjectMetadataOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`integration_runtime_object_metadata` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass async def _refresh_initial( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: pass @distributed_trace_async async def begin_refresh( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> AsyncLROPoller[_models.SsisObjectMetadataStatusResponse]: '''Refresh a SSIS integration runtime object metadata. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: An instance of AsyncLROPoller that returns either SsisObjectMetadataStatusResponse or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.SsisObjectMetadataStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def get_long_running_output(pipeline_response): pass @overload def get_long_running_output(pipeline_response): '''Get a SSIS integration runtime object metadata by specified path. The return is pageable metadata list. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param get_metadata_request: The parameters for getting a SSIS object metadata. Default value is None. :type get_metadata_request: ~azure.mgmt.datafactory.models.GetSsisObjectMetadataRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: SsisObjectMetadataListResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.SsisObjectMetadataListResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload def get_long_running_output(pipeline_response): '''Get a SSIS integration runtime object metadata by specified path. The return is pageable metadata list. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param get_metadata_request: The parameters for getting a SSIS object metadata. Default value is None. :type get_metadata_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: SsisObjectMetadataListResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.SsisObjectMetadataListResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async def get_long_running_output(pipeline_response): '''Get a SSIS integration runtime object metadata by specified path. The return is pageable metadata list. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param get_metadata_request: The parameters for getting a SSIS object metadata. Is either a GetSsisObjectMetadataRequest type or a IO[bytes] type. Default value is None. :type get_metadata_request: ~azure.mgmt.datafactory.models.GetSsisObjectMetadataRequest or IO[bytes] :return: SsisObjectMetadataListResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.SsisObjectMetadataListResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass
12
5
37
4
24
11
3
0.48
0
8
0
0
6
4
6
6
278
34
172
81
131
83
86
48
78
5
0
2
23
8,862
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_integration_runtimes_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._integration_runtimes_operations.IntegrationRuntimesOperations
class IntegrationRuntimesOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`integration_runtimes` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.IntegrationRuntimeResource"]: """Lists integration runtimes. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either IntegrationRuntimeResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.IntegrationRuntimeResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IntegrationRuntimeListResponse] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): if not next_link: _request = build_list_by_factory_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version _parsed_next_link = urllib.parse.urlparse(next_link) _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): deserialized = self._deserialize("IntegrationRuntimeListResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) @overload async def create_or_update( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, integration_runtime: _models.IntegrationRuntimeResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeResource: """Creates or updates an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param integration_runtime: Integration runtime resource definition. Required. :type integration_runtime: ~azure.mgmt.datafactory.models.IntegrationRuntimeResource :param if_match: ETag of the integration runtime entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: IntegrationRuntimeResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_or_update( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, integration_runtime: IO[bytes], if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeResource: """Creates or updates an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param integration_runtime: Integration runtime resource definition. Required. :type integration_runtime: IO[bytes] :param if_match: ETag of the integration runtime entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: IntegrationRuntimeResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeResource :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, integration_runtime: Union[_models.IntegrationRuntimeResource, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any ) -> _models.IntegrationRuntimeResource: """Creates or updates an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param integration_runtime: Integration runtime resource definition. Is either a IntegrationRuntimeResource type or a IO[bytes] type. Required. :type integration_runtime: ~azure.mgmt.datafactory.models.IntegrationRuntimeResource or IO[bytes] :param if_match: ETag of the integration runtime entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: IntegrationRuntimeResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.IntegrationRuntimeResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(integration_runtime, (IOBase, bytes)): _content = integration_runtime else: _json = self._serialize.body(integration_runtime, "IntegrationRuntimeResource") _request = build_create_or_update_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, subscription_id=self._config.subscription_id, if_match=if_match, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("IntegrationRuntimeResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, if_none_match: Optional[str] = None, **kwargs: Any ) -> Optional[_models.IntegrationRuntimeResource]: """Gets an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param if_none_match: ETag of the integration runtime entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: IntegrationRuntimeResource or None or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeResource or None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Optional[_models.IntegrationRuntimeResource]] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, subscription_id=self._config.subscription_id, if_none_match=if_none_match, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 304]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: deserialized = self._deserialize("IntegrationRuntimeResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload async def update( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, update_integration_runtime_request: _models.UpdateIntegrationRuntimeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeResource: """Updates an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param update_integration_runtime_request: The parameters for updating an integration runtime. Required. :type update_integration_runtime_request: ~azure.mgmt.datafactory.models.UpdateIntegrationRuntimeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: IntegrationRuntimeResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def update( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, update_integration_runtime_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeResource: """Updates an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param update_integration_runtime_request: The parameters for updating an integration runtime. Required. :type update_integration_runtime_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: IntegrationRuntimeResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeResource :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def update( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, update_integration_runtime_request: Union[_models.UpdateIntegrationRuntimeRequest, IO[bytes]], **kwargs: Any ) -> _models.IntegrationRuntimeResource: """Updates an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param update_integration_runtime_request: The parameters for updating an integration runtime. Is either a UpdateIntegrationRuntimeRequest type or a IO[bytes] type. Required. :type update_integration_runtime_request: ~azure.mgmt.datafactory.models.UpdateIntegrationRuntimeRequest or IO[bytes] :return: IntegrationRuntimeResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.IntegrationRuntimeResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(update_integration_runtime_request, (IOBase, bytes)): _content = update_integration_runtime_request else: _json = self._serialize.body(update_integration_runtime_request, "UpdateIntegrationRuntimeRequest") _request = build_update_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("IntegrationRuntimeResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def delete( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> None: """Deletes an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def get_status( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> _models.IntegrationRuntimeStatusResponse: """Gets detailed status information for an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: IntegrationRuntimeStatusResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeStatusResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IntegrationRuntimeStatusResponse] = kwargs.pop("cls", None) _request = build_get_status_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("IntegrationRuntimeStatusResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> _models.IntegrationRuntimeOutboundNetworkDependenciesEndpointsResponse: """Gets the list of outbound network dependencies for a given Azure-SSIS integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: IntegrationRuntimeOutboundNetworkDependenciesEndpointsResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeOutboundNetworkDependenciesEndpointsResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IntegrationRuntimeOutboundNetworkDependenciesEndpointsResponse] = kwargs.pop("cls", None) _request = build_list_outbound_network_dependencies_endpoints_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize( "IntegrationRuntimeOutboundNetworkDependenciesEndpointsResponse", pipeline_response.http_response ) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def get_connection_info( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> _models.IntegrationRuntimeConnectionInfo: """Gets the on-premises integration runtime connection information for encrypting the on-premises data source credentials. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: IntegrationRuntimeConnectionInfo or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeConnectionInfo :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IntegrationRuntimeConnectionInfo] = kwargs.pop("cls", None) _request = build_get_connection_info_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("IntegrationRuntimeConnectionInfo", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload async def regenerate_auth_key( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, regenerate_key_parameters: _models.IntegrationRuntimeRegenerateKeyParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeAuthKeys: """Regenerates the authentication key for an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param regenerate_key_parameters: The parameters for regenerating integration runtime authentication key. Required. :type regenerate_key_parameters: ~azure.mgmt.datafactory.models.IntegrationRuntimeRegenerateKeyParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: IntegrationRuntimeAuthKeys or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeAuthKeys :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def regenerate_auth_key( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, regenerate_key_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeAuthKeys: """Regenerates the authentication key for an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param regenerate_key_parameters: The parameters for regenerating integration runtime authentication key. Required. :type regenerate_key_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: IntegrationRuntimeAuthKeys or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeAuthKeys :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def regenerate_auth_key( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, regenerate_key_parameters: Union[_models.IntegrationRuntimeRegenerateKeyParameters, IO[bytes]], **kwargs: Any ) -> _models.IntegrationRuntimeAuthKeys: """Regenerates the authentication key for an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param regenerate_key_parameters: The parameters for regenerating integration runtime authentication key. Is either a IntegrationRuntimeRegenerateKeyParameters type or a IO[bytes] type. Required. :type regenerate_key_parameters: ~azure.mgmt.datafactory.models.IntegrationRuntimeRegenerateKeyParameters or IO[bytes] :return: IntegrationRuntimeAuthKeys or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeAuthKeys :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.IntegrationRuntimeAuthKeys] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(regenerate_key_parameters, (IOBase, bytes)): _content = regenerate_key_parameters else: _json = self._serialize.body(regenerate_key_parameters, "IntegrationRuntimeRegenerateKeyParameters") _request = build_regenerate_auth_key_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("IntegrationRuntimeAuthKeys", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def list_auth_keys( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> _models.IntegrationRuntimeAuthKeys: """Retrieves the authentication keys for an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: IntegrationRuntimeAuthKeys or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeAuthKeys :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IntegrationRuntimeAuthKeys] = kwargs.pop("cls", None) _request = build_list_auth_keys_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("IntegrationRuntimeAuthKeys", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore async def _start_initial( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_start_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def begin_start( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> AsyncLROPoller[_models.IntegrationRuntimeStatusResponse]: """Starts a ManagedReserved type integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: An instance of AsyncLROPoller that returns either IntegrationRuntimeStatusResponse or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.IntegrationRuntimeStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IntegrationRuntimeStatusResponse] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._start_initial( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): deserialized = self._deserialize("IntegrationRuntimeStatusResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: return AsyncLROPoller[_models.IntegrationRuntimeStatusResponse].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) return AsyncLROPoller[_models.IntegrationRuntimeStatusResponse]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) async def _stop_initial( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_stop_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def begin_stop( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Stops a ManagedReserved type integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._stop_initial( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def sync_credentials( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> None: """Force the integration runtime to synchronize credentials across integration runtime nodes, and this will override the credentials across all worker nodes with those available on the dispatcher node. If you already have the latest credential backup file, you should manually import it (preferred) on any self-hosted integration runtime node than using this API directly. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_sync_credentials_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def get_monitoring_data( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> _models.IntegrationRuntimeMonitoringData: """Get the integration runtime monitoring data, which includes the monitor data for all the nodes under this integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: IntegrationRuntimeMonitoringData or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeMonitoringData :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IntegrationRuntimeMonitoringData] = kwargs.pop("cls", None) _request = build_get_monitoring_data_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("IntegrationRuntimeMonitoringData", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def upgrade( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> None: """Upgrade self-hosted integration runtime to latest version if availability. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_upgrade_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @overload async def remove_links( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, linked_integration_runtime_request: _models.LinkedIntegrationRuntimeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> None: """Remove all linked integration runtimes under specific data factory in a self-hosted integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param linked_integration_runtime_request: The data factory name for the linked integration runtime. Required. :type linked_integration_runtime_request: ~azure.mgmt.datafactory.models.LinkedIntegrationRuntimeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def remove_links( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, linked_integration_runtime_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> None: """Remove all linked integration runtimes under specific data factory in a self-hosted integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param linked_integration_runtime_request: The data factory name for the linked integration runtime. Required. :type linked_integration_runtime_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def remove_links( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, linked_integration_runtime_request: Union[_models.LinkedIntegrationRuntimeRequest, IO[bytes]], **kwargs: Any ) -> None: """Remove all linked integration runtimes under specific data factory in a self-hosted integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param linked_integration_runtime_request: The data factory name for the linked integration runtime. Is either a LinkedIntegrationRuntimeRequest type or a IO[bytes] type. Required. :type linked_integration_runtime_request: ~azure.mgmt.datafactory.models.LinkedIntegrationRuntimeRequest or IO[bytes] :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(linked_integration_runtime_request, (IOBase, bytes)): _content = linked_integration_runtime_request else: _json = self._serialize.body(linked_integration_runtime_request, "LinkedIntegrationRuntimeRequest") _request = build_remove_links_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @overload async def create_linked_integration_runtime( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, create_linked_integration_runtime_request: _models.CreateLinkedIntegrationRuntimeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeStatusResponse: """Create a linked integration runtime entry in a shared integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param create_linked_integration_runtime_request: The linked integration runtime properties. Required. :type create_linked_integration_runtime_request: ~azure.mgmt.datafactory.models.CreateLinkedIntegrationRuntimeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: IntegrationRuntimeStatusResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeStatusResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_linked_integration_runtime( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, create_linked_integration_runtime_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeStatusResponse: """Create a linked integration runtime entry in a shared integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param create_linked_integration_runtime_request: The linked integration runtime properties. Required. :type create_linked_integration_runtime_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: IntegrationRuntimeStatusResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeStatusResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_linked_integration_runtime( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, create_linked_integration_runtime_request: Union[_models.CreateLinkedIntegrationRuntimeRequest, IO[bytes]], **kwargs: Any ) -> _models.IntegrationRuntimeStatusResponse: """Create a linked integration runtime entry in a shared integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param create_linked_integration_runtime_request: The linked integration runtime properties. Is either a CreateLinkedIntegrationRuntimeRequest type or a IO[bytes] type. Required. :type create_linked_integration_runtime_request: ~azure.mgmt.datafactory.models.CreateLinkedIntegrationRuntimeRequest or IO[bytes] :return: IntegrationRuntimeStatusResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeStatusResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.IntegrationRuntimeStatusResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(create_linked_integration_runtime_request, (IOBase, bytes)): _content = create_linked_integration_runtime_request else: _json = self._serialize.body( create_linked_integration_runtime_request, "CreateLinkedIntegrationRuntimeRequest" ) _request = build_create_linked_integration_runtime_request( resource_group_name=resource_group_name, factory_name=factory_name, integration_runtime_name=integration_runtime_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("IntegrationRuntimeStatusResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized
class IntegrationRuntimesOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`integration_runtimes` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.IntegrationRuntimeResource"]: '''Lists integration runtimes. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either IntegrationRuntimeResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.IntegrationRuntimeResource] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, integration_runtime: _models.IntegrationRuntimeResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeResource: '''Creates or updates an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param integration_runtime: Integration runtime resource definition. Required. :type integration_runtime: ~azure.mgmt.datafactory.models.IntegrationRuntimeResource :param if_match: ETag of the integration runtime entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: IntegrationRuntimeResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, integration_runtime: _models.IntegrationRuntimeResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeResource: '''Creates or updates an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param integration_runtime: Integration runtime resource definition. Required. :type integration_runtime: IO[bytes] :param if_match: ETag of the integration runtime entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: IntegrationRuntimeResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, integration_runtime: _models.IntegrationRuntimeResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeResource: '''Creates or updates an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param integration_runtime: Integration runtime resource definition. Is either a IntegrationRuntimeResource type or a IO[bytes] type. Required. :type integration_runtime: ~azure.mgmt.datafactory.models.IntegrationRuntimeResource or IO[bytes] :param if_match: ETag of the integration runtime entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: IntegrationRuntimeResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get_next(next_link=None): '''Gets an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param if_none_match: ETag of the integration runtime entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: IntegrationRuntimeResource or None or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeResource or None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def update( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, update_integration_runtime_request: _models.UpdateIntegrationRuntimeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeResource: '''Updates an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param update_integration_runtime_request: The parameters for updating an integration runtime. Required. :type update_integration_runtime_request: ~azure.mgmt.datafactory.models.UpdateIntegrationRuntimeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: IntegrationRuntimeResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def update( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, update_integration_runtime_request: _models.UpdateIntegrationRuntimeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeResource: '''Updates an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param update_integration_runtime_request: The parameters for updating an integration runtime. Required. :type update_integration_runtime_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: IntegrationRuntimeResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def update( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, update_integration_runtime_request: _models.UpdateIntegrationRuntimeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeResource: '''Updates an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param update_integration_runtime_request: The parameters for updating an integration runtime. Is either a UpdateIntegrationRuntimeRequest type or a IO[bytes] type. Required. :type update_integration_runtime_request: ~azure.mgmt.datafactory.models.UpdateIntegrationRuntimeRequest or IO[bytes] :return: IntegrationRuntimeResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def delete( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> None: '''Deletes an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get_status( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> _models.IntegrationRuntimeStatusResponse: '''Gets detailed status information for an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: IntegrationRuntimeStatusResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeStatusResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> _models.IntegrationRuntimeOutboundNetworkDependenciesEndpointsResponse: '''Gets the list of outbound network dependencies for a given Azure-SSIS integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: IntegrationRuntimeOutboundNetworkDependenciesEndpointsResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeOutboundNetworkDependenciesEndpointsResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get_connection_info( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> _models.IntegrationRuntimeConnectionInfo: '''Gets the on-premises integration runtime connection information for encrypting the on-premises data source credentials. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: IntegrationRuntimeConnectionInfo or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeConnectionInfo :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def regenerate_auth_key( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, regenerate_key_parameters: _models.IntegrationRuntimeRegenerateKeyParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeAuthKeys: '''Regenerates the authentication key for an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param regenerate_key_parameters: The parameters for regenerating integration runtime authentication key. Required. :type regenerate_key_parameters: ~azure.mgmt.datafactory.models.IntegrationRuntimeRegenerateKeyParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: IntegrationRuntimeAuthKeys or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeAuthKeys :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def regenerate_auth_key( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, regenerate_key_parameters: _models.IntegrationRuntimeRegenerateKeyParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeAuthKeys: '''Regenerates the authentication key for an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param regenerate_key_parameters: The parameters for regenerating integration runtime authentication key. Required. :type regenerate_key_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: IntegrationRuntimeAuthKeys or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeAuthKeys :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def regenerate_auth_key( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, regenerate_key_parameters: _models.IntegrationRuntimeRegenerateKeyParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeAuthKeys: '''Regenerates the authentication key for an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param regenerate_key_parameters: The parameters for regenerating integration runtime authentication key. Is either a IntegrationRuntimeRegenerateKeyParameters type or a IO[bytes] type. Required. :type regenerate_key_parameters: ~azure.mgmt.datafactory.models.IntegrationRuntimeRegenerateKeyParameters or IO[bytes] :return: IntegrationRuntimeAuthKeys or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeAuthKeys :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def list_auth_keys( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> _models.IntegrationRuntimeAuthKeys: '''Retrieves the authentication keys for an integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: IntegrationRuntimeAuthKeys or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeAuthKeys :raises ~azure.core.exceptions.HttpResponseError: ''' pass async def _start_initial( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: pass @distributed_trace_async async def begin_start( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> AsyncLROPoller[_models.IntegrationRuntimeStatusResponse]: '''Starts a ManagedReserved type integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: An instance of AsyncLROPoller that returns either IntegrationRuntimeStatusResponse or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.IntegrationRuntimeStatusResponse] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def get_long_running_output(pipeline_response): pass async def _stop_initial( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: pass @distributed_trace_async async def begin_stop( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: '''Stops a ManagedReserved type integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def get_long_running_output(pipeline_response): pass @distributed_trace_async async def sync_credentials( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> None: '''Force the integration runtime to synchronize credentials across integration runtime nodes, and this will override the credentials across all worker nodes with those available on the dispatcher node. If you already have the latest credential backup file, you should manually import it (preferred) on any self-hosted integration runtime node than using this API directly. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get_monitoring_data( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> _models.IntegrationRuntimeMonitoringData: '''Get the integration runtime monitoring data, which includes the monitor data for all the nodes under this integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: IntegrationRuntimeMonitoringData or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeMonitoringData :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def upgrade( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, **kwargs: Any ) -> None: '''Upgrade self-hosted integration runtime to latest version if availability. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def remove_links( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, linked_integration_runtime_request: _models.LinkedIntegrationRuntimeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> None: '''Remove all linked integration runtimes under specific data factory in a self-hosted integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param linked_integration_runtime_request: The data factory name for the linked integration runtime. Required. :type linked_integration_runtime_request: ~azure.mgmt.datafactory.models.LinkedIntegrationRuntimeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def remove_links( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, linked_integration_runtime_request: _models.LinkedIntegrationRuntimeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> None: '''Remove all linked integration runtimes under specific data factory in a self-hosted integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param linked_integration_runtime_request: The data factory name for the linked integration runtime. Required. :type linked_integration_runtime_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def remove_links( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, linked_integration_runtime_request: _models.LinkedIntegrationRuntimeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> None: '''Remove all linked integration runtimes under specific data factory in a self-hosted integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param linked_integration_runtime_request: The data factory name for the linked integration runtime. Is either a LinkedIntegrationRuntimeRequest type or a IO[bytes] type. Required. :type linked_integration_runtime_request: ~azure.mgmt.datafactory.models.LinkedIntegrationRuntimeRequest or IO[bytes] :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_linked_integration_runtime( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, create_linked_integration_runtime_request: _models.CreateLinkedIntegrationRuntimeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeStatusResponse: '''Create a linked integration runtime entry in a shared integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param create_linked_integration_runtime_request: The linked integration runtime properties. Required. :type create_linked_integration_runtime_request: ~azure.mgmt.datafactory.models.CreateLinkedIntegrationRuntimeRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: IntegrationRuntimeStatusResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeStatusResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_linked_integration_runtime( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, create_linked_integration_runtime_request: _models.CreateLinkedIntegrationRuntimeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeStatusResponse: '''Create a linked integration runtime entry in a shared integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param create_linked_integration_runtime_request: The linked integration runtime properties. Required. :type create_linked_integration_runtime_request: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: IntegrationRuntimeStatusResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeStatusResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def create_linked_integration_runtime( self, resource_group_name: str, factory_name: str, integration_runtime_name: str, create_linked_integration_runtime_request: _models.CreateLinkedIntegrationRuntimeRequest, *, content_type: str = "application/json", **kwargs: Any ) -> _models.IntegrationRuntimeStatusResponse: '''Create a linked integration runtime entry in a shared integration runtime. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param integration_runtime_name: The integration runtime name. Required. :type integration_runtime_name: str :param create_linked_integration_runtime_request: The linked integration runtime properties. Is either a CreateLinkedIntegrationRuntimeRequest type or a IO[bytes] type. Required. :type create_linked_integration_runtime_request: ~azure.mgmt.datafactory.models.CreateLinkedIntegrationRuntimeRequest or IO[bytes] :return: IntegrationRuntimeStatusResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.IntegrationRuntimeStatusResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass
63
28
45
5
28
13
3
0.5
0
8
0
0
30
4
30
30
1,584
217
951
436
727
472
441
248
405
5
0
2
92
8,863
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_linked_services_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._linked_services_operations.LinkedServicesOperations
class LinkedServicesOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`linked_services` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.LinkedServiceResource"]: """Lists linked services. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either LinkedServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.LinkedServiceResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LinkedServiceListResponse] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): if not next_link: _request = build_list_by_factory_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version _parsed_next_link = urllib.parse.urlparse(next_link) _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): deserialized = self._deserialize("LinkedServiceListResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) @overload async def create_or_update( self, resource_group_name: str, factory_name: str, linked_service_name: str, linked_service: _models.LinkedServiceResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.LinkedServiceResource: """Creates or updates a linked service. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param linked_service_name: The linked service name. Required. :type linked_service_name: str :param linked_service: Linked service resource definition. Required. :type linked_service: ~azure.mgmt.datafactory.models.LinkedServiceResource :param if_match: ETag of the linkedService entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: LinkedServiceResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.LinkedServiceResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_or_update( self, resource_group_name: str, factory_name: str, linked_service_name: str, linked_service: IO[bytes], if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.LinkedServiceResource: """Creates or updates a linked service. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param linked_service_name: The linked service name. Required. :type linked_service_name: str :param linked_service: Linked service resource definition. Required. :type linked_service: IO[bytes] :param if_match: ETag of the linkedService entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: LinkedServiceResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.LinkedServiceResource :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, linked_service_name: str, linked_service: Union[_models.LinkedServiceResource, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any ) -> _models.LinkedServiceResource: """Creates or updates a linked service. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param linked_service_name: The linked service name. Required. :type linked_service_name: str :param linked_service: Linked service resource definition. Is either a LinkedServiceResource type or a IO[bytes] type. Required. :type linked_service: ~azure.mgmt.datafactory.models.LinkedServiceResource or IO[bytes] :param if_match: ETag of the linkedService entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: LinkedServiceResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.LinkedServiceResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkedServiceResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(linked_service, (IOBase, bytes)): _content = linked_service else: _json = self._serialize.body(linked_service, "LinkedServiceResource") _request = build_create_or_update_request( resource_group_name=resource_group_name, factory_name=factory_name, linked_service_name=linked_service_name, subscription_id=self._config.subscription_id, if_match=if_match, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("LinkedServiceResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, linked_service_name: str, if_none_match: Optional[str] = None, **kwargs: Any ) -> Optional[_models.LinkedServiceResource]: """Gets a linked service. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param linked_service_name: The linked service name. Required. :type linked_service_name: str :param if_none_match: ETag of the linked service entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: LinkedServiceResource or None or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.LinkedServiceResource or None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Optional[_models.LinkedServiceResource]] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, factory_name=factory_name, linked_service_name=linked_service_name, subscription_id=self._config.subscription_id, if_none_match=if_none_match, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 304]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: deserialized = self._deserialize("LinkedServiceResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def delete( self, resource_group_name: str, factory_name: str, linked_service_name: str, **kwargs: Any ) -> None: """Deletes a linked service. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param linked_service_name: The linked service name. Required. :type linked_service_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, factory_name=factory_name, linked_service_name=linked_service_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {})
class LinkedServicesOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`linked_services` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.LinkedServiceResource"]: '''Lists linked services. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either LinkedServiceResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.LinkedServiceResource] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, linked_service_name: str, linked_service: _models.LinkedServiceResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.LinkedServiceResource: '''Creates or updates a linked service. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param linked_service_name: The linked service name. Required. :type linked_service_name: str :param linked_service: Linked service resource definition. Required. :type linked_service: ~azure.mgmt.datafactory.models.LinkedServiceResource :param if_match: ETag of the linkedService entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: LinkedServiceResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.LinkedServiceResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, linked_service_name: str, linked_service: _models.LinkedServiceResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.LinkedServiceResource: '''Creates or updates a linked service. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param linked_service_name: The linked service name. Required. :type linked_service_name: str :param linked_service: Linked service resource definition. Required. :type linked_service: IO[bytes] :param if_match: ETag of the linkedService entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: LinkedServiceResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.LinkedServiceResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, linked_service_name: str, linked_service: _models.LinkedServiceResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.LinkedServiceResource: '''Creates or updates a linked service. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param linked_service_name: The linked service name. Required. :type linked_service_name: str :param linked_service: Linked service resource definition. Is either a LinkedServiceResource type or a IO[bytes] type. Required. :type linked_service: ~azure.mgmt.datafactory.models.LinkedServiceResource or IO[bytes] :param if_match: ETag of the linkedService entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: LinkedServiceResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.LinkedServiceResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get_next(next_link=None): '''Gets a linked service. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param linked_service_name: The linked service name. Required. :type linked_service_name: str :param if_none_match: ETag of the linked service entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: LinkedServiceResource or None or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.LinkedServiceResource or None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def delete( self, resource_group_name: str, factory_name: str, linked_service_name: str, **kwargs: Any ) -> None: '''Deletes a linked service. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param linked_service_name: The linked service name. Required. :type linked_service_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass
17
7
41
5
26
11
3
0.5
0
7
0
0
7
4
7
7
381
52
226
108
170
113
108
63
97
5
0
1
25
8,864
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_managed_private_endpoints_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._managed_private_endpoints_operations.ManagedPrivateEndpointsOperations
class ManagedPrivateEndpointsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`managed_private_endpoints` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, managed_virtual_network_name: str, **kwargs: Any ) -> AsyncIterable["_models.ManagedPrivateEndpointResource"]: """Lists managed private endpoints. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :return: An iterator like instance of either ManagedPrivateEndpointResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.ManagedPrivateEndpointResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedPrivateEndpointListResponse] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): if not next_link: _request = build_list_by_factory_request( resource_group_name=resource_group_name, factory_name=factory_name, managed_virtual_network_name=managed_virtual_network_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version _parsed_next_link = urllib.parse.urlparse(next_link) _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedPrivateEndpointListResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) @overload async def create_or_update( self, resource_group_name: str, factory_name: str, managed_virtual_network_name: str, managed_private_endpoint_name: str, managed_private_endpoint: _models.ManagedPrivateEndpointResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ManagedPrivateEndpointResource: """Creates or updates a managed private endpoint. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :param managed_private_endpoint_name: Managed private endpoint name. Required. :type managed_private_endpoint_name: str :param managed_private_endpoint: Managed private endpoint resource definition. Required. :type managed_private_endpoint: ~azure.mgmt.datafactory.models.ManagedPrivateEndpointResource :param if_match: ETag of the managed private endpoint entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: ManagedPrivateEndpointResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ManagedPrivateEndpointResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_or_update( self, resource_group_name: str, factory_name: str, managed_virtual_network_name: str, managed_private_endpoint_name: str, managed_private_endpoint: IO[bytes], if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ManagedPrivateEndpointResource: """Creates or updates a managed private endpoint. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :param managed_private_endpoint_name: Managed private endpoint name. Required. :type managed_private_endpoint_name: str :param managed_private_endpoint: Managed private endpoint resource definition. Required. :type managed_private_endpoint: IO[bytes] :param if_match: ETag of the managed private endpoint entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: ManagedPrivateEndpointResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ManagedPrivateEndpointResource :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, managed_virtual_network_name: str, managed_private_endpoint_name: str, managed_private_endpoint: Union[_models.ManagedPrivateEndpointResource, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any ) -> _models.ManagedPrivateEndpointResource: """Creates or updates a managed private endpoint. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :param managed_private_endpoint_name: Managed private endpoint name. Required. :type managed_private_endpoint_name: str :param managed_private_endpoint: Managed private endpoint resource definition. Is either a ManagedPrivateEndpointResource type or a IO[bytes] type. Required. :type managed_private_endpoint: ~azure.mgmt.datafactory.models.ManagedPrivateEndpointResource or IO[bytes] :param if_match: ETag of the managed private endpoint entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: ManagedPrivateEndpointResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ManagedPrivateEndpointResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedPrivateEndpointResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(managed_private_endpoint, (IOBase, bytes)): _content = managed_private_endpoint else: _json = self._serialize.body(managed_private_endpoint, "ManagedPrivateEndpointResource") _request = build_create_or_update_request( resource_group_name=resource_group_name, factory_name=factory_name, managed_virtual_network_name=managed_virtual_network_name, managed_private_endpoint_name=managed_private_endpoint_name, subscription_id=self._config.subscription_id, if_match=if_match, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedPrivateEndpointResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, managed_virtual_network_name: str, managed_private_endpoint_name: str, if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.ManagedPrivateEndpointResource: """Gets a managed private endpoint. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :param managed_private_endpoint_name: Managed private endpoint name. Required. :type managed_private_endpoint_name: str :param if_none_match: ETag of the managed private endpoint entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: ManagedPrivateEndpointResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ManagedPrivateEndpointResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedPrivateEndpointResource] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, factory_name=factory_name, managed_virtual_network_name=managed_virtual_network_name, managed_private_endpoint_name=managed_private_endpoint_name, subscription_id=self._config.subscription_id, if_none_match=if_none_match, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedPrivateEndpointResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def delete( self, resource_group_name: str, factory_name: str, managed_virtual_network_name: str, managed_private_endpoint_name: str, **kwargs: Any ) -> None: """Deletes a managed private endpoint. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :param managed_private_endpoint_name: Managed private endpoint name. Required. :type managed_private_endpoint_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, factory_name=factory_name, managed_virtual_network_name=managed_virtual_network_name, managed_private_endpoint_name=managed_private_endpoint_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {})
class ManagedPrivateEndpointsOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`managed_private_endpoints` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, managed_virtual_network_name: str, **kwargs: Any ) -> AsyncIterable["_models.ManagedPrivateEndpointResource"]: '''Lists managed private endpoints. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :return: An iterator like instance of either ManagedPrivateEndpointResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.ManagedPrivateEndpointResource] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, managed_virtual_network_name: str, managed_private_endpoint_name: str, managed_private_endpoint: _models.ManagedPrivateEndpointResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ManagedPrivateEndpointResource: '''Creates or updates a managed private endpoint. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :param managed_private_endpoint_name: Managed private endpoint name. Required. :type managed_private_endpoint_name: str :param managed_private_endpoint: Managed private endpoint resource definition. Required. :type managed_private_endpoint: ~azure.mgmt.datafactory.models.ManagedPrivateEndpointResource :param if_match: ETag of the managed private endpoint entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: ManagedPrivateEndpointResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ManagedPrivateEndpointResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, managed_virtual_network_name: str, managed_private_endpoint_name: str, managed_private_endpoint: _models.ManagedPrivateEndpointResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ManagedPrivateEndpointResource: '''Creates or updates a managed private endpoint. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :param managed_private_endpoint_name: Managed private endpoint name. Required. :type managed_private_endpoint_name: str :param managed_private_endpoint: Managed private endpoint resource definition. Required. :type managed_private_endpoint: IO[bytes] :param if_match: ETag of the managed private endpoint entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: ManagedPrivateEndpointResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ManagedPrivateEndpointResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, managed_virtual_network_name: str, managed_private_endpoint_name: str, managed_private_endpoint: _models.ManagedPrivateEndpointResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ManagedPrivateEndpointResource: '''Creates or updates a managed private endpoint. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :param managed_private_endpoint_name: Managed private endpoint name. Required. :type managed_private_endpoint_name: str :param managed_private_endpoint: Managed private endpoint resource definition. Is either a ManagedPrivateEndpointResource type or a IO[bytes] type. Required. :type managed_private_endpoint: ~azure.mgmt.datafactory.models.ManagedPrivateEndpointResource or IO[bytes] :param if_match: ETag of the managed private endpoint entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: ManagedPrivateEndpointResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ManagedPrivateEndpointResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get_next(next_link=None): '''Gets a managed private endpoint. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :param managed_private_endpoint_name: Managed private endpoint name. Required. :type managed_private_endpoint_name: str :param if_none_match: ETag of the managed private endpoint entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: ManagedPrivateEndpointResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ManagedPrivateEndpointResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def delete( self, resource_group_name: str, factory_name: str, managed_virtual_network_name: str, managed_private_endpoint_name: str, **kwargs: Any ) -> None: '''Deletes a managed private endpoint. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :param managed_private_endpoint_name: Managed private endpoint name. Required. :type managed_private_endpoint_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass
17
7
43
5
27
12
2
0.53
0
7
0
0
7
4
7
7
405
52
237
117
172
126
106
63
95
5
0
1
24
8,865
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_managed_virtual_networks_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._managed_virtual_networks_operations.ManagedVirtualNetworksOperations
class ManagedVirtualNetworksOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`managed_virtual_networks` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.ManagedVirtualNetworkResource"]: """Lists managed Virtual Networks. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either ManagedVirtualNetworkResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.ManagedVirtualNetworkResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedVirtualNetworkListResponse] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): if not next_link: _request = build_list_by_factory_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version _parsed_next_link = urllib.parse.urlparse(next_link) _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): deserialized = self._deserialize("ManagedVirtualNetworkListResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) @overload async def create_or_update( self, resource_group_name: str, factory_name: str, managed_virtual_network_name: str, managed_virtual_network: _models.ManagedVirtualNetworkResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ManagedVirtualNetworkResource: """Creates or updates a managed Virtual Network. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :param managed_virtual_network: Managed Virtual Network resource definition. Required. :type managed_virtual_network: ~azure.mgmt.datafactory.models.ManagedVirtualNetworkResource :param if_match: ETag of the managed Virtual Network entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: ManagedVirtualNetworkResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ManagedVirtualNetworkResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_or_update( self, resource_group_name: str, factory_name: str, managed_virtual_network_name: str, managed_virtual_network: IO[bytes], if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ManagedVirtualNetworkResource: """Creates or updates a managed Virtual Network. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :param managed_virtual_network: Managed Virtual Network resource definition. Required. :type managed_virtual_network: IO[bytes] :param if_match: ETag of the managed Virtual Network entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: ManagedVirtualNetworkResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ManagedVirtualNetworkResource :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, managed_virtual_network_name: str, managed_virtual_network: Union[_models.ManagedVirtualNetworkResource, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any ) -> _models.ManagedVirtualNetworkResource: """Creates or updates a managed Virtual Network. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :param managed_virtual_network: Managed Virtual Network resource definition. Is either a ManagedVirtualNetworkResource type or a IO[bytes] type. Required. :type managed_virtual_network: ~azure.mgmt.datafactory.models.ManagedVirtualNetworkResource or IO[bytes] :param if_match: ETag of the managed Virtual Network entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: ManagedVirtualNetworkResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ManagedVirtualNetworkResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedVirtualNetworkResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(managed_virtual_network, (IOBase, bytes)): _content = managed_virtual_network else: _json = self._serialize.body(managed_virtual_network, "ManagedVirtualNetworkResource") _request = build_create_or_update_request( resource_group_name=resource_group_name, factory_name=factory_name, managed_virtual_network_name=managed_virtual_network_name, subscription_id=self._config.subscription_id, if_match=if_match, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedVirtualNetworkResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, managed_virtual_network_name: str, if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.ManagedVirtualNetworkResource: """Gets a managed Virtual Network. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :param if_none_match: ETag of the managed Virtual Network entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: ManagedVirtualNetworkResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ManagedVirtualNetworkResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedVirtualNetworkResource] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, factory_name=factory_name, managed_virtual_network_name=managed_virtual_network_name, subscription_id=self._config.subscription_id, if_none_match=if_none_match, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedVirtualNetworkResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized
class ManagedVirtualNetworksOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`managed_virtual_networks` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.ManagedVirtualNetworkResource"]: '''Lists managed Virtual Networks. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either ManagedVirtualNetworkResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.ManagedVirtualNetworkResource] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, managed_virtual_network_name: str, managed_virtual_network: _models.ManagedVirtualNetworkResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ManagedVirtualNetworkResource: '''Creates or updates a managed Virtual Network. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :param managed_virtual_network: Managed Virtual Network resource definition. Required. :type managed_virtual_network: ~azure.mgmt.datafactory.models.ManagedVirtualNetworkResource :param if_match: ETag of the managed Virtual Network entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: ManagedVirtualNetworkResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ManagedVirtualNetworkResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, managed_virtual_network_name: str, managed_virtual_network: _models.ManagedVirtualNetworkResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ManagedVirtualNetworkResource: '''Creates or updates a managed Virtual Network. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :param managed_virtual_network: Managed Virtual Network resource definition. Required. :type managed_virtual_network: IO[bytes] :param if_match: ETag of the managed Virtual Network entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: ManagedVirtualNetworkResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ManagedVirtualNetworkResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, managed_virtual_network_name: str, managed_virtual_network: _models.ManagedVirtualNetworkResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.ManagedVirtualNetworkResource: '''Creates or updates a managed Virtual Network. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :param managed_virtual_network: Managed Virtual Network resource definition. Is either a ManagedVirtualNetworkResource type or a IO[bytes] type. Required. :type managed_virtual_network: ~azure.mgmt.datafactory.models.ManagedVirtualNetworkResource or IO[bytes] :param if_match: ETag of the managed Virtual Network entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: ManagedVirtualNetworkResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ManagedVirtualNetworkResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get_next(next_link=None): '''Gets a managed Virtual Network. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param managed_virtual_network_name: Managed virtual network name. Required. :type managed_virtual_network_name: str :param if_none_match: ETag of the managed Virtual Network entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: ManagedVirtualNetworkResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.ManagedVirtualNetworkResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass
15
6
39
4
25
11
2
0.53
0
7
0
0
6
4
6
6
325
43
189
95
137
101
89
53
79
5
0
1
21
8,866
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.LinkedResource
class LinkedResource(msrest.serialization.Model): """The definition of a linked resource. :param id: The ARM id of the linked resource. :type id: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, } def __init__( self, *, id: Optional[str] = None, **kwargs ): super(LinkedResource, self).__init__(**kwargs) self.id = id
class LinkedResource(msrest.serialization.Model): '''The definition of a linked resource. :param id: The ARM id of the linked resource. :type id: str ''' def __init__( self, *, id: Optional[str] = None, **kwargs ): pass
2
1
8
0
8
0
1
0.33
1
2
0
0
1
1
1
1
19
3
12
9
5
4
5
4
3
1
1
0
1
8,867
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._operations.Operations
class Operations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`operations` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: """Lists the available Azure Data Factory API operations. :return: An iterator like instance of either Operation or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResponse] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): if not next_link: _request = build_list_request( api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version _parsed_next_link = urllib.parse.urlparse(next_link) _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): deserialized = self._deserialize("OperationListResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data)
class Operations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`operations` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @distributed_trace def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: '''Lists the available Azure Data Factory API operations. :return: An iterator like instance of either Operation or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass
7
2
25
3
20
2
2
0.24
0
4
0
0
2
4
2
2
91
16
62
27
55
15
42
26
36
5
0
1
12
8,868
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_pipelines_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._pipelines_operations.PipelinesOperations
class PipelinesOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`pipelines` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.PipelineResource"]: """Lists pipelines. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either PipelineResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.PipelineResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PipelineListResponse] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): if not next_link: _request = build_list_by_factory_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version _parsed_next_link = urllib.parse.urlparse(next_link) _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): deserialized = self._deserialize("PipelineListResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) @overload async def create_or_update( self, resource_group_name: str, factory_name: str, pipeline_name: str, pipeline: _models.PipelineResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.PipelineResource: """Creates or updates a pipeline. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param pipeline_name: The pipeline name. Required. :type pipeline_name: str :param pipeline: Pipeline resource definition. Required. :type pipeline: ~azure.mgmt.datafactory.models.PipelineResource :param if_match: ETag of the pipeline entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PipelineResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PipelineResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_or_update( self, resource_group_name: str, factory_name: str, pipeline_name: str, pipeline: IO[bytes], if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.PipelineResource: """Creates or updates a pipeline. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param pipeline_name: The pipeline name. Required. :type pipeline_name: str :param pipeline: Pipeline resource definition. Required. :type pipeline: IO[bytes] :param if_match: ETag of the pipeline entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: PipelineResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PipelineResource :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, pipeline_name: str, pipeline: Union[_models.PipelineResource, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any ) -> _models.PipelineResource: """Creates or updates a pipeline. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param pipeline_name: The pipeline name. Required. :type pipeline_name: str :param pipeline: Pipeline resource definition. Is either a PipelineResource type or a IO[bytes] type. Required. :type pipeline: ~azure.mgmt.datafactory.models.PipelineResource or IO[bytes] :param if_match: ETag of the pipeline entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: PipelineResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PipelineResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PipelineResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(pipeline, (IOBase, bytes)): _content = pipeline else: _json = self._serialize.body(pipeline, "PipelineResource") _request = build_create_or_update_request( resource_group_name=resource_group_name, factory_name=factory_name, pipeline_name=pipeline_name, subscription_id=self._config.subscription_id, if_match=if_match, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("PipelineResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, pipeline_name: str, if_none_match: Optional[str] = None, **kwargs: Any ) -> Optional[_models.PipelineResource]: """Gets a pipeline. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param pipeline_name: The pipeline name. Required. :type pipeline_name: str :param if_none_match: ETag of the pipeline entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: PipelineResource or None or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PipelineResource or None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Optional[_models.PipelineResource]] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, factory_name=factory_name, pipeline_name=pipeline_name, subscription_id=self._config.subscription_id, if_none_match=if_none_match, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 304]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: deserialized = self._deserialize("PipelineResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def delete(self, resource_group_name: str, factory_name: str, pipeline_name: str, **kwargs: Any) -> None: """Deletes a pipeline. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param pipeline_name: The pipeline name. Required. :type pipeline_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, factory_name=factory_name, pipeline_name=pipeline_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @overload async def create_run( self, resource_group_name: str, factory_name: str, pipeline_name: str, reference_pipeline_run_id: Optional[str] = None, is_recovery: Optional[bool] = None, start_activity_name: Optional[str] = None, start_from_failure: Optional[bool] = None, parameters: Optional[Dict[str, JSON]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateRunResponse: """Creates a run of a pipeline. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param pipeline_name: The pipeline name. Required. :type pipeline_name: str :param reference_pipeline_run_id: The pipeline run identifier. If run ID is specified the parameters of the specified run will be used to create a new run. Default value is None. :type reference_pipeline_run_id: str :param is_recovery: Recovery mode flag. If recovery mode is set to true, the specified referenced pipeline run and the new run will be grouped under the same groupId. Default value is None. :type is_recovery: bool :param start_activity_name: In recovery mode, the rerun will start from this activity. If not specified, all activities will run. Default value is None. :type start_activity_name: str :param start_from_failure: In recovery mode, if set to true, the rerun will start from failed activities. The property will be used only if startActivityName is not specified. Default value is None. :type start_from_failure: bool :param parameters: Parameters of the pipeline run. These parameters will be used only if the runId is not specified. Default value is None. :type parameters: dict[str, JSON] :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: CreateRunResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.CreateRunResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_run( self, resource_group_name: str, factory_name: str, pipeline_name: str, reference_pipeline_run_id: Optional[str] = None, is_recovery: Optional[bool] = None, start_activity_name: Optional[str] = None, start_from_failure: Optional[bool] = None, parameters: Optional[IO[bytes]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateRunResponse: """Creates a run of a pipeline. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param pipeline_name: The pipeline name. Required. :type pipeline_name: str :param reference_pipeline_run_id: The pipeline run identifier. If run ID is specified the parameters of the specified run will be used to create a new run. Default value is None. :type reference_pipeline_run_id: str :param is_recovery: Recovery mode flag. If recovery mode is set to true, the specified referenced pipeline run and the new run will be grouped under the same groupId. Default value is None. :type is_recovery: bool :param start_activity_name: In recovery mode, the rerun will start from this activity. If not specified, all activities will run. Default value is None. :type start_activity_name: str :param start_from_failure: In recovery mode, if set to true, the rerun will start from failed activities. The property will be used only if startActivityName is not specified. Default value is None. :type start_from_failure: bool :param parameters: Parameters of the pipeline run. These parameters will be used only if the runId is not specified. Default value is None. :type parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: CreateRunResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.CreateRunResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_run( self, resource_group_name: str, factory_name: str, pipeline_name: str, reference_pipeline_run_id: Optional[str] = None, is_recovery: Optional[bool] = None, start_activity_name: Optional[str] = None, start_from_failure: Optional[bool] = None, parameters: Optional[Union[Dict[str, JSON], IO[bytes]]] = None, **kwargs: Any ) -> _models.CreateRunResponse: """Creates a run of a pipeline. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param pipeline_name: The pipeline name. Required. :type pipeline_name: str :param reference_pipeline_run_id: The pipeline run identifier. If run ID is specified the parameters of the specified run will be used to create a new run. Default value is None. :type reference_pipeline_run_id: str :param is_recovery: Recovery mode flag. If recovery mode is set to true, the specified referenced pipeline run and the new run will be grouped under the same groupId. Default value is None. :type is_recovery: bool :param start_activity_name: In recovery mode, the rerun will start from this activity. If not specified, all activities will run. Default value is None. :type start_activity_name: str :param start_from_failure: In recovery mode, if set to true, the rerun will start from failed activities. The property will be used only if startActivityName is not specified. Default value is None. :type start_from_failure: bool :param parameters: Parameters of the pipeline run. These parameters will be used only if the runId is not specified. Is either a {str: JSON} type or a IO[bytes] type. Default value is None. :type parameters: dict[str, JSON] or IO[bytes] :return: CreateRunResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.CreateRunResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CreateRunResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(parameters, (IOBase, bytes)): _content = parameters else: if parameters is not None: _json = self._serialize.body(parameters, "{object}") else: _json = None _request = build_create_run_request( resource_group_name=resource_group_name, factory_name=factory_name, pipeline_name=pipeline_name, subscription_id=self._config.subscription_id, reference_pipeline_run_id=reference_pipeline_run_id, is_recovery=is_recovery, start_activity_name=start_activity_name, start_from_failure=start_from_failure, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("CreateRunResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized
class PipelinesOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`pipelines` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.PipelineResource"]: '''Lists pipelines. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either PipelineResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.PipelineResource] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, pipeline_name: str, pipeline: _models.PipelineResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.PipelineResource: '''Creates or updates a pipeline. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param pipeline_name: The pipeline name. Required. :type pipeline_name: str :param pipeline: Pipeline resource definition. Required. :type pipeline: ~azure.mgmt.datafactory.models.PipelineResource :param if_match: ETag of the pipeline entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PipelineResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PipelineResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, pipeline_name: str, pipeline: _models.PipelineResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.PipelineResource: '''Creates or updates a pipeline. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param pipeline_name: The pipeline name. Required. :type pipeline_name: str :param pipeline: Pipeline resource definition. Required. :type pipeline: IO[bytes] :param if_match: ETag of the pipeline entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: PipelineResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PipelineResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, pipeline_name: str, pipeline: _models.PipelineResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.PipelineResource: '''Creates or updates a pipeline. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param pipeline_name: The pipeline name. Required. :type pipeline_name: str :param pipeline: Pipeline resource definition. Is either a PipelineResource type or a IO[bytes] type. Required. :type pipeline: ~azure.mgmt.datafactory.models.PipelineResource or IO[bytes] :param if_match: ETag of the pipeline entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: PipelineResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PipelineResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get_next(next_link=None): '''Gets a pipeline. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param pipeline_name: The pipeline name. Required. :type pipeline_name: str :param if_none_match: ETag of the pipeline entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: PipelineResource or None or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PipelineResource or None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def delete(self, resource_group_name: str, factory_name: str, pipeline_name: str, **kwargs: Any) -> None: '''Deletes a pipeline. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param pipeline_name: The pipeline name. Required. :type pipeline_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_run( self, resource_group_name: str, factory_name: str, pipeline_name: str, reference_pipeline_run_id: Optional[str] = None, is_recovery: Optional[bool] = None, start_activity_name: Optional[str] = None, start_from_failure: Optional[bool] = None, parameters: Optional[Dict[str, JSON]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateRunResponse: '''Creates a run of a pipeline. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param pipeline_name: The pipeline name. Required. :type pipeline_name: str :param reference_pipeline_run_id: The pipeline run identifier. If run ID is specified the parameters of the specified run will be used to create a new run. Default value is None. :type reference_pipeline_run_id: str :param is_recovery: Recovery mode flag. If recovery mode is set to true, the specified referenced pipeline run and the new run will be grouped under the same groupId. Default value is None. :type is_recovery: bool :param start_activity_name: In recovery mode, the rerun will start from this activity. If not specified, all activities will run. Default value is None. :type start_activity_name: str :param start_from_failure: In recovery mode, if set to true, the rerun will start from failed activities. The property will be used only if startActivityName is not specified. Default value is None. :type start_from_failure: bool :param parameters: Parameters of the pipeline run. These parameters will be used only if the runId is not specified. Default value is None. :type parameters: dict[str, JSON] :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: CreateRunResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.CreateRunResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_run( self, resource_group_name: str, factory_name: str, pipeline_name: str, reference_pipeline_run_id: Optional[str] = None, is_recovery: Optional[bool] = None, start_activity_name: Optional[str] = None, start_from_failure: Optional[bool] = None, parameters: Optional[Dict[str, JSON]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateRunResponse: '''Creates a run of a pipeline. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param pipeline_name: The pipeline name. Required. :type pipeline_name: str :param reference_pipeline_run_id: The pipeline run identifier. If run ID is specified the parameters of the specified run will be used to create a new run. Default value is None. :type reference_pipeline_run_id: str :param is_recovery: Recovery mode flag. If recovery mode is set to true, the specified referenced pipeline run and the new run will be grouped under the same groupId. Default value is None. :type is_recovery: bool :param start_activity_name: In recovery mode, the rerun will start from this activity. If not specified, all activities will run. Default value is None. :type start_activity_name: str :param start_from_failure: In recovery mode, if set to true, the rerun will start from failed activities. The property will be used only if startActivityName is not specified. Default value is None. :type start_from_failure: bool :param parameters: Parameters of the pipeline run. These parameters will be used only if the runId is not specified. Default value is None. :type parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: CreateRunResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.CreateRunResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def create_run( self, resource_group_name: str, factory_name: str, pipeline_name: str, reference_pipeline_run_id: Optional[str] = None, is_recovery: Optional[bool] = None, start_activity_name: Optional[str] = None, start_from_failure: Optional[bool] = None, parameters: Optional[Dict[str, JSON]] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.CreateRunResponse: '''Creates a run of a pipeline. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param pipeline_name: The pipeline name. Required. :type pipeline_name: str :param reference_pipeline_run_id: The pipeline run identifier. If run ID is specified the parameters of the specified run will be used to create a new run. Default value is None. :type reference_pipeline_run_id: str :param is_recovery: Recovery mode flag. If recovery mode is set to true, the specified referenced pipeline run and the new run will be grouped under the same groupId. Default value is None. :type is_recovery: bool :param start_activity_name: In recovery mode, the rerun will start from this activity. If not specified, all activities will run. Default value is None. :type start_activity_name: str :param start_from_failure: In recovery mode, if set to true, the rerun will start from failed activities. The property will be used only if startActivityName is not specified. Default value is None. :type start_from_failure: bool :param parameters: Parameters of the pipeline run. These parameters will be used only if the runId is not specified. Is either a {str: JSON} type or a IO[bytes] type. Default value is None. :type parameters: dict[str, JSON] or IO[bytes] :return: CreateRunResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.CreateRunResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass
23
10
46
5
27
15
2
0.64
0
8
0
0
10
4
10
10
576
68
318
162
221
203
138
79
124
5
0
2
32
8,869
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_private_end_point_connections_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._private_end_point_connections_operations.PrivateEndPointConnectionsOperations
class PrivateEndPointConnectionsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`private_end_point_connections` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.PrivateEndpointConnectionResource"]: """Lists Private endpoint connections. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either PrivateEndpointConnectionResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.PrivateEndpointConnectionResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnectionListResponse] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): if not next_link: _request = build_list_by_factory_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version _parsed_next_link = urllib.parse.urlparse(next_link) _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): deserialized = self._deserialize("PrivateEndpointConnectionListResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data)
class PrivateEndPointConnectionsOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`private_end_point_connections` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.PrivateEndpointConnectionResource"]: '''Lists Private endpoint connections. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either PrivateEndpointConnectionResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.PrivateEndpointConnectionResource] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass
7
2
27
3
21
3
2
0.31
0
4
0
0
2
4
2
2
102
16
67
29
58
21
42
26
36
5
0
1
12
8,870
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_private_endpoint_connection_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._private_endpoint_connection_operations.PrivateEndpointConnectionOperations
class PrivateEndpointConnectionOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`private_endpoint_connection` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload async def create_or_update( self, resource_group_name: str, factory_name: str, private_endpoint_connection_name: str, private_endpoint_wrapper: _models.PrivateLinkConnectionApprovalRequestResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.PrivateEndpointConnectionResource: """Approves or rejects a private endpoint connection. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param private_endpoint_connection_name: The private endpoint connection name. Required. :type private_endpoint_connection_name: str :param private_endpoint_wrapper: Required. :type private_endpoint_wrapper: ~azure.mgmt.datafactory.models.PrivateLinkConnectionApprovalRequestResource :param if_match: ETag of the private endpoint connection entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PrivateEndpointConnectionResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PrivateEndpointConnectionResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_or_update( self, resource_group_name: str, factory_name: str, private_endpoint_connection_name: str, private_endpoint_wrapper: IO[bytes], if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.PrivateEndpointConnectionResource: """Approves or rejects a private endpoint connection. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param private_endpoint_connection_name: The private endpoint connection name. Required. :type private_endpoint_connection_name: str :param private_endpoint_wrapper: Required. :type private_endpoint_wrapper: IO[bytes] :param if_match: ETag of the private endpoint connection entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: PrivateEndpointConnectionResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PrivateEndpointConnectionResource :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, private_endpoint_connection_name: str, private_endpoint_wrapper: Union[_models.PrivateLinkConnectionApprovalRequestResource, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any ) -> _models.PrivateEndpointConnectionResource: """Approves or rejects a private endpoint connection. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param private_endpoint_connection_name: The private endpoint connection name. Required. :type private_endpoint_connection_name: str :param private_endpoint_wrapper: Is either a PrivateLinkConnectionApprovalRequestResource type or a IO[bytes] type. Required. :type private_endpoint_wrapper: ~azure.mgmt.datafactory.models.PrivateLinkConnectionApprovalRequestResource or IO[bytes] :param if_match: ETag of the private endpoint connection entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: PrivateEndpointConnectionResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PrivateEndpointConnectionResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateEndpointConnectionResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(private_endpoint_wrapper, (IOBase, bytes)): _content = private_endpoint_wrapper else: _json = self._serialize.body(private_endpoint_wrapper, "PrivateLinkConnectionApprovalRequestResource") _request = build_create_or_update_request( resource_group_name=resource_group_name, factory_name=factory_name, private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, if_match=if_match, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("PrivateEndpointConnectionResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, private_endpoint_connection_name: str, if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.PrivateEndpointConnectionResource: """Gets a private endpoint connection. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param private_endpoint_connection_name: The private endpoint connection name. Required. :type private_endpoint_connection_name: str :param if_none_match: ETag of the private endpoint connection entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: PrivateEndpointConnectionResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PrivateEndpointConnectionResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnectionResource] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, factory_name=factory_name, private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, if_none_match=if_none_match, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("PrivateEndpointConnectionResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def delete( self, resource_group_name: str, factory_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: """Deletes a private endpoint connection. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param private_endpoint_connection_name: The private endpoint connection name. Required. :type private_endpoint_connection_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, factory_name=factory_name, private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {})
class PrivateEndpointConnectionOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`private_endpoint_connection` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, private_endpoint_connection_name: str, private_endpoint_wrapper: _models.PrivateLinkConnectionApprovalRequestResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.PrivateEndpointConnectionResource: '''Approves or rejects a private endpoint connection. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param private_endpoint_connection_name: The private endpoint connection name. Required. :type private_endpoint_connection_name: str :param private_endpoint_wrapper: Required. :type private_endpoint_wrapper: ~azure.mgmt.datafactory.models.PrivateLinkConnectionApprovalRequestResource :param if_match: ETag of the private endpoint connection entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PrivateEndpointConnectionResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PrivateEndpointConnectionResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, private_endpoint_connection_name: str, private_endpoint_wrapper: _models.PrivateLinkConnectionApprovalRequestResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.PrivateEndpointConnectionResource: '''Approves or rejects a private endpoint connection. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param private_endpoint_connection_name: The private endpoint connection name. Required. :type private_endpoint_connection_name: str :param private_endpoint_wrapper: Required. :type private_endpoint_wrapper: IO[bytes] :param if_match: ETag of the private endpoint connection entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: PrivateEndpointConnectionResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PrivateEndpointConnectionResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, private_endpoint_connection_name: str, private_endpoint_wrapper: _models.PrivateLinkConnectionApprovalRequestResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.PrivateEndpointConnectionResource: '''Approves or rejects a private endpoint connection. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param private_endpoint_connection_name: The private endpoint connection name. Required. :type private_endpoint_connection_name: str :param private_endpoint_wrapper: Is either a PrivateLinkConnectionApprovalRequestResource type or a IO[bytes] type. Required. :type private_endpoint_wrapper: ~azure.mgmt.datafactory.models.PrivateLinkConnectionApprovalRequestResource or IO[bytes] :param if_match: ETag of the private endpoint connection entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: PrivateEndpointConnectionResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PrivateEndpointConnectionResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, private_endpoint_connection_name: str, if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.PrivateEndpointConnectionResource: '''Gets a private endpoint connection. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param private_endpoint_connection_name: The private endpoint connection name. Required. :type private_endpoint_connection_name: str :param if_none_match: ETag of the private endpoint connection entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: PrivateEndpointConnectionResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PrivateEndpointConnectionResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def delete( self, resource_group_name: str, factory_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: '''Deletes a private endpoint connection. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param private_endpoint_connection_name: The private endpoint connection name. Required. :type private_endpoint_connection_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass
12
6
46
5
26
16
3
0.61
0
7
0
0
6
4
6
6
297
39
165
87
116
101
72
45
65
5
0
1
17
8,871
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_private_link_resources_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._private_link_resources_operations.PrivateLinkResourcesOperations
class PrivateLinkResourcesOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`private_link_resources` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> _models.PrivateLinkResourcesWrapper: """Gets the private link resources. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: PrivateLinkResourcesWrapper or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PrivateLinkResourcesWrapper :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResourcesWrapper] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("PrivateLinkResourcesWrapper", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized
class PrivateLinkResourcesOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`private_link_resources` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> _models.PrivateLinkResourcesWrapper: '''Gets the private link resources. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: PrivateLinkResourcesWrapper or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PrivateLinkResourcesWrapper :raises ~azure.core.exceptions.HttpResponseError: ''' pass
4
2
30
5
21
6
4
0.43
0
4
0
0
2
4
2
2
74
14
44
22
38
19
27
19
24
5
0
1
8
8,872
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_trigger_runs_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._trigger_runs_operations.TriggerRunsOperations
class TriggerRunsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`trigger_runs` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async async def rerun( self, resource_group_name: str, factory_name: str, trigger_name: str, run_id: str, **kwargs: Any ) -> None: """Rerun single trigger instance by runId. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :param run_id: The pipeline run identifier. Required. :type run_id: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_rerun_request( resource_group_name=resource_group_name, factory_name=factory_name, trigger_name=trigger_name, run_id=run_id, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async async def cancel( self, resource_group_name: str, factory_name: str, trigger_name: str, run_id: str, **kwargs: Any ) -> None: """Cancel a single trigger instance by runId. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :param run_id: The pipeline run identifier. Required. :type run_id: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_cancel_request( resource_group_name=resource_group_name, factory_name=factory_name, trigger_name=trigger_name, run_id=run_id, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @overload async def query_by_factory( self, resource_group_name: str, factory_name: str, filter_parameters: _models.RunFilterParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.TriggerRunsQueryResponse: """Query trigger runs. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param filter_parameters: Parameters to filter the pipeline run. Required. :type filter_parameters: ~azure.mgmt.datafactory.models.RunFilterParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: TriggerRunsQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerRunsQueryResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def query_by_factory( self, resource_group_name: str, factory_name: str, filter_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.TriggerRunsQueryResponse: """Query trigger runs. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param filter_parameters: Parameters to filter the pipeline run. Required. :type filter_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: TriggerRunsQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerRunsQueryResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def query_by_factory( self, resource_group_name: str, factory_name: str, filter_parameters: Union[_models.RunFilterParameters, IO[bytes]], **kwargs: Any ) -> _models.TriggerRunsQueryResponse: """Query trigger runs. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param filter_parameters: Parameters to filter the pipeline run. Is either a RunFilterParameters type or a IO[bytes] type. Required. :type filter_parameters: ~azure.mgmt.datafactory.models.RunFilterParameters or IO[bytes] :return: TriggerRunsQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerRunsQueryResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TriggerRunsQueryResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(filter_parameters, (IOBase, bytes)): _content = filter_parameters else: _json = self._serialize.body(filter_parameters, "RunFilterParameters") _request = build_query_by_factory_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("TriggerRunsQueryResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized
class TriggerRunsOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`trigger_runs` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @distributed_trace_async async def rerun( self, resource_group_name: str, factory_name: str, trigger_name: str, run_id: str, **kwargs: Any ) -> None: '''Rerun single trigger instance by runId. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :param run_id: The pipeline run identifier. Required. :type run_id: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def cancel( self, resource_group_name: str, factory_name: str, trigger_name: str, run_id: str, **kwargs: Any ) -> None: '''Cancel a single trigger instance by runId. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :param run_id: The pipeline run identifier. Required. :type run_id: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def query_by_factory( self, resource_group_name: str, factory_name: str, filter_parameters: _models.RunFilterParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.TriggerRunsQueryResponse: '''Query trigger runs. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param filter_parameters: Parameters to filter the pipeline run. Required. :type filter_parameters: ~azure.mgmt.datafactory.models.RunFilterParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: TriggerRunsQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerRunsQueryResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def query_by_factory( self, resource_group_name: str, factory_name: str, filter_parameters: _models.RunFilterParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.TriggerRunsQueryResponse: '''Query trigger runs. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param filter_parameters: Parameters to filter the pipeline run. Required. :type filter_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: TriggerRunsQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerRunsQueryResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def query_by_factory( self, resource_group_name: str, factory_name: str, filter_parameters: _models.RunFilterParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.TriggerRunsQueryResponse: '''Query trigger runs. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param filter_parameters: Parameters to filter the pipeline run. Is either a RunFilterParameters type or a IO[bytes] type. Required. :type filter_parameters: ~azure.mgmt.datafactory.models.RunFilterParameters or IO[bytes] :return: TriggerRunsQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerRunsQueryResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass
12
6
40
5
24
12
3
0.53
0
7
0
0
6
4
6
6
261
37
151
75
113
80
70
44
63
5
0
1
17
8,873
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_triggers_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._triggers_operations.TriggersOperations
class TriggersOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`triggers` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.TriggerResource"]: """Lists triggers. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either TriggerResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.TriggerResource] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.TriggerListResponse] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): if not next_link: _request = build_list_by_factory_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) else: # make call to next link with the client's api-version _parsed_next_link = urllib.parse.urlparse(next_link) _next_request_params = case_insensitive_dict( { key: [urllib.parse.quote(v) for v in value] for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() } ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): deserialized = self._deserialize("TriggerListResponse", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) @overload async def query_by_factory( self, resource_group_name: str, factory_name: str, filter_parameters: _models.TriggerFilterParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.TriggerQueryResponse: """Query triggers. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param filter_parameters: Parameters to filter the triggers. Required. :type filter_parameters: ~azure.mgmt.datafactory.models.TriggerFilterParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: TriggerQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerQueryResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def query_by_factory( self, resource_group_name: str, factory_name: str, filter_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.TriggerQueryResponse: """Query triggers. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param filter_parameters: Parameters to filter the triggers. Required. :type filter_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: TriggerQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerQueryResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def query_by_factory( self, resource_group_name: str, factory_name: str, filter_parameters: Union[_models.TriggerFilterParameters, IO[bytes]], **kwargs: Any ) -> _models.TriggerQueryResponse: """Query triggers. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param filter_parameters: Parameters to filter the triggers. Is either a TriggerFilterParameters type or a IO[bytes] type. Required. :type filter_parameters: ~azure.mgmt.datafactory.models.TriggerFilterParameters or IO[bytes] :return: TriggerQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerQueryResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TriggerQueryResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(filter_parameters, (IOBase, bytes)): _content = filter_parameters else: _json = self._serialize.body(filter_parameters, "TriggerFilterParameters") _request = build_query_by_factory_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("TriggerQueryResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload async def create_or_update( self, resource_group_name: str, factory_name: str, trigger_name: str, trigger: _models.TriggerResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.TriggerResource: """Creates or updates a trigger. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :param trigger: Trigger resource definition. Required. :type trigger: ~azure.mgmt.datafactory.models.TriggerResource :param if_match: ETag of the trigger entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: TriggerResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerResource :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_or_update( self, resource_group_name: str, factory_name: str, trigger_name: str, trigger: IO[bytes], if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.TriggerResource: """Creates or updates a trigger. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :param trigger: Trigger resource definition. Required. :type trigger: IO[bytes] :param if_match: ETag of the trigger entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: TriggerResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerResource :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, trigger_name: str, trigger: Union[_models.TriggerResource, IO[bytes]], if_match: Optional[str] = None, **kwargs: Any ) -> _models.TriggerResource: """Creates or updates a trigger. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :param trigger: Trigger resource definition. Is either a TriggerResource type or a IO[bytes] type. Required. :type trigger: ~azure.mgmt.datafactory.models.TriggerResource or IO[bytes] :param if_match: ETag of the trigger entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: TriggerResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerResource :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TriggerResource] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(trigger, (IOBase, bytes)): _content = trigger else: _json = self._serialize.body(trigger, "TriggerResource") _request = build_create_or_update_request( resource_group_name=resource_group_name, factory_name=factory_name, trigger_name=trigger_name, subscription_id=self._config.subscription_id, if_match=if_match, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("TriggerResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def get( self, resource_group_name: str, factory_name: str, trigger_name: str, if_none_match: Optional[str] = None, **kwargs: Any ) -> Optional[_models.TriggerResource]: """Gets a trigger. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :param if_none_match: ETag of the trigger entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: TriggerResource or None or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerResource or None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Optional[_models.TriggerResource]] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, factory_name=factory_name, trigger_name=trigger_name, subscription_id=self._config.subscription_id, if_none_match=if_none_match, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 304]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None if response.status_code == 200: deserialized = self._deserialize("TriggerResource", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def delete(self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any) -> None: """Deletes a trigger. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( resource_group_name=resource_group_name, factory_name=factory_name, trigger_name=trigger_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore async def _subscribe_to_events_initial( self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_subscribe_to_events_request( resource_group_name=resource_group_name, factory_name=factory_name, trigger_name=trigger_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def begin_subscribe_to_events( self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any ) -> AsyncLROPoller[_models.TriggerSubscriptionOperationStatus]: """Subscribe event trigger to events. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :return: An instance of AsyncLROPoller that returns either TriggerSubscriptionOperationStatus or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.TriggerSubscriptionOperationStatus] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.TriggerSubscriptionOperationStatus] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._subscribe_to_events_initial( resource_group_name=resource_group_name, factory_name=factory_name, trigger_name=trigger_name, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): deserialized = self._deserialize("TriggerSubscriptionOperationStatus", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: return AsyncLROPoller[_models.TriggerSubscriptionOperationStatus].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) return AsyncLROPoller[_models.TriggerSubscriptionOperationStatus]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @distributed_trace_async async def get_event_subscription_status( self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any ) -> _models.TriggerSubscriptionOperationStatus: """Get a trigger's event subscription status. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :return: TriggerSubscriptionOperationStatus or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerSubscriptionOperationStatus :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.TriggerSubscriptionOperationStatus] = kwargs.pop("cls", None) _request = build_get_event_subscription_status_request( resource_group_name=resource_group_name, factory_name=factory_name, trigger_name=trigger_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("TriggerSubscriptionOperationStatus", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore async def _unsubscribe_from_events_initial( self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_unsubscribe_from_events_request( resource_group_name=resource_group_name, factory_name=factory_name, trigger_name=trigger_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def begin_unsubscribe_from_events( self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any ) -> AsyncLROPoller[_models.TriggerSubscriptionOperationStatus]: """Unsubscribe event trigger from events. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :return: An instance of AsyncLROPoller that returns either TriggerSubscriptionOperationStatus or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.TriggerSubscriptionOperationStatus] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.TriggerSubscriptionOperationStatus] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._unsubscribe_from_events_initial( resource_group_name=resource_group_name, factory_name=factory_name, trigger_name=trigger_name, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): deserialized = self._deserialize("TriggerSubscriptionOperationStatus", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: return AsyncLROPoller[_models.TriggerSubscriptionOperationStatus].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) return AsyncLROPoller[_models.TriggerSubscriptionOperationStatus]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) async def _start_initial( self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_start_request( resource_group_name=resource_group_name, factory_name=factory_name, trigger_name=trigger_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def begin_start( self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Starts a trigger. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._start_initial( resource_group_name=resource_group_name, factory_name=factory_name, trigger_name=trigger_name, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore async def _stop_initial( self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_stop_request( resource_group_name=resource_group_name, factory_name=factory_name, trigger_name=trigger_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def begin_stop( self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Stops a trigger. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._stop_initial( resource_group_name=resource_group_name, factory_name=factory_name, trigger_name=trigger_name, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method)
class TriggersOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`triggers` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @distributed_trace def list_by_factory( self, resource_group_name: str, factory_name: str, **kwargs: Any ) -> AsyncIterable["_models.TriggerResource"]: '''Lists triggers. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :return: An iterator like instance of either TriggerResource or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.datafactory.models.TriggerResource] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def prepare_request(next_link=None): pass async def extract_data(pipeline_response): pass async def get_next(next_link=None): pass @overload async def query_by_factory( self, resource_group_name: str, factory_name: str, filter_parameters: _models.TriggerFilterParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.TriggerQueryResponse: '''Query triggers. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param filter_parameters: Parameters to filter the triggers. Required. :type filter_parameters: ~azure.mgmt.datafactory.models.TriggerFilterParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: TriggerQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerQueryResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def query_by_factory( self, resource_group_name: str, factory_name: str, filter_parameters: _models.TriggerFilterParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.TriggerQueryResponse: '''Query triggers. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param filter_parameters: Parameters to filter the triggers. Required. :type filter_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: TriggerQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerQueryResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def query_by_factory( self, resource_group_name: str, factory_name: str, filter_parameters: _models.TriggerFilterParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.TriggerQueryResponse: '''Query triggers. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param filter_parameters: Parameters to filter the triggers. Is either a TriggerFilterParameters type or a IO[bytes] type. Required. :type filter_parameters: ~azure.mgmt.datafactory.models.TriggerFilterParameters or IO[bytes] :return: TriggerQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerQueryResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, trigger_name: str, trigger: _models.TriggerResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.TriggerResource: '''Creates or updates a trigger. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :param trigger: Trigger resource definition. Required. :type trigger: ~azure.mgmt.datafactory.models.TriggerResource :param if_match: ETag of the trigger entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: TriggerResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def create_or_update( self, resource_group_name: str, factory_name: str, trigger_name: str, trigger: _models.TriggerResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.TriggerResource: '''Creates or updates a trigger. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :param trigger: Trigger resource definition. Required. :type trigger: IO[bytes] :param if_match: ETag of the trigger entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: TriggerResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def create_or_update( self, resource_group_name: str, factory_name: str, trigger_name: str, trigger: _models.TriggerResource, if_match: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any ) -> _models.TriggerResource: '''Creates or updates a trigger. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :param trigger: Trigger resource definition. Is either a TriggerResource type or a IO[bytes] type. Required. :type trigger: ~azure.mgmt.datafactory.models.TriggerResource or IO[bytes] :param if_match: ETag of the trigger entity. Should only be specified for update, for which it should match existing entity or can be * for unconditional update. Default value is None. :type if_match: str :return: TriggerResource or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerResource :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get_next(next_link=None): '''Gets a trigger. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :param if_none_match: ETag of the trigger entity. Should only be specified for get. If the ETag matches the existing entity tag, or if * was provided, then no content will be returned. Default value is None. :type if_none_match: str :return: TriggerResource or None or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerResource or None :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def delete(self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any) -> None: '''Deletes a trigger. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass async def _subscribe_to_events_initial( self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: pass @distributed_trace_async async def begin_subscribe_to_events( self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any ) -> AsyncLROPoller[_models.TriggerSubscriptionOperationStatus]: '''Subscribe event trigger to events. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :return: An instance of AsyncLROPoller that returns either TriggerSubscriptionOperationStatus or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.TriggerSubscriptionOperationStatus] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def get_long_running_output(pipeline_response): pass @distributed_trace_async async def get_event_subscription_status( self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any ) -> _models.TriggerSubscriptionOperationStatus: '''Get a trigger's event subscription status. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :return: TriggerSubscriptionOperationStatus or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.TriggerSubscriptionOperationStatus :raises ~azure.core.exceptions.HttpResponseError: ''' pass async def _unsubscribe_from_events_initial( self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: pass @distributed_trace_async async def begin_unsubscribe_from_events( self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any ) -> AsyncLROPoller[_models.TriggerSubscriptionOperationStatus]: '''Unsubscribe event trigger from events. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :return: An instance of AsyncLROPoller that returns either TriggerSubscriptionOperationStatus or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.datafactory.models.TriggerSubscriptionOperationStatus] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def get_long_running_output(pipeline_response): pass async def _start_initial( self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: pass @distributed_trace_async async def begin_start( self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: '''Starts a trigger. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def get_long_running_output(pipeline_response): pass async def _stop_initial( self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: pass @distributed_trace_async async def begin_stop( self, resource_group_name: str, factory_name: str, trigger_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: '''Stops a trigger. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param trigger_name: The trigger name. Required. :type trigger_name: str :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: ''' pass def get_long_running_output(pipeline_response): pass
41
15
39
5
27
9
3
0.36
0
8
0
0
19
4
19
19
1,004
139
668
275
550
243
343
184
316
5
0
2
78
8,874
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.ActivityOnInactiveMarkAs
class ActivityOnInactiveMarkAs(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Status result of the activity when the state is set to Inactive. This is an optional property and if not provided when the activity is inactive, the status will be Succeeded by default. """ SUCCEEDED = "Succeeded" FAILED = "Failed" SKIPPED = "Skipped"
class ActivityOnInactiveMarkAs(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''Status result of the activity when the state is set to Inactive. This is an optional property and if not provided when the activity is inactive, the status will be Succeeded by default. '''
1
1
0
0
0
0
0
0.75
3
0
0
0
0
0
0
115
8
1
4
4
3
3
4
4
3
0
4
0
0
8,875
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.ActivityState
class ActivityState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Activity state. This is an optional property and if not provided, the state will be Active by default. """ ACTIVE = "Active" INACTIVE = "Inactive"
class ActivityState(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''Activity state. This is an optional property and if not provided, the state will be Active by default. '''
1
1
0
0
0
0
0
1
3
0
0
0
0
0
0
115
7
1
3
3
2
3
3
3
2
0
4
0
0
8,876
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/aio/operations/_pipeline_runs_operations.py
azext_datafactory.vendored_sdks.datafactory.aio.operations._pipeline_runs_operations.PipelineRunsOperations
class PipelineRunsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`pipeline_runs` attribute. """ models = _models def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client = input_args.pop(0) if input_args else kwargs.pop("client") self._config = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @overload async def query_by_factory( self, resource_group_name: str, factory_name: str, filter_parameters: _models.RunFilterParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.PipelineRunsQueryResponse: """Query pipeline runs in the factory based on input filter conditions. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param filter_parameters: Parameters to filter the pipeline run. Required. :type filter_parameters: ~azure.mgmt.datafactory.models.RunFilterParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PipelineRunsQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PipelineRunsQueryResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def query_by_factory( self, resource_group_name: str, factory_name: str, filter_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.PipelineRunsQueryResponse: """Query pipeline runs in the factory based on input filter conditions. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param filter_parameters: Parameters to filter the pipeline run. Required. :type filter_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: PipelineRunsQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PipelineRunsQueryResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def query_by_factory( self, resource_group_name: str, factory_name: str, filter_parameters: Union[_models.RunFilterParameters, IO[bytes]], **kwargs: Any ) -> _models.PipelineRunsQueryResponse: """Query pipeline runs in the factory based on input filter conditions. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param filter_parameters: Parameters to filter the pipeline run. Is either a RunFilterParameters type or a IO[bytes] type. Required. :type filter_parameters: ~azure.mgmt.datafactory.models.RunFilterParameters or IO[bytes] :return: PipelineRunsQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PipelineRunsQueryResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PipelineRunsQueryResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None if isinstance(filter_parameters, (IOBase, bytes)): _content = filter_parameters else: _json = self._serialize.body(filter_parameters, "RunFilterParameters") _request = build_query_by_factory_request( resource_group_name=resource_group_name, factory_name=factory_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("PipelineRunsQueryResponse", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def get(self, resource_group_name: str, factory_name: str, run_id: str, **kwargs: Any) -> _models.PipelineRun: """Get a pipeline run by its run ID. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param run_id: The pipeline run identifier. Required. :type run_id: str :return: PipelineRun or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PipelineRun :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PipelineRun] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, factory_name=factory_name, run_id=run_id, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize("PipelineRun", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @distributed_trace_async async def cancel( self, resource_group_name: str, factory_name: str, run_id: str, is_recursive: Optional[bool] = None, **kwargs: Any ) -> None: """Cancel a pipeline run by its run ID. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param run_id: The pipeline run identifier. Required. :type run_id: str :param is_recursive: If true, cancel all the Child pipelines that are triggered by the current pipeline. Default value is None. :type is_recursive: bool :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_cancel_request( resource_group_name=resource_group_name, factory_name=factory_name, run_id=run_id, subscription_id=self._config.subscription_id, is_recursive=is_recursive, api_version=api_version, headers=_headers, params=_params, ) _request.url = self._client.format_url(_request.url) _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {})
class PipelineRunsOperations: ''' .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.datafactory.aio.DataFactoryManagementClient`'s :attr:`pipeline_runs` attribute. ''' def __init__(self, *args, **kwargs) -> None: pass @overload async def query_by_factory( self, resource_group_name: str, factory_name: str, filter_parameters: _models.RunFilterParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.PipelineRunsQueryResponse: '''Query pipeline runs in the factory based on input filter conditions. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param filter_parameters: Parameters to filter the pipeline run. Required. :type filter_parameters: ~azure.mgmt.datafactory.models.RunFilterParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PipelineRunsQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PipelineRunsQueryResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @overload async def query_by_factory( self, resource_group_name: str, factory_name: str, filter_parameters: _models.RunFilterParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.PipelineRunsQueryResponse: '''Query pipeline runs in the factory based on input filter conditions. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param filter_parameters: Parameters to filter the pipeline run. Required. :type filter_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :return: PipelineRunsQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PipelineRunsQueryResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def query_by_factory( self, resource_group_name: str, factory_name: str, filter_parameters: _models.RunFilterParameters, *, content_type: str = "application/json", **kwargs: Any ) -> _models.PipelineRunsQueryResponse: '''Query pipeline runs in the factory based on input filter conditions. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param filter_parameters: Parameters to filter the pipeline run. Is either a RunFilterParameters type or a IO[bytes] type. Required. :type filter_parameters: ~azure.mgmt.datafactory.models.RunFilterParameters or IO[bytes] :return: PipelineRunsQueryResponse or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PipelineRunsQueryResponse :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def get(self, resource_group_name: str, factory_name: str, run_id: str, **kwargs: Any) -> _models.PipelineRun: '''Get a pipeline run by its run ID. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param run_id: The pipeline run identifier. Required. :type run_id: str :return: PipelineRun or the result of cls(response) :rtype: ~azure.mgmt.datafactory.models.PipelineRun :raises ~azure.core.exceptions.HttpResponseError: ''' pass @distributed_trace_async async def cancel( self, resource_group_name: str, factory_name: str, run_id: str, is_recursive: Optional[bool] = None, **kwargs: Any ) -> None: '''Cancel a pipeline run by its run ID. :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param factory_name: The factory name. Required. :type factory_name: str :param run_id: The pipeline run identifier. Required. :type run_id: str :param is_recursive: If true, cancel all the Child pipelines that are triggered by the current pipeline. Default value is None. :type is_recursive: bool :return: None or the result of cls(response) :rtype: None :raises ~azure.core.exceptions.HttpResponseError: ''' pass
12
6
41
5
25
12
3
0.52
0
8
0
0
6
4
6
6
266
39
155
79
114
80
72
45
65
5
0
1
17
8,877
Azure/azure-cli-extensions
src/datafactory/azext_datafactory/vendored_sdks/datafactory/models/_data_factory_management_client_enums.py
azext_datafactory.vendored_sdks.datafactory.models._data_factory_management_client_enums.DatasetCompressionLevel
class DatasetCompressionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """All available compression levels.""" OPTIMAL = "Optimal" FASTEST = "Fastest"
class DatasetCompressionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): '''All available compression levels.''' pass
1
1
0
0
0
0
0
0.33
3
0
0
0
0
0
0
115
5
1
3
3
2
1
3
3
2
0
4
0
0
8,878
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.IdentityProperties
class IdentityProperties(msrest.serialization.Model): """IdentityProperties. Variables are only populated by the server, and will be ignored when sending a request. :ivar principal_id: The identity ID. :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str :param type: Identity type. Possible values include: "SystemAssigned", "UserAssigned". :type type: str or ~microsoft_datadog_client.models.ManagedIdentityTypes """ _validation = { 'principal_id': {'readonly': True}, 'tenant_id': {'readonly': True}, } _attribute_map = { 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, } def __init__( self, *, type: Optional[Union[str, "ManagedIdentityTypes"]] = None, **kwargs ): super(IdentityProperties, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None self.type = type
class IdentityProperties(msrest.serialization.Model): '''IdentityProperties. Variables are only populated by the server, and will be ignored when sending a request. :ivar principal_id: The identity ID. :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str :param type: Identity type. Possible values include: "SystemAssigned", "UserAssigned". :type type: str or ~microsoft_datadog_client.models.ManagedIdentityTypes ''' def __init__( self, *, type: Optional[Union[str, "ManagedIdentityTypes"]] = None, **kwargs ): pass
2
1
10
0
10
0
1
0.45
1
2
0
0
1
3
1
1
34
5
20
12
13
9
8
7
6
1
1
0
1
8,879
Azure/azure-cli-extensions
src/datadog/azext_datadog/vendored_sdks/datadog/models/_models_py3.py
azext_datadog.vendored_sdks.datadog.models._models_py3.ErrorResponse
class ErrorResponse(msrest.serialization.Model): """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). :param error: The error object. :type error: ~microsoft_datadog_client.models.ErrorDetail """ _attribute_map = { 'error': {'key': 'error', 'type': 'ErrorDetail'}, } def __init__( self, *, error: Optional["ErrorDetail"] = None, **kwargs ): super(ErrorResponse, self).__init__(**kwargs) self.error = error
class ErrorResponse(msrest.serialization.Model): '''Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). :param error: The error object. :type error: ~microsoft_datadog_client.models.ErrorDetail ''' def __init__( self, *, error: Optional["ErrorDetail"] = None, **kwargs ): pass
2
1
8
0
8
0
1
0.33
1
1
0
0
1
1
1
1
19
3
12
9
5
4
5
4
3
1
1
0
1
8,880
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_update.py
azext_mobile_network.aaz.latest.mobile_network.service._update.Update.ServicesGet
class ServicesGet(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): request = self.make_request() session = self.client.send_request( request=request, stream=False, **kwargs) if session.http_response.status_code in [200]: return self.on_200(session) return self.on_error(session.http_response) @property def url(self): return self.client.format_url( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/services/{serviceName}", **self.url_parameters ) @property def method(self): return "GET" @property def error_format(self): return "MgmtErrorFormat" @property def url_parameters(self): parameters = { **self.serialize_url_param( "mobileNetworkName", self.ctx.args.mobile_network_name, required=True, ), **self.serialize_url_param( "resourceGroupName", self.ctx.args.resource_group, required=True, ), **self.serialize_url_param( "serviceName", self.ctx.args.service_name, required=True, ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2023-09-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _UpdateHelper._build_schema_service_read(cls._schema_on_200) return cls._schema_on_200
class ServicesGet(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass def on_200(self, session): pass @classmethod def _build_schema_on_200(cls): pass
17
0
7
0
7
0
1
0
1
1
1
0
8
0
9
9
86
13
73
25
56
0
33
18
23
2
1
1
11
8,881
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_update.py
azext_mobile_network.aaz.latest.mobile_network.service._update.Update.ServicesCreateOrUpdate
class ServicesCreateOrUpdate(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): request = self.make_request() session = self.client.send_request( request=request, stream=False, **kwargs) if session.http_response.status_code in [202]: return self.client.build_lro_polling( self.ctx.args.no_wait, session, self.on_200_201, self.on_error, lro_options={"final-state-via": "azure-async-operation"}, path_format_arguments=self.url_parameters, ) if session.http_response.status_code in [200, 201]: return self.client.build_lro_polling( self.ctx.args.no_wait, session, self.on_200_201, self.on_error, lro_options={"final-state-via": "azure-async-operation"}, path_format_arguments=self.url_parameters, ) return self.on_error(session.http_response) @property def url(self): return self.client.format_url( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/services/{serviceName}", **self.url_parameters ) @property def method(self): return "PUT" @property def error_format(self): return "MgmtErrorFormat" @property def url_parameters(self): parameters = { **self.serialize_url_param( "mobileNetworkName", self.ctx.args.mobile_network_name, required=True, ), **self.serialize_url_param( "resourceGroupName", self.ctx.args.resource_group, required=True, ), **self.serialize_url_param( "serviceName", self.ctx.args.service_name, required=True, ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2023-09-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Content-Type", "application/json", ), **self.serialize_header_param( "Accept", "application/json", ), } return parameters @property def content(self): _content_value, _builder = self.new_content_builder( self.ctx.args, value=self.ctx.vars.instance, ) return self.serialize_content(_content_value) def on_200_201(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200_201 ) _schema_on_200_201 = None @classmethod def _build_schema_on_200_201(cls): if cls._schema_on_200_201 is not None: return cls._schema_on_200_201 cls._schema_on_200_201 = AAZObjectType() _UpdateHelper._build_schema_service_read(cls._schema_on_200_201) return cls._schema_on_200_201
class ServicesCreateOrUpdate(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass @property def content(self): pass def on_200_201(self, session): pass @classmethod def _build_schema_on_200_201(cls): pass
19
0
9
0
9
0
1
0
1
1
1
0
9
1
10
10
114
15
99
29
80
0
38
20
27
3
1
1
13
8,882
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_update.py
azext_mobile_network.aaz.latest.mobile_network.service._update.Update.InstanceUpdateByJson
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): def __call__(self, *args, **kwargs): self._update_instance(self.ctx.vars.instance) def _update_instance(self, instance): _instance_value, _builder = self.new_content_builder( self.ctx.args, value=instance, typ=AAZObjectType ) _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={ "flags": {"required": True, "client_flatten": True}}) _builder.set_prop("tags", AAZDictType, ".tags") properties = _builder.get(".properties") if properties is not None: properties.set_prop("pccRules", AAZListType, ".pcc_rules", typ_kwargs={ "flags": {"required": True}}) properties.set_prop("servicePrecedence", AAZIntType, ".service_precedence", typ_kwargs={ "flags": {"required": True}}) properties.set_prop("serviceQosPolicy", AAZObjectType, ".service_qos_policy") pcc_rules = _builder.get(".properties.pccRules") if pcc_rules is not None: pcc_rules.set_elements(AAZObjectType, ".") _elements = _builder.get(".properties.pccRules[]") if _elements is not None: _elements.set_prop("ruleName", AAZStrType, ".rule_name", typ_kwargs={ "flags": {"required": True}}) _elements.set_prop("rulePrecedence", AAZIntType, ".rule_precedence", typ_kwargs={ "flags": {"required": True}}) _elements.set_prop( "ruleQosPolicy", AAZObjectType, ".rule_qos_policy") _elements.set_prop("serviceDataFlowTemplates", AAZListType, ".service_data_flow_templates", typ_kwargs={"flags": {"required": True}}) _elements.set_prop( "trafficControl", AAZStrType, ".traffic_control") rule_qos_policy = _builder.get( ".properties.pccRules[].ruleQosPolicy") if rule_qos_policy is not None: rule_qos_policy.set_prop("5qi", AAZIntType, ".five_qi") rule_qos_policy.set_prop( "allocationAndRetentionPriorityLevel", AAZIntType, ".allocation_and_retention_priority_level") _UpdateHelper._build_schema_ambr_update(rule_qos_policy.set_prop( "guaranteedBitRate", AAZObjectType, ".guaranteed_bit_rate")) _UpdateHelper._build_schema_ambr_update(rule_qos_policy.set_prop( "maximumBitRate", AAZObjectType, ".maximum_bit_rate", typ_kwargs={"flags": {"required": True}})) rule_qos_policy.set_prop( "preemptionCapability", AAZStrType, ".preemption_capability") rule_qos_policy.set_prop( "preemptionVulnerability", AAZStrType, ".preemption_vulnerability") service_data_flow_templates = _builder.get( ".properties.pccRules[].serviceDataFlowTemplates") if service_data_flow_templates is not None: service_data_flow_templates.set_elements(AAZObjectType, ".") _elements = _builder.get( ".properties.pccRules[].serviceDataFlowTemplates[]") if _elements is not None: _elements.set_prop("direction", AAZStrType, ".direction", typ_kwargs={ "flags": {"required": True}}) _elements.set_prop("ports", AAZListType, ".ports") _elements.set_prop("protocol", AAZListType, ".protocol", typ_kwargs={ "flags": {"required": True}}) _elements.set_prop("remoteIpList", AAZListType, ".remote_ip_list", typ_kwargs={ "flags": {"required": True}}) _elements.set_prop("templateName", AAZStrType, ".template_name", typ_kwargs={ "flags": {"required": True}}) ports = _builder.get( ".properties.pccRules[].serviceDataFlowTemplates[].ports") if ports is not None: ports.set_elements(AAZStrType, ".") protocol = _builder.get( ".properties.pccRules[].serviceDataFlowTemplates[].protocol") if protocol is not None: protocol.set_elements(AAZStrType, ".") remote_ip_list = _builder.get( ".properties.pccRules[].serviceDataFlowTemplates[].remoteIpList") if remote_ip_list is not None: remote_ip_list.set_elements(AAZStrType, ".") service_qos_policy = _builder.get(".properties.serviceQosPolicy") if service_qos_policy is not None: service_qos_policy.set_prop("5qi", AAZIntType, ".five_qi") service_qos_policy.set_prop( "allocationAndRetentionPriorityLevel", AAZIntType, ".allocation_and_retention_priority_level") _UpdateHelper._build_schema_ambr_update(service_qos_policy.set_prop( "maximumBitRate", AAZObjectType, ".maximum_bit_rate", typ_kwargs={"flags": {"required": True}})) service_qos_policy.set_prop( "preemptionCapability", AAZStrType, ".preemption_capability") service_qos_policy.set_prop( "preemptionVulnerability", AAZStrType, ".preemption_vulnerability") tags = _builder.get(".tags") if tags is not None: tags.set_elements(AAZStrType, ".") return _instance_value
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): def __call__(self, *args, **kwargs): pass def _update_instance(self, instance): pass
3
0
38
6
32
0
7
0
1
1
1
0
2
0
2
2
78
14
64
14
61
0
60
14
57
12
1
1
13
8,883
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_show.py
azext_mobile_network.aaz.latest.mobile_network.service._show.Show.ServicesGet
class ServicesGet(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): request = self.make_request() session = self.client.send_request( request=request, stream=False, **kwargs) if session.http_response.status_code in [200]: return self.on_200(session) return self.on_error(session.http_response) @property def url(self): return self.client.format_url( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/services/{serviceName}", **self.url_parameters ) @property def method(self): return "GET" @property def error_format(self): return "MgmtErrorFormat" @property def url_parameters(self): parameters = { **self.serialize_url_param( "mobileNetworkName", self.ctx.args.mobile_network_name, required=True, ), **self.serialize_url_param( "resourceGroupName", self.ctx.args.resource_group, required=True, ), **self.serialize_url_param( "serviceName", self.ctx.args.service_name, required=True, ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2023-09-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.id = AAZStrType( flags={"read_only": True}, ) _schema_on_200.location = AAZStrType( flags={"required": True}, ) _schema_on_200.name = AAZStrType( flags={"read_only": True}, ) _schema_on_200.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) _schema_on_200.system_data = AAZObjectType( serialized_name="systemData", flags={"read_only": True}, ) _schema_on_200.tags = AAZDictType() _schema_on_200.type = AAZStrType( flags={"read_only": True}, ) properties = cls._schema_on_200.properties properties.pcc_rules = AAZListType( serialized_name="pccRules", flags={"required": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.service_precedence = AAZIntType( serialized_name="servicePrecedence", flags={"required": True}, ) properties.service_qos_policy = AAZObjectType( serialized_name="serviceQosPolicy", ) pcc_rules = cls._schema_on_200.properties.pcc_rules pcc_rules.Element = AAZObjectType() _element = cls._schema_on_200.properties.pcc_rules.Element _element.rule_name = AAZStrType( serialized_name="ruleName", flags={"required": True}, ) _element.rule_precedence = AAZIntType( serialized_name="rulePrecedence", flags={"required": True}, ) _element.rule_qos_policy = AAZObjectType( serialized_name="ruleQosPolicy", ) _element.service_data_flow_templates = AAZListType( serialized_name="serviceDataFlowTemplates", flags={"required": True}, ) _element.traffic_control = AAZStrType( serialized_name="trafficControl", ) rule_qos_policy = cls._schema_on_200.properties.pcc_rules.Element.rule_qos_policy rule_qos_policy["5qi"] = AAZIntType() rule_qos_policy.allocation_and_retention_priority_level = AAZIntType( serialized_name="allocationAndRetentionPriorityLevel", ) rule_qos_policy.guaranteed_bit_rate = AAZObjectType( serialized_name="guaranteedBitRate", ) _ShowHelper._build_schema_ambr_read( rule_qos_policy.guaranteed_bit_rate) rule_qos_policy.maximum_bit_rate = AAZObjectType( serialized_name="maximumBitRate", flags={"required": True}, ) _ShowHelper._build_schema_ambr_read( rule_qos_policy.maximum_bit_rate) rule_qos_policy.preemption_capability = AAZStrType( serialized_name="preemptionCapability", ) rule_qos_policy.preemption_vulnerability = AAZStrType( serialized_name="preemptionVulnerability", ) service_data_flow_templates = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates service_data_flow_templates.Element = AAZObjectType() _element = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates.Element _element.direction = AAZStrType( flags={"required": True}, ) _element.ports = AAZListType() _element.protocol = AAZListType( flags={"required": True}, ) _element.remote_ip_list = AAZListType( serialized_name="remoteIpList", flags={"required": True}, ) _element.template_name = AAZStrType( serialized_name="templateName", flags={"required": True}, ) ports = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates.Element.ports ports.Element = AAZStrType() protocol = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates.Element.protocol protocol.Element = AAZStrType() remote_ip_list = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates.Element.remote_ip_list remote_ip_list.Element = AAZStrType() service_qos_policy = cls._schema_on_200.properties.service_qos_policy service_qos_policy["5qi"] = AAZIntType() service_qos_policy.allocation_and_retention_priority_level = AAZIntType( serialized_name="allocationAndRetentionPriorityLevel", ) service_qos_policy.maximum_bit_rate = AAZObjectType( serialized_name="maximumBitRate", flags={"required": True}, ) _ShowHelper._build_schema_ambr_read( service_qos_policy.maximum_bit_rate) service_qos_policy.preemption_capability = AAZStrType( serialized_name="preemptionCapability", ) service_qos_policy.preemption_vulnerability = AAZStrType( serialized_name="preemptionVulnerability", ) system_data = cls._schema_on_200.system_data system_data.created_at = AAZStrType( serialized_name="createdAt", ) system_data.created_by = AAZStrType( serialized_name="createdBy", ) system_data.created_by_type = AAZStrType( serialized_name="createdByType", ) system_data.last_modified_at = AAZStrType( serialized_name="lastModifiedAt", ) system_data.last_modified_by = AAZStrType( serialized_name="lastModifiedBy", ) system_data.last_modified_by_type = AAZStrType( serialized_name="lastModifiedByType", ) tags = cls._schema_on_200.tags tags.Element = AAZStrType() return cls._schema_on_200
class ServicesGet(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass def on_200(self, session): pass @classmethod def _build_schema_on_200(cls): pass
17
0
24
2
22
0
1
0
1
1
1
0
8
0
9
9
237
26
211
37
194
0
92
30
82
2
1
1
11
8,884
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_list.py
azext_mobile_network.aaz.latest.mobile_network.service._list.List.ServicesListByMobileNetwork
class ServicesListByMobileNetwork(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): request = self.make_request() session = self.client.send_request( request=request, stream=False, **kwargs) if session.http_response.status_code in [200]: return self.on_200(session) return self.on_error(session.http_response) @property def url(self): return self.client.format_url( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/services", **self.url_parameters ) @property def method(self): return "GET" @property def error_format(self): return "MgmtErrorFormat" @property def url_parameters(self): parameters = { **self.serialize_url_param( "mobileNetworkName", self.ctx.args.mobile_network_name, required=True, ), **self.serialize_url_param( "resourceGroupName", self.ctx.args.resource_group, required=True, ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2023-09-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.next_link = AAZStrType( serialized_name="nextLink", flags={"read_only": True}, ) _schema_on_200.value = AAZListType() value = cls._schema_on_200.value value.Element = AAZObjectType() _element = cls._schema_on_200.value.Element _element.id = AAZStrType( flags={"read_only": True}, ) _element.location = AAZStrType( flags={"required": True}, ) _element.name = AAZStrType( flags={"read_only": True}, ) _element.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) _element.system_data = AAZObjectType( serialized_name="systemData", flags={"read_only": True}, ) _element.tags = AAZDictType() _element.type = AAZStrType( flags={"read_only": True}, ) properties = cls._schema_on_200.value.Element.properties properties.pcc_rules = AAZListType( serialized_name="pccRules", flags={"required": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.service_precedence = AAZIntType( serialized_name="servicePrecedence", flags={"required": True}, ) properties.service_qos_policy = AAZObjectType( serialized_name="serviceQosPolicy", ) pcc_rules = cls._schema_on_200.value.Element.properties.pcc_rules pcc_rules.Element = AAZObjectType() _element = cls._schema_on_200.value.Element.properties.pcc_rules.Element _element.rule_name = AAZStrType( serialized_name="ruleName", flags={"required": True}, ) _element.rule_precedence = AAZIntType( serialized_name="rulePrecedence", flags={"required": True}, ) _element.rule_qos_policy = AAZObjectType( serialized_name="ruleQosPolicy", ) _element.service_data_flow_templates = AAZListType( serialized_name="serviceDataFlowTemplates", flags={"required": True}, ) _element.traffic_control = AAZStrType( serialized_name="trafficControl", ) rule_qos_policy = cls._schema_on_200.value.Element.properties.pcc_rules.Element.rule_qos_policy rule_qos_policy["5qi"] = AAZIntType() rule_qos_policy.allocation_and_retention_priority_level = AAZIntType( serialized_name="allocationAndRetentionPriorityLevel", ) rule_qos_policy.guaranteed_bit_rate = AAZObjectType( serialized_name="guaranteedBitRate", ) _ListHelper._build_schema_ambr_read( rule_qos_policy.guaranteed_bit_rate) rule_qos_policy.maximum_bit_rate = AAZObjectType( serialized_name="maximumBitRate", flags={"required": True}, ) _ListHelper._build_schema_ambr_read( rule_qos_policy.maximum_bit_rate) rule_qos_policy.preemption_capability = AAZStrType( serialized_name="preemptionCapability", ) rule_qos_policy.preemption_vulnerability = AAZStrType( serialized_name="preemptionVulnerability", ) service_data_flow_templates = cls._schema_on_200.value.Element.properties.pcc_rules.Element.service_data_flow_templates service_data_flow_templates.Element = AAZObjectType() _element = cls._schema_on_200.value.Element.properties.pcc_rules.Element.service_data_flow_templates.Element _element.direction = AAZStrType( flags={"required": True}, ) _element.ports = AAZListType() _element.protocol = AAZListType( flags={"required": True}, ) _element.remote_ip_list = AAZListType( serialized_name="remoteIpList", flags={"required": True}, ) _element.template_name = AAZStrType( serialized_name="templateName", flags={"required": True}, ) ports = cls._schema_on_200.value.Element.properties.pcc_rules.Element.service_data_flow_templates.Element.ports ports.Element = AAZStrType() protocol = cls._schema_on_200.value.Element.properties.pcc_rules.Element.service_data_flow_templates.Element.protocol protocol.Element = AAZStrType() remote_ip_list = cls._schema_on_200.value.Element.properties.pcc_rules.Element.service_data_flow_templates.Element.remote_ip_list remote_ip_list.Element = AAZStrType() service_qos_policy = cls._schema_on_200.value.Element.properties.service_qos_policy service_qos_policy["5qi"] = AAZIntType() service_qos_policy.allocation_and_retention_priority_level = AAZIntType( serialized_name="allocationAndRetentionPriorityLevel", ) service_qos_policy.maximum_bit_rate = AAZObjectType( serialized_name="maximumBitRate", flags={"required": True}, ) _ListHelper._build_schema_ambr_read( service_qos_policy.maximum_bit_rate) service_qos_policy.preemption_capability = AAZStrType( serialized_name="preemptionCapability", ) service_qos_policy.preemption_vulnerability = AAZStrType( serialized_name="preemptionVulnerability", ) system_data = cls._schema_on_200.value.Element.system_data system_data.created_at = AAZStrType( serialized_name="createdAt", ) system_data.created_by = AAZStrType( serialized_name="createdBy", ) system_data.created_by_type = AAZStrType( serialized_name="createdByType", ) system_data.last_modified_at = AAZStrType( serialized_name="lastModifiedAt", ) system_data.last_modified_by = AAZStrType( serialized_name="lastModifiedBy", ) system_data.last_modified_by_type = AAZStrType( serialized_name="lastModifiedByType", ) tags = cls._schema_on_200.value.Element.tags tags.Element = AAZStrType() return cls._schema_on_200
class ServicesListByMobileNetwork(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass def on_200(self, session): pass @classmethod def _build_schema_on_200(cls): pass
17
0
25
2
23
0
1
0
1
1
1
0
8
0
9
9
243
28
215
38
198
0
97
31
87
2
1
1
11
8,885
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_delete.py
azext_mobile_network.aaz.latest.mobile_network.service._delete.Delete.ServicesDelete
class ServicesDelete(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): request = self.make_request() session = self.client.send_request( request=request, stream=False, **kwargs) if session.http_response.status_code in [202]: return self.client.build_lro_polling( self.ctx.args.no_wait, session, self.on_200, self.on_error, lro_options={"final-state-via": "location"}, path_format_arguments=self.url_parameters, ) if session.http_response.status_code in [200]: return self.client.build_lro_polling( self.ctx.args.no_wait, session, self.on_200, self.on_error, lro_options={"final-state-via": "location"}, path_format_arguments=self.url_parameters, ) if session.http_response.status_code in [204]: return self.client.build_lro_polling( self.ctx.args.no_wait, session, self.on_204, self.on_error, lro_options={"final-state-via": "location"}, path_format_arguments=self.url_parameters, ) return self.on_error(session.http_response) @property def url(self): return self.client.format_url( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/services/{serviceName}", **self.url_parameters ) @property def method(self): return "DELETE" @property def error_format(self): return "MgmtErrorFormat" @property def url_parameters(self): parameters = { **self.serialize_url_param( "mobileNetworkName", self.ctx.args.mobile_network_name, required=True, ), **self.serialize_url_param( "resourceGroupName", self.ctx.args.resource_group, required=True, ), **self.serialize_url_param( "serviceName", self.ctx.args.service_name, required=True, ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2023-09-01", required=True, ), } return parameters def on_200(self, session): pass def on_204(self, session): pass
class ServicesDelete(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass def on_200(self, session): pass def on_204(self, session): pass
14
0
9
0
9
0
1
0
1
0
0
0
8
1
8
8
88
9
79
20
65
0
28
14
19
4
1
1
11
8,886
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_create.py
azext_mobile_network.aaz.latest.mobile_network.service._create.Create.ServicesCreateOrUpdate
class ServicesCreateOrUpdate(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): request = self.make_request() session = self.client.send_request( request=request, stream=False, **kwargs) if session.http_response.status_code in [202]: return self.client.build_lro_polling( self.ctx.args.no_wait, session, self.on_200_201, self.on_error, lro_options={"final-state-via": "azure-async-operation"}, path_format_arguments=self.url_parameters, ) if session.http_response.status_code in [200, 201]: return self.client.build_lro_polling( self.ctx.args.no_wait, session, self.on_200_201, self.on_error, lro_options={"final-state-via": "azure-async-operation"}, path_format_arguments=self.url_parameters, ) return self.on_error(session.http_response) @property def url(self): return self.client.format_url( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/services/{serviceName}", **self.url_parameters ) @property def method(self): return "PUT" @property def error_format(self): return "MgmtErrorFormat" @property def url_parameters(self): parameters = { **self.serialize_url_param( "mobileNetworkName", self.ctx.args.mobile_network_name, required=True, ), **self.serialize_url_param( "resourceGroupName", self.ctx.args.resource_group, required=True, ), **self.serialize_url_param( "serviceName", self.ctx.args.service_name, required=True, ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2023-09-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Content-Type", "application/json", ), **self.serialize_header_param( "Accept", "application/json", ), } return parameters @property def content(self): _content_value, _builder = self.new_content_builder( self.ctx.args, typ=AAZObjectType, typ_kwargs={ "flags": {"required": True, "client_flatten": True}} ) _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={ "flags": {"required": True}}) _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={ "flags": {"required": True, "client_flatten": True}}) _builder.set_prop("tags", AAZDictType, ".tags") properties = _builder.get(".properties") if properties is not None: properties.set_prop("pccRules", AAZListType, ".pcc_rules", typ_kwargs={ "flags": {"required": True}}) properties.set_prop("servicePrecedence", AAZIntType, ".service_precedence", typ_kwargs={ "flags": {"required": True}}) properties.set_prop("serviceQosPolicy", AAZObjectType, ".service_qos_policy") pcc_rules = _builder.get(".properties.pccRules") if pcc_rules is not None: pcc_rules.set_elements(AAZObjectType, ".") _elements = _builder.get(".properties.pccRules[]") if _elements is not None: _elements.set_prop("ruleName", AAZStrType, ".rule_name", typ_kwargs={ "flags": {"required": True}}) _elements.set_prop("rulePrecedence", AAZIntType, ".rule_precedence", typ_kwargs={ "flags": {"required": True}}) _elements.set_prop( "ruleQosPolicy", AAZObjectType, ".rule_qos_policy") _elements.set_prop("serviceDataFlowTemplates", AAZListType, ".service_data_flow_templates", typ_kwargs={"flags": {"required": True}}) _elements.set_prop( "trafficControl", AAZStrType, ".traffic_control") rule_qos_policy = _builder.get( ".properties.pccRules[].ruleQosPolicy") if rule_qos_policy is not None: rule_qos_policy.set_prop("5qi", AAZIntType, ".five_qi") rule_qos_policy.set_prop( "allocationAndRetentionPriorityLevel", AAZIntType, ".allocation_and_retention_priority_level") _CreateHelper._build_schema_ambr_create(rule_qos_policy.set_prop( "guaranteedBitRate", AAZObjectType, ".guaranteed_bit_rate")) _CreateHelper._build_schema_ambr_create(rule_qos_policy.set_prop( "maximumBitRate", AAZObjectType, ".maximum_bit_rate", typ_kwargs={"flags": {"required": True}})) rule_qos_policy.set_prop( "preemptionCapability", AAZStrType, ".preemption_capability") rule_qos_policy.set_prop( "preemptionVulnerability", AAZStrType, ".preemption_vulnerability") service_data_flow_templates = _builder.get( ".properties.pccRules[].serviceDataFlowTemplates") if service_data_flow_templates is not None: service_data_flow_templates.set_elements(AAZObjectType, ".") _elements = _builder.get( ".properties.pccRules[].serviceDataFlowTemplates[]") if _elements is not None: _elements.set_prop("direction", AAZStrType, ".direction", typ_kwargs={ "flags": {"required": True}}) _elements.set_prop("ports", AAZListType, ".ports") _elements.set_prop("protocol", AAZListType, ".protocol", typ_kwargs={ "flags": {"required": True}}) _elements.set_prop("remoteIpList", AAZListType, ".remote_ip_list", typ_kwargs={ "flags": {"required": True}}) _elements.set_prop("templateName", AAZStrType, ".template_name", typ_kwargs={ "flags": {"required": True}}) ports = _builder.get( ".properties.pccRules[].serviceDataFlowTemplates[].ports") if ports is not None: ports.set_elements(AAZStrType, ".") protocol = _builder.get( ".properties.pccRules[].serviceDataFlowTemplates[].protocol") if protocol is not None: protocol.set_elements(AAZStrType, ".") remote_ip_list = _builder.get( ".properties.pccRules[].serviceDataFlowTemplates[].remoteIpList") if remote_ip_list is not None: remote_ip_list.set_elements(AAZStrType, ".") service_qos_policy = _builder.get(".properties.serviceQosPolicy") if service_qos_policy is not None: service_qos_policy.set_prop("5qi", AAZIntType, ".five_qi") service_qos_policy.set_prop( "allocationAndRetentionPriorityLevel", AAZIntType, ".allocation_and_retention_priority_level") _CreateHelper._build_schema_ambr_create(service_qos_policy.set_prop( "maximumBitRate", AAZObjectType, ".maximum_bit_rate", typ_kwargs={"flags": {"required": True}})) service_qos_policy.set_prop( "preemptionCapability", AAZStrType, ".preemption_capability") service_qos_policy.set_prop( "preemptionVulnerability", AAZStrType, ".preemption_vulnerability") tags = _builder.get(".tags") if tags is not None: tags.set_elements(AAZStrType, ".") return self.serialize_content(_content_value) def on_200_201(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200_201 ) _schema_on_200_201 = None @classmethod def _build_schema_on_200_201(cls): if cls._schema_on_200_201 is not None: return cls._schema_on_200_201 cls._schema_on_200_201 = AAZObjectType() _schema_on_200_201 = cls._schema_on_200_201 _schema_on_200_201.id = AAZStrType( flags={"read_only": True}, ) _schema_on_200_201.location = AAZStrType( flags={"required": True}, ) _schema_on_200_201.name = AAZStrType( flags={"read_only": True}, ) _schema_on_200_201.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) _schema_on_200_201.system_data = AAZObjectType( serialized_name="systemData", flags={"read_only": True}, ) _schema_on_200_201.tags = AAZDictType() _schema_on_200_201.type = AAZStrType( flags={"read_only": True}, ) properties = cls._schema_on_200_201.properties properties.pcc_rules = AAZListType( serialized_name="pccRules", flags={"required": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.service_precedence = AAZIntType( serialized_name="servicePrecedence", flags={"required": True}, ) properties.service_qos_policy = AAZObjectType( serialized_name="serviceQosPolicy", ) pcc_rules = cls._schema_on_200_201.properties.pcc_rules pcc_rules.Element = AAZObjectType() _element = cls._schema_on_200_201.properties.pcc_rules.Element _element.rule_name = AAZStrType( serialized_name="ruleName", flags={"required": True}, ) _element.rule_precedence = AAZIntType( serialized_name="rulePrecedence", flags={"required": True}, ) _element.rule_qos_policy = AAZObjectType( serialized_name="ruleQosPolicy", ) _element.service_data_flow_templates = AAZListType( serialized_name="serviceDataFlowTemplates", flags={"required": True}, ) _element.traffic_control = AAZStrType( serialized_name="trafficControl", ) rule_qos_policy = cls._schema_on_200_201.properties.pcc_rules.Element.rule_qos_policy rule_qos_policy["5qi"] = AAZIntType() rule_qos_policy.allocation_and_retention_priority_level = AAZIntType( serialized_name="allocationAndRetentionPriorityLevel", ) rule_qos_policy.guaranteed_bit_rate = AAZObjectType( serialized_name="guaranteedBitRate", ) _CreateHelper._build_schema_ambr_read( rule_qos_policy.guaranteed_bit_rate) rule_qos_policy.maximum_bit_rate = AAZObjectType( serialized_name="maximumBitRate", flags={"required": True}, ) _CreateHelper._build_schema_ambr_read( rule_qos_policy.maximum_bit_rate) rule_qos_policy.preemption_capability = AAZStrType( serialized_name="preemptionCapability", ) rule_qos_policy.preemption_vulnerability = AAZStrType( serialized_name="preemptionVulnerability", ) service_data_flow_templates = cls._schema_on_200_201.properties.pcc_rules.Element.service_data_flow_templates service_data_flow_templates.Element = AAZObjectType() _element = cls._schema_on_200_201.properties.pcc_rules.Element.service_data_flow_templates.Element _element.direction = AAZStrType( flags={"required": True}, ) _element.ports = AAZListType() _element.protocol = AAZListType( flags={"required": True}, ) _element.remote_ip_list = AAZListType( serialized_name="remoteIpList", flags={"required": True}, ) _element.template_name = AAZStrType( serialized_name="templateName", flags={"required": True}, ) ports = cls._schema_on_200_201.properties.pcc_rules.Element.service_data_flow_templates.Element.ports ports.Element = AAZStrType() protocol = cls._schema_on_200_201.properties.pcc_rules.Element.service_data_flow_templates.Element.protocol protocol.Element = AAZStrType() remote_ip_list = cls._schema_on_200_201.properties.pcc_rules.Element.service_data_flow_templates.Element.remote_ip_list remote_ip_list.Element = AAZStrType() service_qos_policy = cls._schema_on_200_201.properties.service_qos_policy service_qos_policy["5qi"] = AAZIntType() service_qos_policy.allocation_and_retention_priority_level = AAZIntType( serialized_name="allocationAndRetentionPriorityLevel", ) service_qos_policy.maximum_bit_rate = AAZObjectType( serialized_name="maximumBitRate", flags={"required": True}, ) _CreateHelper._build_schema_ambr_read( service_qos_policy.maximum_bit_rate) service_qos_policy.preemption_capability = AAZStrType( serialized_name="preemptionCapability", ) service_qos_policy.preemption_vulnerability = AAZStrType( serialized_name="preemptionVulnerability", ) system_data = cls._schema_on_200_201.system_data system_data.created_at = AAZStrType( serialized_name="createdAt", ) system_data.created_by = AAZStrType( serialized_name="createdBy", ) system_data.created_by_type = AAZStrType( serialized_name="createdByType", ) system_data.last_modified_at = AAZStrType( serialized_name="lastModifiedAt", ) system_data.last_modified_by = AAZStrType( serialized_name="lastModifiedBy", ) system_data.last_modified_by_type = AAZStrType( serialized_name="lastModifiedByType", ) tags = cls._schema_on_200_201.tags tags.Element = AAZStrType() return cls._schema_on_200_201
class ServicesCreateOrUpdate(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass @property def content(self): pass def on_200_201(self, session): pass @classmethod def _build_schema_on_200_201(cls): pass
19
0
31
3
28
0
2
0
1
1
1
0
9
1
10
10
332
39
293
51
274
0
152
42
141
12
1
1
24
8,887
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_wait.py
azext_mobile_network.aaz.latest.mobile_network.pcdp._wait.Wait.PacketCoreDataPlanesGet
class PacketCoreDataPlanesGet(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): request = self.make_request() session = self.client.send_request( request=request, stream=False, **kwargs) if session.http_response.status_code in [200]: return self.on_200(session) return self.on_error(session.http_response) @property def url(self): return self.client.format_url( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}", **self.url_parameters ) @property def method(self): return "GET" @property def error_format(self): return "MgmtErrorFormat" @property def url_parameters(self): parameters = { **self.serialize_url_param( "packetCoreControlPlaneName", self.ctx.args.pccp_name, required=True, ), **self.serialize_url_param( "packetCoreDataPlaneName", self.ctx.args.pcdp_name, required=True, ), **self.serialize_url_param( "resourceGroupName", self.ctx.args.resource_group, required=True, ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2023-09-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.id = AAZStrType( flags={"read_only": True}, ) _schema_on_200.location = AAZStrType( flags={"required": True}, ) _schema_on_200.name = AAZStrType( flags={"read_only": True}, ) _schema_on_200.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) _schema_on_200.system_data = AAZObjectType( serialized_name="systemData", flags={"read_only": True}, ) _schema_on_200.tags = AAZDictType() _schema_on_200.type = AAZStrType( flags={"read_only": True}, ) properties = cls._schema_on_200.properties properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.user_plane_access_interface = AAZObjectType( serialized_name="userPlaneAccessInterface", flags={"required": True}, ) properties.user_plane_access_virtual_ipv4_addresses = AAZListType( serialized_name="userPlaneAccessVirtualIpv4Addresses", ) user_plane_access_interface = cls._schema_on_200.properties.user_plane_access_interface user_plane_access_interface.ipv4_address = AAZStrType( serialized_name="ipv4Address", ) user_plane_access_interface.ipv4_gateway = AAZStrType( serialized_name="ipv4Gateway", ) user_plane_access_interface.ipv4_subnet = AAZStrType( serialized_name="ipv4Subnet", ) user_plane_access_interface.name = AAZStrType() user_plane_access_virtual_ipv4_addresses = cls._schema_on_200.properties.user_plane_access_virtual_ipv4_addresses user_plane_access_virtual_ipv4_addresses.Element = AAZStrType() system_data = cls._schema_on_200.system_data system_data.created_at = AAZStrType( serialized_name="createdAt", ) system_data.created_by = AAZStrType( serialized_name="createdBy", ) system_data.created_by_type = AAZStrType( serialized_name="createdByType", ) system_data.last_modified_at = AAZStrType( serialized_name="lastModifiedAt", ) system_data.last_modified_by = AAZStrType( serialized_name="lastModifiedBy", ) system_data.last_modified_by_type = AAZStrType( serialized_name="lastModifiedByType", ) tags = cls._schema_on_200.tags tags.Element = AAZStrType() return cls._schema_on_200
class PacketCoreDataPlanesGet(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass def on_200(self, session): pass @classmethod def _build_schema_on_200(cls): pass
17
0
15
1
14
0
1
0
1
0
0
0
8
0
9
9
158
19
139
31
122
0
60
24
50
2
1
1
11
8,888
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_update.py
azext_mobile_network.aaz.latest.mobile_network.pcdp._update.Update.PacketCoreDataPlanesUpdateTags
class PacketCoreDataPlanesUpdateTags(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): request = self.make_request() session = self.client.send_request( request=request, stream=False, **kwargs) if session.http_response.status_code in [200]: return self.on_200(session) return self.on_error(session.http_response) @property def url(self): return self.client.format_url( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}", **self.url_parameters ) @property def method(self): return "PATCH" @property def error_format(self): return "MgmtErrorFormat" @property def url_parameters(self): parameters = { **self.serialize_url_param( "packetCoreControlPlaneName", self.ctx.args.pccp_name, required=True, ), **self.serialize_url_param( "packetCoreDataPlaneName", self.ctx.args.pcdp_name, required=True, ), **self.serialize_url_param( "resourceGroupName", self.ctx.args.resource_group, required=True, ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2023-09-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Content-Type", "application/json", ), **self.serialize_header_param( "Accept", "application/json", ), } return parameters @property def content(self): _content_value, _builder = self.new_content_builder( self.ctx.args, typ=AAZObjectType, typ_kwargs={ "flags": {"required": True, "client_flatten": True}} ) _builder.set_prop("tags", AAZDictType, ".tags") tags = _builder.get(".tags") if tags is not None: tags.set_elements(AAZStrType, ".") return self.serialize_content(_content_value) def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.id = AAZStrType( flags={"read_only": True}, ) _schema_on_200.location = AAZStrType( flags={"required": True}, ) _schema_on_200.name = AAZStrType( flags={"read_only": True}, ) _schema_on_200.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) _schema_on_200.system_data = AAZObjectType( serialized_name="systemData", flags={"read_only": True}, ) _schema_on_200.tags = AAZDictType() _schema_on_200.type = AAZStrType( flags={"read_only": True}, ) properties = cls._schema_on_200.properties properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.user_plane_access_interface = AAZObjectType( serialized_name="userPlaneAccessInterface", flags={"required": True}, ) properties.user_plane_access_virtual_ipv4_addresses = AAZListType( serialized_name="userPlaneAccessVirtualIpv4Addresses", ) user_plane_access_interface = cls._schema_on_200.properties.user_plane_access_interface user_plane_access_interface.ipv4_address = AAZStrType( serialized_name="ipv4Address", ) user_plane_access_interface.ipv4_gateway = AAZStrType( serialized_name="ipv4Gateway", ) user_plane_access_interface.ipv4_subnet = AAZStrType( serialized_name="ipv4Subnet", ) user_plane_access_interface.name = AAZStrType() user_plane_access_virtual_ipv4_addresses = cls._schema_on_200.properties.user_plane_access_virtual_ipv4_addresses user_plane_access_virtual_ipv4_addresses.Element = AAZStrType() system_data = cls._schema_on_200.system_data system_data.created_at = AAZStrType( serialized_name="createdAt", ) system_data.created_by = AAZStrType( serialized_name="createdBy", ) system_data.created_by_type = AAZStrType( serialized_name="createdByType", ) system_data.last_modified_at = AAZStrType( serialized_name="lastModifiedAt", ) system_data.last_modified_by = AAZStrType( serialized_name="lastModifiedBy", ) system_data.last_modified_by_type = AAZStrType( serialized_name="lastModifiedByType", ) tags = cls._schema_on_200.tags tags.Element = AAZStrType() return cls._schema_on_200
class PacketCoreDataPlanesUpdateTags(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass @property def content(self): pass def on_200(self, session): pass @classmethod def _build_schema_on_200(cls): pass
19
0
15
1
14
0
1
0
1
0
0
0
9
0
10
10
176
22
154
35
135
0
67
27
56
2
1
1
13
8,889
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_list.py
azext_mobile_network.aaz.latest.mobile_network.pcdp._list.List.PacketCoreDataPlanesListByPacketCoreControlPlane
class PacketCoreDataPlanesListByPacketCoreControlPlane(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): request = self.make_request() session = self.client.send_request( request=request, stream=False, **kwargs) if session.http_response.status_code in [200]: return self.on_200(session) return self.on_error(session.http_response) @property def url(self): return self.client.format_url( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes", **self.url_parameters ) @property def method(self): return "GET" @property def error_format(self): return "MgmtErrorFormat" @property def url_parameters(self): parameters = { **self.serialize_url_param( "packetCoreControlPlaneName", self.ctx.args.pccp_name, required=True, ), **self.serialize_url_param( "resourceGroupName", self.ctx.args.resource_group, required=True, ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2023-09-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.next_link = AAZStrType( serialized_name="nextLink", flags={"read_only": True}, ) _schema_on_200.value = AAZListType() value = cls._schema_on_200.value value.Element = AAZObjectType() _element = cls._schema_on_200.value.Element _element.id = AAZStrType( flags={"read_only": True}, ) _element.location = AAZStrType( flags={"required": True}, ) _element.name = AAZStrType( flags={"read_only": True}, ) _element.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) _element.system_data = AAZObjectType( serialized_name="systemData", flags={"read_only": True}, ) _element.tags = AAZDictType() _element.type = AAZStrType( flags={"read_only": True}, ) properties = cls._schema_on_200.value.Element.properties properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.user_plane_access_interface = AAZObjectType( serialized_name="userPlaneAccessInterface", flags={"required": True}, ) properties.user_plane_access_virtual_ipv4_addresses = AAZListType( serialized_name="userPlaneAccessVirtualIpv4Addresses", ) user_plane_access_interface = cls._schema_on_200.value.Element.properties.user_plane_access_interface user_plane_access_interface.ipv4_address = AAZStrType( serialized_name="ipv4Address", ) user_plane_access_interface.ipv4_gateway = AAZStrType( serialized_name="ipv4Gateway", ) user_plane_access_interface.ipv4_subnet = AAZStrType( serialized_name="ipv4Subnet", ) user_plane_access_interface.name = AAZStrType() user_plane_access_virtual_ipv4_addresses = cls._schema_on_200.value.Element.properties.user_plane_access_virtual_ipv4_addresses user_plane_access_virtual_ipv4_addresses.Element = AAZStrType() system_data = cls._schema_on_200.value.Element.system_data system_data.created_at = AAZStrType( serialized_name="createdAt", ) system_data.created_by = AAZStrType( serialized_name="createdBy", ) system_data.created_by_type = AAZStrType( serialized_name="createdByType", ) system_data.last_modified_at = AAZStrType( serialized_name="lastModifiedAt", ) system_data.last_modified_by = AAZStrType( serialized_name="lastModifiedBy", ) system_data.last_modified_by_type = AAZStrType( serialized_name="lastModifiedByType", ) tags = cls._schema_on_200.value.Element.tags tags.Element = AAZStrType() return cls._schema_on_200
class PacketCoreDataPlanesListByPacketCoreControlPlane(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass def on_200(self, session): pass @classmethod def _build_schema_on_200(cls): pass
17
0
16
1
15
0
1
0
1
0
0
0
8
0
9
9
164
21
143
33
126
0
65
26
55
2
1
1
11
8,890
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_delete.py
azext_mobile_network.aaz.latest.mobile_network.pcdp._delete.Delete.PacketCoreDataPlanesDelete
class PacketCoreDataPlanesDelete(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): request = self.make_request() session = self.client.send_request( request=request, stream=False, **kwargs) if session.http_response.status_code in [202]: return self.client.build_lro_polling( self.ctx.args.no_wait, session, self.on_200, self.on_error, lro_options={"final-state-via": "location"}, path_format_arguments=self.url_parameters, ) if session.http_response.status_code in [200]: return self.client.build_lro_polling( self.ctx.args.no_wait, session, self.on_200, self.on_error, lro_options={"final-state-via": "location"}, path_format_arguments=self.url_parameters, ) if session.http_response.status_code in [204]: return self.client.build_lro_polling( self.ctx.args.no_wait, session, self.on_204, self.on_error, lro_options={"final-state-via": "location"}, path_format_arguments=self.url_parameters, ) return self.on_error(session.http_response) @property def url(self): return self.client.format_url( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}", **self.url_parameters ) @property def method(self): return "DELETE" @property def error_format(self): return "MgmtErrorFormat" @property def url_parameters(self): parameters = { **self.serialize_url_param( "packetCoreControlPlaneName", self.ctx.args.pccp_name, required=True, ), **self.serialize_url_param( "packetCoreDataPlaneName", self.ctx.args.pcdp_name, required=True, ), **self.serialize_url_param( "resourceGroupName", self.ctx.args.resource_group, required=True, ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2023-09-01", required=True, ), } return parameters def on_200(self, session): pass def on_204(self, session): pass
class PacketCoreDataPlanesDelete(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass def on_200(self, session): pass def on_204(self, session): pass
14
0
9
0
9
0
1
0
1
0
0
0
8
1
8
8
88
9
79
20
65
0
28
14
19
4
1
1
11
8,891
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pcdp/_create.py
azext_mobile_network.aaz.latest.mobile_network.pcdp._create.Create.PacketCoreDataPlanesCreateOrUpdate
class PacketCoreDataPlanesCreateOrUpdate(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): request = self.make_request() session = self.client.send_request( request=request, stream=False, **kwargs) if session.http_response.status_code in [202]: return self.client.build_lro_polling( self.ctx.args.no_wait, session, self.on_200_201, self.on_error, lro_options={"final-state-via": "azure-async-operation"}, path_format_arguments=self.url_parameters, ) if session.http_response.status_code in [200, 201]: return self.client.build_lro_polling( self.ctx.args.no_wait, session, self.on_200_201, self.on_error, lro_options={"final-state-via": "azure-async-operation"}, path_format_arguments=self.url_parameters, ) return self.on_error(session.http_response) @property def url(self): return self.client.format_url( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}/packetCoreDataPlanes/{packetCoreDataPlaneName}", **self.url_parameters ) @property def method(self): return "PUT" @property def error_format(self): return "MgmtErrorFormat" @property def url_parameters(self): parameters = { **self.serialize_url_param( "packetCoreControlPlaneName", self.ctx.args.pccp_name, required=True, ), **self.serialize_url_param( "packetCoreDataPlaneName", self.ctx.args.pcdp_name, required=True, ), **self.serialize_url_param( "resourceGroupName", self.ctx.args.resource_group, required=True, ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2023-09-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Content-Type", "application/json", ), **self.serialize_header_param( "Accept", "application/json", ), } return parameters @property def content(self): _content_value, _builder = self.new_content_builder( self.ctx.args, typ=AAZObjectType, typ_kwargs={ "flags": {"required": True, "client_flatten": True}} ) _builder.set_prop("location", AAZStrType, ".location", typ_kwargs={ "flags": {"required": True}}) _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={ "flags": {"required": True, "client_flatten": True}}) _builder.set_prop("tags", AAZDictType, ".tags") properties = _builder.get(".properties") if properties is not None: properties.set_prop("userPlaneAccessInterface", AAZObjectType, ".access_interface", typ_kwargs={"flags": {"required": True}}) user_plane_access_interface = _builder.get( ".properties.userPlaneAccessInterface") if user_plane_access_interface is not None: user_plane_access_interface.set_prop( "ipv4Address", AAZStrType, ".ipv4_address") user_plane_access_interface.set_prop( "ipv4Gateway", AAZStrType, ".ipv4_gateway") user_plane_access_interface.set_prop( "ipv4Subnet", AAZStrType, ".ipv4_subnet") user_plane_access_interface.set_prop( "name", AAZStrType, ".name") tags = _builder.get(".tags") if tags is not None: tags.set_elements(AAZStrType, ".") return self.serialize_content(_content_value) def on_200_201(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200_201 ) _schema_on_200_201 = None @classmethod def _build_schema_on_200_201(cls): if cls._schema_on_200_201 is not None: return cls._schema_on_200_201 cls._schema_on_200_201 = AAZObjectType() _schema_on_200_201 = cls._schema_on_200_201 _schema_on_200_201.id = AAZStrType( flags={"read_only": True}, ) _schema_on_200_201.location = AAZStrType( flags={"required": True}, ) _schema_on_200_201.name = AAZStrType( flags={"read_only": True}, ) _schema_on_200_201.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) _schema_on_200_201.system_data = AAZObjectType( serialized_name="systemData", flags={"read_only": True}, ) _schema_on_200_201.tags = AAZDictType() _schema_on_200_201.type = AAZStrType( flags={"read_only": True}, ) properties = cls._schema_on_200_201.properties properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.user_plane_access_interface = AAZObjectType( serialized_name="userPlaneAccessInterface", flags={"required": True}, ) properties.user_plane_access_virtual_ipv4_addresses = AAZListType( serialized_name="userPlaneAccessVirtualIpv4Addresses", ) user_plane_access_interface = cls._schema_on_200_201.properties.user_plane_access_interface user_plane_access_interface.ipv4_address = AAZStrType( serialized_name="ipv4Address", ) user_plane_access_interface.ipv4_gateway = AAZStrType( serialized_name="ipv4Gateway", ) user_plane_access_interface.ipv4_subnet = AAZStrType( serialized_name="ipv4Subnet", ) user_plane_access_interface.name = AAZStrType() user_plane_access_virtual_ipv4_addresses = cls._schema_on_200_201.properties.user_plane_access_virtual_ipv4_addresses user_plane_access_virtual_ipv4_addresses.Element = AAZStrType() system_data = cls._schema_on_200_201.system_data system_data.created_at = AAZStrType( serialized_name="createdAt", ) system_data.created_by = AAZStrType( serialized_name="createdBy", ) system_data.created_by_type = AAZStrType( serialized_name="createdByType", ) system_data.last_modified_at = AAZStrType( serialized_name="lastModifiedAt", ) system_data.last_modified_by = AAZStrType( serialized_name="lastModifiedBy", ) system_data.last_modified_by_type = AAZStrType( serialized_name="lastModifiedByType", ) tags = cls._schema_on_200_201.tags tags.Element = AAZStrType() return cls._schema_on_200_201
class PacketCoreDataPlanesCreateOrUpdate(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass @property def content(self): pass def on_200_201(self, session): pass @classmethod def _build_schema_on_200_201(cls): pass
19
0
18
1
17
0
2
0
1
0
0
0
9
1
10
10
205
24
181
38
162
0
80
29
69
4
1
1
16
8,892
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/version/_show.py
azext_mobile_network.aaz.latest.mobile_network.pccp.version._show.Show.PacketCoreControlPlaneVersionsGet
class PacketCoreControlPlaneVersionsGet(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): request = self.make_request() session = self.client.send_request( request=request, stream=False, **kwargs) if session.http_response.status_code in [200]: return self.on_200(session) return self.on_error(session.http_response) @property def url(self): return self.client.format_url( "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions/{versionName}", **self.url_parameters ) @property def method(self): return "GET" @property def error_format(self): return "MgmtErrorFormat" @property def url_parameters(self): parameters = { **self.serialize_url_param( "versionName", self.ctx.args.version_name, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2023-09-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.id = AAZStrType( flags={"read_only": True}, ) _schema_on_200.name = AAZStrType( flags={"read_only": True}, ) _schema_on_200.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) _schema_on_200.system_data = AAZObjectType( serialized_name="systemData", flags={"read_only": True}, ) _schema_on_200.type = AAZStrType( flags={"read_only": True}, ) properties = cls._schema_on_200.properties properties.platforms = AAZListType() properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) platforms = cls._schema_on_200.properties.platforms platforms.Element = AAZObjectType() _element = cls._schema_on_200.properties.platforms.Element _element.maximum_platform_software_version = AAZStrType( serialized_name="maximumPlatformSoftwareVersion", ) _element.minimum_platform_software_version = AAZStrType( serialized_name="minimumPlatformSoftwareVersion", ) _element.obsolete_version = AAZStrType( serialized_name="obsoleteVersion", ) _element.platform_type = AAZStrType( serialized_name="platformType", ) _element.recommended_version = AAZStrType( serialized_name="recommendedVersion", ) _element.version_state = AAZStrType( serialized_name="versionState", ) system_data = cls._schema_on_200.system_data system_data.created_at = AAZStrType( serialized_name="createdAt", ) system_data.created_by = AAZStrType( serialized_name="createdBy", ) system_data.created_by_type = AAZStrType( serialized_name="createdByType", ) system_data.last_modified_at = AAZStrType( serialized_name="lastModifiedAt", ) system_data.last_modified_by = AAZStrType( serialized_name="lastModifiedBy", ) system_data.last_modified_by_type = AAZStrType( serialized_name="lastModifiedByType", ) return cls._schema_on_200
class PacketCoreControlPlaneVersionsGet(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass def on_200(self, session): pass @classmethod def _build_schema_on_200(cls): pass
17
0
13
1
13
0
1
0
1
0
0
0
8
0
9
9
141
18
123
30
106
0
57
23
47
2
1
1
11
8,893
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/version/_list.py
azext_mobile_network.aaz.latest.mobile_network.pccp.version._list.List.PacketCoreControlPlaneVersionsList
class PacketCoreControlPlaneVersionsList(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): request = self.make_request() session = self.client.send_request( request=request, stream=False, **kwargs) if session.http_response.status_code in [200]: return self.on_200(session) return self.on_error(session.http_response) @property def url(self): return self.client.format_url( "/providers/Microsoft.MobileNetwork/packetCoreControlPlaneVersions", **self.url_parameters ) @property def method(self): return "GET" @property def error_format(self): return "MgmtErrorFormat" @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2023-09-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.next_link = AAZStrType( serialized_name="nextLink", flags={"read_only": True}, ) _schema_on_200.value = AAZListType() value = cls._schema_on_200.value value.Element = AAZObjectType() _element = cls._schema_on_200.value.Element _element.id = AAZStrType( flags={"read_only": True}, ) _element.name = AAZStrType( flags={"read_only": True}, ) _element.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) _element.system_data = AAZObjectType( serialized_name="systemData", flags={"read_only": True}, ) _element.type = AAZStrType( flags={"read_only": True}, ) properties = cls._schema_on_200.value.Element.properties properties.platforms = AAZListType() properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) platforms = cls._schema_on_200.value.Element.properties.platforms platforms.Element = AAZObjectType() _element = cls._schema_on_200.value.Element.properties.platforms.Element _element.maximum_platform_software_version = AAZStrType( serialized_name="maximumPlatformSoftwareVersion", ) _element.minimum_platform_software_version = AAZStrType( serialized_name="minimumPlatformSoftwareVersion", ) _element.obsolete_version = AAZStrType( serialized_name="obsoleteVersion", ) _element.platform_type = AAZStrType( serialized_name="platformType", ) _element.recommended_version = AAZStrType( serialized_name="recommendedVersion", ) _element.version_state = AAZStrType( serialized_name="versionState", ) system_data = cls._schema_on_200.value.Element.system_data system_data.created_at = AAZStrType( serialized_name="createdAt", ) system_data.created_by = AAZStrType( serialized_name="createdBy", ) system_data.created_by_type = AAZStrType( serialized_name="createdByType", ) system_data.last_modified_at = AAZStrType( serialized_name="lastModifiedAt", ) system_data.last_modified_by = AAZStrType( serialized_name="lastModifiedBy", ) system_data.last_modified_by_type = AAZStrType( serialized_name="lastModifiedByType", ) return cls._schema_on_200
class PacketCoreControlPlaneVersionsList(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass def on_200(self, session): pass @classmethod def _build_schema_on_200(cls): pass
15
0
15
1
14
0
1
0
1
0
0
0
7
0
8
8
141
19
122
28
107
0
59
22
50
2
1
1
10
8,894
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_wait.py
azext_mobile_network.aaz.latest.mobile_network.pccp._wait.Wait.PacketCoreControlPlanesGet
class PacketCoreControlPlanesGet(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): request = self.make_request() session = self.client.send_request( request=request, stream=False, **kwargs) if session.http_response.status_code in [200]: return self.on_200(session) return self.on_error(session.http_response) @property def url(self): return self.client.format_url( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}", **self.url_parameters ) @property def method(self): return "GET" @property def error_format(self): return "MgmtErrorFormat" @property def url_parameters(self): parameters = { **self.serialize_url_param( "packetCoreControlPlaneName", self.ctx.args.pccp_name, required=True, ), **self.serialize_url_param( "resourceGroupName", self.ctx.args.resource_group, required=True, ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2023-09-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.id = AAZStrType( flags={"read_only": True}, ) _schema_on_200.identity = AAZObjectType() _schema_on_200.location = AAZStrType( flags={"required": True}, ) _schema_on_200.name = AAZStrType( flags={"read_only": True}, ) _schema_on_200.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) _schema_on_200.system_data = AAZObjectType( serialized_name="systemData", flags={"read_only": True}, ) _schema_on_200.tags = AAZDictType() _schema_on_200.type = AAZStrType( flags={"read_only": True}, ) identity = cls._schema_on_200.identity identity.type = AAZStrType( flags={"required": True}, ) identity.user_assigned_identities = AAZDictType( serialized_name="userAssignedIdentities", ) user_assigned_identities = cls._schema_on_200.identity.user_assigned_identities user_assigned_identities.Element = AAZObjectType() _element = cls._schema_on_200.identity.user_assigned_identities.Element _element.client_id = AAZStrType( serialized_name="clientId", flags={"read_only": True}, ) _element.principal_id = AAZStrType( serialized_name="principalId", flags={"read_only": True}, ) properties = cls._schema_on_200.properties properties.control_plane_access_interface = AAZObjectType( serialized_name="controlPlaneAccessInterface", flags={"required": True}, ) properties.control_plane_access_virtual_ipv4_addresses = AAZListType( serialized_name="controlPlaneAccessVirtualIpv4Addresses", ) properties.core_network_technology = AAZStrType( serialized_name="coreNetworkTechnology", ) properties.diagnostics_upload = AAZObjectType( serialized_name="diagnosticsUpload", ) properties.event_hub = AAZObjectType( serialized_name="eventHub", ) properties.installation = AAZObjectType() properties.installed_version = AAZStrType( serialized_name="installedVersion", flags={"read_only": True}, ) properties.interop_settings = AAZObjectType( serialized_name="interopSettings", ) properties.local_diagnostics_access = AAZObjectType( serialized_name="localDiagnosticsAccess", flags={"required": True}, ) properties.platform = AAZObjectType( flags={"required": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.rollback_version = AAZStrType( serialized_name="rollbackVersion", flags={"read_only": True}, ) properties.signaling = AAZObjectType() properties.sites = AAZListType( flags={"required": True}, ) properties.sku = AAZStrType( flags={"required": True}, ) properties.ue_mtu = AAZIntType( serialized_name="ueMtu", ) properties.version = AAZStrType() control_plane_access_interface = cls._schema_on_200.properties.control_plane_access_interface control_plane_access_interface.ipv4_address = AAZStrType( serialized_name="ipv4Address", ) control_plane_access_interface.ipv4_gateway = AAZStrType( serialized_name="ipv4Gateway", ) control_plane_access_interface.ipv4_subnet = AAZStrType( serialized_name="ipv4Subnet", ) control_plane_access_interface.name = AAZStrType() control_plane_access_virtual_ipv4_addresses = cls._schema_on_200.properties.control_plane_access_virtual_ipv4_addresses control_plane_access_virtual_ipv4_addresses.Element = AAZStrType() diagnostics_upload = cls._schema_on_200.properties.diagnostics_upload diagnostics_upload.storage_account_container_url = AAZStrType( serialized_name="storageAccountContainerUrl", flags={"required": True}, ) event_hub = cls._schema_on_200.properties.event_hub event_hub.id = AAZStrType( flags={"required": True}, ) event_hub.reporting_interval = AAZIntType( serialized_name="reportingInterval", ) installation = cls._schema_on_200.properties.installation installation.desired_state = AAZStrType( serialized_name="desiredState", ) installation.operation = AAZObjectType() installation.reasons = AAZListType( flags={"read_only": True}, ) installation.reinstall_required = AAZStrType( serialized_name="reinstallRequired", ) installation.state = AAZStrType() operation = cls._schema_on_200.properties.installation.operation operation.id = AAZStrType( flags={"required": True}, ) reasons = cls._schema_on_200.properties.installation.reasons reasons.Element = AAZStrType() local_diagnostics_access = cls._schema_on_200.properties.local_diagnostics_access local_diagnostics_access.authentication_type = AAZStrType( serialized_name="authenticationType", flags={"required": True}, ) local_diagnostics_access.https_server_certificate = AAZObjectType( serialized_name="httpsServerCertificate", ) https_server_certificate = cls._schema_on_200.properties.local_diagnostics_access.https_server_certificate https_server_certificate.certificate_url = AAZStrType( serialized_name="certificateUrl", flags={"required": True}, ) https_server_certificate.provisioning = AAZObjectType() provisioning = cls._schema_on_200.properties.local_diagnostics_access.https_server_certificate.provisioning provisioning.reason = AAZStrType( flags={"read_only": True}, ) provisioning.state = AAZStrType( flags={"read_only": True}, ) platform = cls._schema_on_200.properties.platform platform.azure_stack_edge_device = AAZObjectType( serialized_name="azureStackEdgeDevice", ) _WaitHelper._build_schema_azure_stack_edge_device_resource_id_read( platform.azure_stack_edge_device) platform.azure_stack_edge_devices = AAZListType( serialized_name="azureStackEdgeDevices", flags={"read_only": True}, ) platform.azure_stack_hci_cluster = AAZObjectType( serialized_name="azureStackHciCluster", ) platform.connected_cluster = AAZObjectType( serialized_name="connectedCluster", ) platform.custom_location = AAZObjectType( serialized_name="customLocation", ) platform.type = AAZStrType( flags={"required": True}, ) azure_stack_edge_devices = cls._schema_on_200.properties.platform.azure_stack_edge_devices azure_stack_edge_devices.Element = AAZObjectType() _WaitHelper._build_schema_azure_stack_edge_device_resource_id_read( azure_stack_edge_devices.Element) azure_stack_hci_cluster = cls._schema_on_200.properties.platform.azure_stack_hci_cluster azure_stack_hci_cluster.id = AAZStrType( flags={"required": True}, ) connected_cluster = cls._schema_on_200.properties.platform.connected_cluster connected_cluster.id = AAZStrType( flags={"required": True}, ) custom_location = cls._schema_on_200.properties.platform.custom_location custom_location.id = AAZStrType( flags={"required": True}, ) signaling = cls._schema_on_200.properties.signaling signaling.nas_reroute = AAZObjectType( serialized_name="nasReroute", ) nas_reroute = cls._schema_on_200.properties.signaling.nas_reroute nas_reroute.macro_mme_group_id = AAZIntType( serialized_name="macroMmeGroupId", flags={"required": True}, ) sites = cls._schema_on_200.properties.sites sites.Element = AAZObjectType() _element = cls._schema_on_200.properties.sites.Element _element.id = AAZStrType( flags={"required": True}, ) system_data = cls._schema_on_200.system_data system_data.created_at = AAZStrType( serialized_name="createdAt", ) system_data.created_by = AAZStrType( serialized_name="createdBy", ) system_data.created_by_type = AAZStrType( serialized_name="createdByType", ) system_data.last_modified_at = AAZStrType( serialized_name="lastModifiedAt", ) system_data.last_modified_by = AAZStrType( serialized_name="lastModifiedBy", ) system_data.last_modified_by_type = AAZStrType( serialized_name="lastModifiedByType", ) tags = cls._schema_on_200.tags tags.Element = AAZStrType() return cls._schema_on_200
class PacketCoreControlPlanesGet(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass def on_200(self, session): pass @classmethod def _build_schema_on_200(cls): pass
17
0
35
3
32
0
1
0
1
1
1
0
8
0
9
9
334
39
295
50
278
0
132
43
122
2
1
1
11
8,895
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_update.py
azext_mobile_network.aaz.latest.mobile_network.pccp._update.Update.PacketCoreControlPlanesGet
class PacketCoreControlPlanesGet(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): request = self.make_request() session = self.client.send_request( request=request, stream=False, **kwargs) if session.http_response.status_code in [200]: return self.on_200(session) return self.on_error(session.http_response) @property def url(self): return self.client.format_url( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}", **self.url_parameters ) @property def method(self): return "GET" @property def error_format(self): return "MgmtErrorFormat" @property def url_parameters(self): parameters = { **self.serialize_url_param( "packetCoreControlPlaneName", self.ctx.args.pccp_name, required=True, ), **self.serialize_url_param( "resourceGroupName", self.ctx.args.resource_group, required=True, ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2023-09-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _UpdateHelper._build_schema_packet_core_control_plane_read( cls._schema_on_200) return cls._schema_on_200
class PacketCoreControlPlanesGet(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass def on_200(self, session): pass @classmethod def _build_schema_on_200(cls): pass
17
0
7
0
7
0
1
0
1
1
1
0
8
0
9
9
82
13
69
25
52
0
33
18
23
2
1
1
11
8,896
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_update.py
azext_mobile_network.aaz.latest.mobile_network.pccp._update.Update.PacketCoreControlPlanesCreateOrUpdate
class PacketCoreControlPlanesCreateOrUpdate(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): request = self.make_request() session = self.client.send_request( request=request, stream=False, **kwargs) if session.http_response.status_code in [202]: return self.client.build_lro_polling( self.ctx.args.no_wait, session, self.on_200_201, self.on_error, lro_options={"final-state-via": "azure-async-operation"}, path_format_arguments=self.url_parameters, ) if session.http_response.status_code in [200, 201]: return self.client.build_lro_polling( self.ctx.args.no_wait, session, self.on_200_201, self.on_error, lro_options={"final-state-via": "azure-async-operation"}, path_format_arguments=self.url_parameters, ) return self.on_error(session.http_response) @property def url(self): return self.client.format_url( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/packetCoreControlPlanes/{packetCoreControlPlaneName}", **self.url_parameters ) @property def method(self): return "PUT" @property def error_format(self): return "MgmtErrorFormat" @property def url_parameters(self): parameters = { **self.serialize_url_param( "packetCoreControlPlaneName", self.ctx.args.pccp_name, required=True, ), **self.serialize_url_param( "resourceGroupName", self.ctx.args.resource_group, required=True, ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2023-09-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Content-Type", "application/json", ), **self.serialize_header_param( "Accept", "application/json", ), } return parameters @property def content(self): _content_value, _builder = self.new_content_builder( self.ctx.args, value=self.ctx.vars.instance, ) return self.serialize_content(_content_value) def on_200_201(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200_201 ) _schema_on_200_201 = None @classmethod def _build_schema_on_200_201(cls): if cls._schema_on_200_201 is not None: return cls._schema_on_200_201 cls._schema_on_200_201 = AAZObjectType() _UpdateHelper._build_schema_packet_core_control_plane_read( cls._schema_on_200_201) return cls._schema_on_200_201
class PacketCoreControlPlanesCreateOrUpdate(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass @property def content(self): pass def on_200_201(self, session): pass @classmethod def _build_schema_on_200_201(cls): pass
19
0
9
0
8
0
1
0
1
1
1
0
9
1
10
10
110
15
95
29
76
0
38
20
27
3
1
1
13
8,897
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/service/_wait.py
azext_mobile_network.aaz.latest.mobile_network.service._wait.Wait.ServicesGet
class ServicesGet(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): request = self.make_request() session = self.client.send_request( request=request, stream=False, **kwargs) if session.http_response.status_code in [200]: return self.on_200(session) return self.on_error(session.http_response) @property def url(self): return self.client.format_url( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/mobileNetworks/{mobileNetworkName}/services/{serviceName}", **self.url_parameters ) @property def method(self): return "GET" @property def error_format(self): return "MgmtErrorFormat" @property def url_parameters(self): parameters = { **self.serialize_url_param( "mobileNetworkName", self.ctx.args.mobile_network_name, required=True, ), **self.serialize_url_param( "resourceGroupName", self.ctx.args.resource_group, required=True, ), **self.serialize_url_param( "serviceName", self.ctx.args.service_name, required=True, ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2023-09-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Accept", "application/json", ), } return parameters def on_200(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200 ) _schema_on_200 = None @classmethod def _build_schema_on_200(cls): if cls._schema_on_200 is not None: return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 _schema_on_200.id = AAZStrType( flags={"read_only": True}, ) _schema_on_200.location = AAZStrType( flags={"required": True}, ) _schema_on_200.name = AAZStrType( flags={"read_only": True}, ) _schema_on_200.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) _schema_on_200.system_data = AAZObjectType( serialized_name="systemData", flags={"read_only": True}, ) _schema_on_200.tags = AAZDictType() _schema_on_200.type = AAZStrType( flags={"read_only": True}, ) properties = cls._schema_on_200.properties properties.pcc_rules = AAZListType( serialized_name="pccRules", flags={"required": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.service_precedence = AAZIntType( serialized_name="servicePrecedence", flags={"required": True}, ) properties.service_qos_policy = AAZObjectType( serialized_name="serviceQosPolicy", ) pcc_rules = cls._schema_on_200.properties.pcc_rules pcc_rules.Element = AAZObjectType() _element = cls._schema_on_200.properties.pcc_rules.Element _element.rule_name = AAZStrType( serialized_name="ruleName", flags={"required": True}, ) _element.rule_precedence = AAZIntType( serialized_name="rulePrecedence", flags={"required": True}, ) _element.rule_qos_policy = AAZObjectType( serialized_name="ruleQosPolicy", ) _element.service_data_flow_templates = AAZListType( serialized_name="serviceDataFlowTemplates", flags={"required": True}, ) _element.traffic_control = AAZStrType( serialized_name="trafficControl", ) rule_qos_policy = cls._schema_on_200.properties.pcc_rules.Element.rule_qos_policy rule_qos_policy["5qi"] = AAZIntType() rule_qos_policy.allocation_and_retention_priority_level = AAZIntType( serialized_name="allocationAndRetentionPriorityLevel", ) rule_qos_policy.guaranteed_bit_rate = AAZObjectType( serialized_name="guaranteedBitRate", ) _WaitHelper._build_schema_ambr_read( rule_qos_policy.guaranteed_bit_rate) rule_qos_policy.maximum_bit_rate = AAZObjectType( serialized_name="maximumBitRate", flags={"required": True}, ) _WaitHelper._build_schema_ambr_read( rule_qos_policy.maximum_bit_rate) rule_qos_policy.preemption_capability = AAZStrType( serialized_name="preemptionCapability", ) rule_qos_policy.preemption_vulnerability = AAZStrType( serialized_name="preemptionVulnerability", ) service_data_flow_templates = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates service_data_flow_templates.Element = AAZObjectType() _element = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates.Element _element.direction = AAZStrType( flags={"required": True}, ) _element.ports = AAZListType() _element.protocol = AAZListType( flags={"required": True}, ) _element.remote_ip_list = AAZListType( serialized_name="remoteIpList", flags={"required": True}, ) _element.template_name = AAZStrType( serialized_name="templateName", flags={"required": True}, ) ports = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates.Element.ports ports.Element = AAZStrType() protocol = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates.Element.protocol protocol.Element = AAZStrType() remote_ip_list = cls._schema_on_200.properties.pcc_rules.Element.service_data_flow_templates.Element.remote_ip_list remote_ip_list.Element = AAZStrType() service_qos_policy = cls._schema_on_200.properties.service_qos_policy service_qos_policy["5qi"] = AAZIntType() service_qos_policy.allocation_and_retention_priority_level = AAZIntType( serialized_name="allocationAndRetentionPriorityLevel", ) service_qos_policy.maximum_bit_rate = AAZObjectType( serialized_name="maximumBitRate", flags={"required": True}, ) _WaitHelper._build_schema_ambr_read( service_qos_policy.maximum_bit_rate) service_qos_policy.preemption_capability = AAZStrType( serialized_name="preemptionCapability", ) service_qos_policy.preemption_vulnerability = AAZStrType( serialized_name="preemptionVulnerability", ) system_data = cls._schema_on_200.system_data system_data.created_at = AAZStrType( serialized_name="createdAt", ) system_data.created_by = AAZStrType( serialized_name="createdBy", ) system_data.created_by_type = AAZStrType( serialized_name="createdByType", ) system_data.last_modified_at = AAZStrType( serialized_name="lastModifiedAt", ) system_data.last_modified_by = AAZStrType( serialized_name="lastModifiedBy", ) system_data.last_modified_by_type = AAZStrType( serialized_name="lastModifiedByType", ) tags = cls._schema_on_200.tags tags.Element = AAZStrType() return cls._schema_on_200
class ServicesGet(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass def on_200(self, session): pass @classmethod def _build_schema_on_200(cls): pass
17
0
24
2
22
0
1
0
1
1
1
0
8
0
9
9
237
26
211
37
194
0
92
30
82
2
1
1
11
8,898
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/pccp/_update.py
azext_mobile_network.aaz.latest.mobile_network.pccp._update.Update.InstanceUpdateByJson
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): def __call__(self, *args, **kwargs): self._update_instance(self.ctx.vars.instance) def _update_instance(self, instance): _instance_value, _builder = self.new_content_builder( self.ctx.args, value=instance, typ=AAZObjectType ) _builder.set_prop("identity", AAZObjectType, ".identity") _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={ "flags": {"required": True, "client_flatten": True}}) _builder.set_prop("tags", AAZDictType, ".tags") identity = _builder.get(".identity") if identity is not None: identity.set_prop("type", AAZStrType, ".type", typ_kwargs={ "flags": {"required": True}}) identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities") user_assigned_identities = _builder.get( ".identity.userAssignedIdentities") if user_assigned_identities is not None: user_assigned_identities.set_elements(AAZObjectType, ".") properties = _builder.get(".properties") if properties is not None: properties.set_prop("controlPlaneAccessInterface", AAZObjectType, ".access_interface", typ_kwargs={"flags": {"required": True}}) properties.set_prop("coreNetworkTechnology", AAZStrType, ".core_network_tec") properties.set_prop("localDiagnosticsAccess", AAZObjectType, ".local_diagnostics", typ_kwargs={"flags": {"required": True}}) properties.set_prop("platform", AAZObjectType, ".platform", typ_kwargs={ "flags": {"required": True}}) properties.set_prop("sites", AAZListType, ".sites", typ_kwargs={ "flags": {"required": True}}) properties.set_prop("sku", AAZStrType, ".sku", typ_kwargs={ "flags": {"required": True}}) properties.set_prop("ueMtu", AAZIntType, ".ue_mtu") properties.set_prop("version", AAZStrType, ".version") control_plane_access_interface = _builder.get( ".properties.controlPlaneAccessInterface") if control_plane_access_interface is not None: control_plane_access_interface.set_prop( "ipv4Address", AAZStrType, ".ipv4_address") control_plane_access_interface.set_prop( "ipv4Gateway", AAZStrType, ".ipv4_gateway") control_plane_access_interface.set_prop( "ipv4Subnet", AAZStrType, ".ipv4_subnet") control_plane_access_interface.set_prop( "name", AAZStrType, ".name") local_diagnostics_access = _builder.get( ".properties.localDiagnosticsAccess") if local_diagnostics_access is not None: local_diagnostics_access.set_prop( "authenticationType", AAZStrType, ".authentication_type", typ_kwargs={"flags": {"required": True}}) local_diagnostics_access.set_prop( "httpsServerCertificate", AAZObjectType, ".https_server_certificate") https_server_certificate = _builder.get( ".properties.localDiagnosticsAccess.httpsServerCertificate") if https_server_certificate is not None: https_server_certificate.set_prop( "certificateUrl", AAZStrType, ".certificate_url", typ_kwargs={"flags": {"required": True}}) platform = _builder.get(".properties.platform") if platform is not None: platform.set_prop("azureStackEdgeDevice", AAZObjectType, ".azure_stack_edge_device") platform.set_prop("azureStackHciCluster", AAZObjectType, ".azure_stack_hci_cluster") platform.set_prop("connectedCluster", AAZObjectType, ".connected_cluster") platform.set_prop("customLocation", AAZObjectType, ".custom_location") platform.set_prop("type", AAZStrType, ".type", typ_kwargs={ "flags": {"required": True}}) azure_stack_edge_device = _builder.get( ".properties.platform.azureStackEdgeDevice") if azure_stack_edge_device is not None: azure_stack_edge_device.set_prop("id", AAZStrType, ".id", typ_kwargs={ "flags": {"required": True}}) azure_stack_hci_cluster = _builder.get( ".properties.platform.azureStackHciCluster") if azure_stack_hci_cluster is not None: azure_stack_hci_cluster.set_prop("id", AAZStrType, ".id", typ_kwargs={ "flags": {"required": True}}) connected_cluster = _builder.get( ".properties.platform.connectedCluster") if connected_cluster is not None: connected_cluster.set_prop("id", AAZStrType, ".id", typ_kwargs={ "flags": {"required": True}}) custom_location = _builder.get( ".properties.platform.customLocation") if custom_location is not None: custom_location.set_prop("id", AAZStrType, ".id", typ_kwargs={ "flags": {"required": True}}) sites = _builder.get(".properties.sites") if sites is not None: sites.set_elements(AAZObjectType, ".") _elements = _builder.get(".properties.sites[]") if _elements is not None: _elements.set_prop("id", AAZStrType, ".id", typ_kwargs={ "flags": {"required": True}}) tags = _builder.get(".tags") if tags is not None: tags.set_elements(AAZStrType, ".") return _instance_value
class InstanceUpdateByJson(AAZJsonInstanceUpdateOperation): def __call__(self, *args, **kwargs): pass def _update_instance(self, instance): pass
3
0
43
8
35
0
8
0
1
0
0
0
2
0
2
2
88
17
71
18
68
0
67
18
64
15
1
1
16
8,899
Azure/azure-cli-extensions
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/data/git_repos_for_analysis/Azure_azure-cli-extensions/src/mobile-network/azext_mobile_network/aaz/latest/mobile_network/sim/_create.py
azext_mobile_network.aaz.latest.mobile_network.sim._create.Create.SimsCreateOrUpdate
class SimsCreateOrUpdate(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): request = self.make_request() session = self.client.send_request( request=request, stream=False, **kwargs) if session.http_response.status_code in [202]: return self.client.build_lro_polling( self.ctx.args.no_wait, session, self.on_200_201, self.on_error, lro_options={"final-state-via": "azure-async-operation"}, path_format_arguments=self.url_parameters, ) if session.http_response.status_code in [200, 201]: return self.client.build_lro_polling( self.ctx.args.no_wait, session, self.on_200_201, self.on_error, lro_options={"final-state-via": "azure-async-operation"}, path_format_arguments=self.url_parameters, ) return self.on_error(session.http_response) @property def url(self): return self.client.format_url( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileNetwork/simGroups/{simGroupName}/sims/{simName}", **self.url_parameters ) @property def method(self): return "PUT" @property def error_format(self): return "MgmtErrorFormat" @property def url_parameters(self): parameters = { **self.serialize_url_param( "resourceGroupName", self.ctx.args.resource_group, required=True, ), **self.serialize_url_param( "simGroupName", self.ctx.args.sim_group_name, required=True, ), **self.serialize_url_param( "simName", self.ctx.args.sim_name, required=True, ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, ), } return parameters @property def query_parameters(self): parameters = { **self.serialize_query_param( "api-version", "2023-09-01", required=True, ), } return parameters @property def header_parameters(self): parameters = { **self.serialize_header_param( "Content-Type", "application/json", ), **self.serialize_header_param( "Accept", "application/json", ), } return parameters @property def content(self): _content_value, _builder = self.new_content_builder( self.ctx.args, typ=AAZObjectType, typ_kwargs={ "flags": {"required": True, "client_flatten": True}} ) _builder.set_prop("properties", AAZObjectType, ".", typ_kwargs={ "flags": {"required": True, "client_flatten": True}}) properties = _builder.get(".properties") if properties is not None: properties.set_prop("authenticationKey", AAZStrType, ".authentication_key", typ_kwargs={ "flags": {"secret": True}}) properties.set_prop("deviceType", AAZStrType, ".device_type") properties.set_prop( "integratedCircuitCardIdentifier", AAZStrType, ".icc_id") properties.set_prop("internationalMobileSubscriberIdentity", AAZStrType, ".international_msi", typ_kwargs={"flags": {"required": True}}) properties.set_prop("operatorKeyCode", AAZStrType, ".operator_key_code", typ_kwargs={ "flags": {"secret": True}}) properties.set_prop("simPolicy", AAZObjectType, ".sim_policy") properties.set_prop("staticIpConfiguration", AAZListType, ".static_ip_config") sim_policy = _builder.get(".properties.simPolicy") if sim_policy is not None: sim_policy.set_prop("id", AAZStrType, ".id", typ_kwargs={ "flags": {"required": True}}) static_ip_configuration = _builder.get( ".properties.staticIpConfiguration") if static_ip_configuration is not None: static_ip_configuration.set_elements(AAZObjectType, ".") _elements = _builder.get(".properties.staticIpConfiguration[]") if _elements is not None: _elements.set_prop("attachedDataNetwork", AAZObjectType, ".attached_data_network") _elements.set_prop("slice", AAZObjectType, ".slice") _elements.set_prop("staticIp", AAZObjectType, ".static_ip") attached_data_network = _builder.get( ".properties.staticIpConfiguration[].attachedDataNetwork") if attached_data_network is not None: attached_data_network.set_prop("id", AAZStrType, ".id", typ_kwargs={ "flags": {"required": True}}) slice = _builder.get(".properties.staticIpConfiguration[].slice") if slice is not None: slice.set_prop("id", AAZStrType, ".id", typ_kwargs={ "flags": {"required": True}}) static_ip = _builder.get( ".properties.staticIpConfiguration[].staticIp") if static_ip is not None: static_ip.set_prop("ipv4Address", AAZStrType, ".ipv4_address") return self.serialize_content(_content_value) def on_200_201(self, session): data = self.deserialize_http_content(session) self.ctx.set_var( "instance", data, schema_builder=self._build_schema_on_200_201 ) _schema_on_200_201 = None @classmethod def _build_schema_on_200_201(cls): if cls._schema_on_200_201 is not None: return cls._schema_on_200_201 cls._schema_on_200_201 = AAZObjectType() _schema_on_200_201 = cls._schema_on_200_201 _schema_on_200_201.id = AAZStrType( flags={"read_only": True}, ) _schema_on_200_201.name = AAZStrType( flags={"read_only": True}, ) _schema_on_200_201.properties = AAZObjectType( flags={"required": True, "client_flatten": True}, ) _schema_on_200_201.system_data = AAZObjectType( serialized_name="systemData", flags={"read_only": True}, ) _schema_on_200_201.type = AAZStrType( flags={"read_only": True}, ) properties = cls._schema_on_200_201.properties properties.device_type = AAZStrType( serialized_name="deviceType", ) properties.integrated_circuit_card_identifier = AAZStrType( serialized_name="integratedCircuitCardIdentifier", ) properties.international_mobile_subscriber_identity = AAZStrType( serialized_name="internationalMobileSubscriberIdentity", flags={"required": True}, ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) properties.sim_policy = AAZObjectType( serialized_name="simPolicy", ) properties.sim_state = AAZStrType( serialized_name="simState", flags={"read_only": True}, ) properties.site_provisioning_state = AAZDictType( serialized_name="siteProvisioningState", flags={"read_only": True}, ) properties.static_ip_configuration = AAZListType( serialized_name="staticIpConfiguration", ) properties.vendor_key_fingerprint = AAZStrType( serialized_name="vendorKeyFingerprint", flags={"read_only": True}, ) properties.vendor_name = AAZStrType( serialized_name="vendorName", flags={"read_only": True}, ) sim_policy = cls._schema_on_200_201.properties.sim_policy sim_policy.id = AAZStrType( flags={"required": True}, ) site_provisioning_state = cls._schema_on_200_201.properties.site_provisioning_state site_provisioning_state.Element = AAZStrType( flags={"read_only": True}, ) static_ip_configuration = cls._schema_on_200_201.properties.static_ip_configuration static_ip_configuration.Element = AAZObjectType() _element = cls._schema_on_200_201.properties.static_ip_configuration.Element _element.attached_data_network = AAZObjectType( serialized_name="attachedDataNetwork", ) _element.slice = AAZObjectType() _element.static_ip = AAZObjectType( serialized_name="staticIp", ) attached_data_network = cls._schema_on_200_201.properties.static_ip_configuration.Element.attached_data_network attached_data_network.id = AAZStrType( flags={"required": True}, ) slice = cls._schema_on_200_201.properties.static_ip_configuration.Element.slice slice.id = AAZStrType( flags={"required": True}, ) static_ip = cls._schema_on_200_201.properties.static_ip_configuration.Element.static_ip static_ip.ipv4_address = AAZStrType( serialized_name="ipv4Address", ) system_data = cls._schema_on_200_201.system_data system_data.created_at = AAZStrType( serialized_name="createdAt", ) system_data.created_by = AAZStrType( serialized_name="createdBy", ) system_data.created_by_type = AAZStrType( serialized_name="createdByType", ) system_data.last_modified_at = AAZStrType( serialized_name="lastModifiedAt", ) system_data.last_modified_by = AAZStrType( serialized_name="lastModifiedBy", ) system_data.last_modified_by_type = AAZStrType( serialized_name="lastModifiedByType", ) return cls._schema_on_200_201
class SimsCreateOrUpdate(AAZHttpOperation): def __call__(self, *args, **kwargs): pass @property def url(self): pass @property def method(self): pass @property def error_format(self): pass @property def url_parameters(self): pass @property def query_parameters(self): pass @property def header_parameters(self): pass @property def content(self): pass def on_200_201(self, session): pass @classmethod def _build_schema_on_200_201(cls): pass
19
0
24
2
22
0
2
0
1
0
0
0
9
1
10
10
264
32
232
46
213
0
107
37
96
8
1
1
20