def build_update_request_initial(
    subscription_id,  # type: str
    resource_group_name,  # type: str
    resource_name,  # type: str
    **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    api_version = kwargs.pop('api_version', "2021-09-01-preview")  # type: str
    content_type = kwargs.pop('content_type', None)  # type: Optional[str]

    accept = "application/json"
    # Construct URL
    _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RedHatOpenShift/openShiftClusters/{resourceName}")  # pylint: disable=line-too-long
    path_format_arguments = {
        "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1),
        "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
        "resourceName": _SERIALIZER.url("resource_name", resource_name, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    _header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    if content_type is not None:
        _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
    _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="PATCH",
        url=_url,
        params=_query_parameters,
        headers=_header_parameters,
        **kwargs
    )
def build_get_request(
    resource_group_name: str,
    image_name: str,
    subscription_id: str,
    *,
    expand: Optional[str] = None,
    **kwargs: Any
) -> HttpRequest:
    api_version = kwargs.pop('api_version', "2018-04-01")  # type: str

    accept = "application/json"
    # Construct URL
    _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}")  # pylint: disable=line-too-long
    path_format_arguments = {
        "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
        "imageName": _SERIALIZER.url("image_name", image_name, 'str'),
        "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    if expand is not None:
        _query_parameters['$expand'] = _SERIALIZER.query("expand", expand, 'str')
    _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    _header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="GET",
        url=_url,
        params=_query_parameters,
        headers=_header_parameters,
        **kwargs
    )
Exemple #3
0
def build_get_request(private_endpoint_connection_name: str,
                      subscription_id: str, resource_group_name: str,
                      resource_name: str, **kwargs: Any) -> HttpRequest:
    api_version = "2022-02-01"
    accept = "application/json"
    # Construct URL
    url = kwargs.pop(
        "template_url",
        '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'
    )
    path_format_arguments = {
        "privateEndpointConnectionName":
        _SERIALIZER.url("private_endpoint_connection_name",
                        private_endpoint_connection_name, 'str'),
        "subscriptionId":
        _SERIALIZER.url("subscription_id", subscription_id, 'str'),
        "resourceGroupName":
        _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
        "resourceName":
        _SERIALIZER.url("resource_name", resource_name, 'str'),
    }

    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query(
        "api_version", api_version, 'str')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="GET",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
def build_create_by_id_request(
    policy_assignment_id: str,
    *,
    json: JSONType = None,
    content: Any = None,
    **kwargs: Any
) -> HttpRequest:
    content_type = kwargs.pop('content_type', None)  # type: Optional[str]

    api_version = "2016-12-01"
    accept = "application/json, text/json"
    # Construct URL
    url = kwargs.pop("template_url", '/{policyAssignmentId}')
    path_format_arguments = {
        "policyAssignmentId": _SERIALIZER.url("policy_assignment_id", policy_assignment_id, 'str', skip_quote=True),
    }

    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    if content_type is not None:
        header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="PUT",
        url=url,
        params=query_parameters,
        headers=header_parameters,
        json=json,
        content=content,
        **kwargs
    )
Exemple #5
0
def build_create_or_update_notebook_request_initial(
        notebook_name,  # type: str
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    api_version = kwargs.pop('api_version', "2020-12-01")  # type: str
    content_type = kwargs.pop('content_type', None)  # type: Optional[str]
    if_match = kwargs.pop('if_match', None)  # type: Optional[str]

    accept = "application/json"
    # Construct URL
    url = kwargs.pop("template_url", '/notebooks/{notebookName}')
    path_format_arguments = {
        "notebookName": _SERIALIZER.url("notebook_name", notebook_name, 'str'),
    }

    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query(
        "api_version", api_version, 'str')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    if if_match is not None:
        header_parameters['If-Match'] = _SERIALIZER.header(
            "if_match", if_match, 'str')
    if content_type is not None:
        header_parameters['Content-Type'] = _SERIALIZER.header(
            "content_type", content_type, 'str')
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="PUT",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
def build_list_by_subscription_request(subscription_id: str,
                                       *,
                                       filter: Optional[str] = None,
                                       **kwargs: Any) -> HttpRequest:
    api_version = "2018-04-16"
    accept = "application/json"
    # Construct URL
    url = kwargs.pop(
        "template_url",
        '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules'
    )
    path_format_arguments = {
        "subscriptionId":
        _SERIALIZER.url("subscription_id",
                        subscription_id,
                        'str',
                        min_length=1),
    }

    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query(
        "api_version", api_version, 'str')
    if filter is not None:
        query_parameters['$filter'] = _SERIALIZER.query(
            "filter", filter, 'str')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="GET",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
def build_get_request(resource_group_name: str, managed_instance_name: str,
                      authentication_name: Union[str,
                                                 "_models.AuthenticationName"],
                      subscription_id: str, **kwargs: Any) -> HttpRequest:
    api_version = "2020-11-01-preview"
    accept = "application/json"
    # Construct URL
    url = kwargs.pop(
        "template_url",
        '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}'
    )
    path_format_arguments = {
        "resourceGroupName":
        _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
        "managedInstanceName":
        _SERIALIZER.url("managed_instance_name", managed_instance_name, 'str'),
        "authenticationName":
        _SERIALIZER.url("authentication_name", authentication_name, 'str'),
        "subscriptionId":
        _SERIALIZER.url("subscription_id", subscription_id, 'str'),
    }

    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query(
        "api_version", api_version, 'str')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="GET",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
Exemple #8
0
def build_get_request(subscription_id: str, resource_group_name: str,
                      server_name: str, communication_link_name: str,
                      **kwargs: Any) -> HttpRequest:
    api_version = "2014-04-01"
    accept = "application/json"
    # Construct URL
    url = kwargs.pop(
        "template_url",
        '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}'
    )
    path_format_arguments = {
        "subscriptionId":
        _SERIALIZER.url("subscription_id", subscription_id, 'str'),
        "resourceGroupName":
        _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
        "serverName":
        _SERIALIZER.url("server_name", server_name, 'str'),
        "communicationLinkName":
        _SERIALIZER.url("communication_link_name", communication_link_name,
                        'str'),
    }

    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query(
        "api_version", api_version, 'str')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="GET",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
def build_rename_dataset_request_initial(
    dataset_name: str,
    *,
    json: JSONType = None,
    content: Any = None,
    **kwargs: Any
) -> HttpRequest:
    api_version = kwargs.pop('api_version', "2020-12-01")  # type: str
    content_type = kwargs.pop('content_type', None)  # type: Optional[str]

    accept = "application/json"
    # Construct URL
    url = kwargs.pop("template_url", '/datasets/{datasetName}/rename')
    path_format_arguments = {
        "datasetName": _SERIALIZER.url("dataset_name", dataset_name, 'str', max_length=260, min_length=1, pattern=r'^[A-Za-z0-9_][^<>*#.%&:\\+?/]*$'),
    }

    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    if content_type is not None:
        header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="POST",
        url=url,
        params=query_parameters,
        headers=header_parameters,
        json=json,
        content=content,
        **kwargs
    )
def build_delete_request_initial(
    subscription_id,  # type: str
    resource_group_name,  # type: str
    availability_set_name,  # type: str
    **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    api_version = kwargs.pop('api_version', "2020-06-05-preview")  # type: str
    force = kwargs.pop('force', None)  # type: Optional[bool]

    accept = "application/json"
    # Construct URL
    _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/availabilitySets/{availabilitySetName}")  # pylint: disable=line-too-long
    path_format_arguments = {
        "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
        "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
        "availabilitySetName": _SERIALIZER.url("availability_set_name", availability_set_name, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
    if force is not None:
        _query_parameters['force'] = _SERIALIZER.query("force", force, 'bool')

    # Construct headers
    _header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="DELETE",
        url=_url,
        params=_query_parameters,
        headers=_header_parameters,
        **kwargs
    )
def build_get_resource_upload_url_request(subscription_id: str,
                                          resource_group_name: str,
                                          service_name: str, app_name: str,
                                          **kwargs: Any) -> HttpRequest:
    api_version = "2020-07-01"
    accept = "application/json"
    # Construct URL
    url = kwargs.pop(
        "template_url",
        '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl'
    )
    path_format_arguments = {
        "subscriptionId":
        _SERIALIZER.url("subscription_id", subscription_id, 'str'),
        "resourceGroupName":
        _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
        "serviceName":
        _SERIALIZER.url("service_name", service_name, 'str'),
        "appName":
        _SERIALIZER.url("app_name", app_name, 'str'),
    }

    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query(
        "api_version", api_version, 'str')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="POST",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
def build_list_by_resource_group_request(resource_group_name: str,
                                         subscription_id: str,
                                         **kwargs: Any) -> HttpRequest:
    api_version = "2021-01-15"
    accept = "application/json"
    # Construct URL
    url = kwargs.pop(
        "template_url",
        '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/resourceHealthMetadata'
    )
    path_format_arguments = {
        "resourceGroupName":
        _SERIALIZER.url("resource_group_name",
                        resource_group_name,
                        'str',
                        max_length=90,
                        min_length=1,
                        pattern=r'^[-\w\._\(\)]+[^\.]$'),
        "subscriptionId":
        _SERIALIZER.url("subscription_id", subscription_id, 'str'),
    }

    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query(
        "api_version", api_version, 'str')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="GET",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
def build_set_properties_request(
        **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    restype = kwargs.pop('restype', "service")  # type: str
    comp = kwargs.pop('comp', "properties")  # type: str
    version = kwargs.pop('version', "2021-04-10")  # type: str
    content_type = kwargs.pop('content_type', None)  # type: Optional[str]
    timeout = kwargs.pop('timeout', None)  # type: Optional[int]

    accept = "application/xml"
    # Construct URL
    _url = kwargs.pop("template_url", "/")

    # Construct parameters
    _query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    _query_parameters['restype'] = _SERIALIZER.query("restype", restype, 'str')
    _query_parameters['comp'] = _SERIALIZER.query("comp", comp, 'str')
    if timeout is not None:
        _query_parameters['timeout'] = _SERIALIZER.query("timeout",
                                                         timeout,
                                                         'int',
                                                         minimum=0)

    # Construct headers
    _header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    _header_parameters['x-ms-version'] = _SERIALIZER.header(
        "version", version, 'str')
    if content_type is not None:
        _header_parameters['Content-Type'] = _SERIALIZER.header(
            "content_type", content_type, 'str')
    _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="PUT",
                       url=_url,
                       params=_query_parameters,
                       headers=_header_parameters,
                       **kwargs)
Exemple #14
0
def build_delete_request(subscription_id: str,
                         resource_group_name: str,
                         network_manager_name: str,
                         *,
                         force: Optional[bool] = None,
                         **kwargs: Any) -> HttpRequest:
    api_version = kwargs.pop('api_version', "2022-02-01-preview")  # type: str

    accept = "application/json"
    # Construct URL
    _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}")  # pylint: disable=line-too-long
    path_format_arguments = {
        "subscriptionId":
        _SERIALIZER.url("subscription_id", subscription_id, 'str'),
        "resourceGroupName":
        _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
        "networkManagerName":
        _SERIALIZER.url("network_manager_name", network_manager_name, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    _query_parameters['api-version'] = _SERIALIZER.query(
        "api_version", api_version, 'str')
    if force is not None:
        _query_parameters['force'] = _SERIALIZER.query("force", force, 'bool')

    # Construct headers
    _header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="DELETE",
                       url=_url,
                       params=_query_parameters,
                       headers=_header_parameters,
                       **kwargs)
def build_check_name_availability_request(
    subscription_id: str,
    *,
    json: JSONType = None,
    content: Any = None,
    **kwargs: Any
) -> HttpRequest:
    content_type = kwargs.pop('content_type', None)  # type: Optional[str]

    api_version = "2015-06-15"
    accept = "application/json, text/json"
    # Construct URL
    url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability')
    path_format_arguments = {
        "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
    }

    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    if content_type is not None:
        header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="POST",
        url=url,
        params=query_parameters,
        headers=header_parameters,
        json=json,
        content=content,
        **kwargs
    )
def build_get_request(
    subscription_id: str,
    resource_group_name: str,
    workspace_name: str,
    sql_pool_name: str,
    *,
    maintenance_window_name: str,
    **kwargs: Any
) -> HttpRequest:
    api_version = "2021-06-01"
    accept = "application/json"
    # Construct URL
    url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/maintenancewindows/current')
    path_format_arguments = {
        "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1),
        "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
        "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'),
        "sqlPoolName": _SERIALIZER.url("sql_pool_name", sql_pool_name, 'str'),
    }

    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
    query_parameters['maintenanceWindowName'] = _SERIALIZER.query("maintenance_window_name", maintenance_window_name, 'str')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="GET",
        url=url,
        params=query_parameters,
        headers=header_parameters,
        **kwargs
    )
Exemple #17
0
def build_delete_request_initial(subscription_id: str,
                                 resource_group_name: str, service_name: str,
                                 certificate_name: str,
                                 **kwargs: Any) -> HttpRequest:
    api_version = "2022-03-01-preview"
    accept = "application/json"
    # Construct URL
    url = kwargs.pop(
        "template_url",
        '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}'
    )
    path_format_arguments = {
        "subscriptionId":
        _SERIALIZER.url("subscription_id", subscription_id, 'str'),
        "resourceGroupName":
        _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
        "serviceName":
        _SERIALIZER.url("service_name", service_name, 'str'),
        "certificateName":
        _SERIALIZER.url("certificate_name", certificate_name, 'str'),
    }

    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query(
        "api_version", api_version, 'str')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="DELETE",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
def build_get_request(
    location: str,
    publisher_name: str,
    type: str,
    version: str,
    subscription_id: str,
    **kwargs: Any
) -> HttpRequest:
    api_version = kwargs.pop('api_version', "2021-04-01")  # type: str

    accept = "application/json"
    # Construct URL
    _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}")  # pylint: disable=line-too-long
    path_format_arguments = {
        "location": _SERIALIZER.url("location", location, 'str'),
        "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str'),
        "type": _SERIALIZER.url("type", type, 'str'),
        "version": _SERIALIZER.url("version", version, 'str'),
        "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    _header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="GET",
        url=_url,
        params=_query_parameters,
        headers=_header_parameters,
        **kwargs
    )
def build_list_by_resource_group_request(resource_group_name: str,
                                         subscription_id: str,
                                         **kwargs: Any) -> HttpRequest:
    api_version = kwargs.pop('api_version', "2015-05-01")  # type: str

    accept = "application/json"
    # Construct URL
    _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components")  # pylint: disable=line-too-long
    path_format_arguments = {
        "resourceGroupName":
        _SERIALIZER.url("resource_group_name",
                        resource_group_name,
                        'str',
                        max_length=90,
                        min_length=1),
        "subscriptionId":
        _SERIALIZER.url("subscription_id",
                        subscription_id,
                        'str',
                        min_length=1),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    _query_parameters['api-version'] = _SERIALIZER.query(
        "api_version", api_version, 'str')

    # Construct headers
    _header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="GET",
                       url=_url,
                       params=_query_parameters,
                       headers=_header_parameters,
                       **kwargs)
Exemple #20
0
def build_delete_request_initial(resource_group_name: str,
                                 vm_scale_set_name: str, instance_id: str,
                                 run_command_name: str, subscription_id: str,
                                 **kwargs: Any) -> HttpRequest:
    api_version = kwargs.pop('api_version', "2020-12-01")  # type: str

    accept = "application/json, text/json"
    # Construct URL
    _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}")  # pylint: disable=line-too-long
    path_format_arguments = {
        "resourceGroupName":
        _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
        "vmScaleSetName":
        _SERIALIZER.url("vm_scale_set_name", vm_scale_set_name, 'str'),
        "instanceId":
        _SERIALIZER.url("instance_id", instance_id, 'str'),
        "runCommandName":
        _SERIALIZER.url("run_command_name", run_command_name, 'str'),
        "subscriptionId":
        _SERIALIZER.url("subscription_id", subscription_id, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    _query_parameters['api-version'] = _SERIALIZER.query(
        "api_version", api_version, 'str')

    # Construct headers
    _header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="DELETE",
                       url=_url,
                       params=_query_parameters,
                       headers=_header_parameters,
                       **kwargs)
Exemple #21
0
def build_get_request(resource_group_name: str, server_name: str,
                      subscription_id: str, **kwargs: Any) -> HttpRequest:
    blob_auditing_policy_name = "default"
    api_version = "2020-11-01-preview"
    accept = "application/json"
    # Construct URL
    url = kwargs.pop(
        "template_url",
        '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}'
    )
    path_format_arguments = {
        "resourceGroupName":
        _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
        "serverName":
        _SERIALIZER.url("server_name", server_name, 'str'),
        "blobAuditingPolicyName":
        _SERIALIZER.url("blob_auditing_policy_name", blob_auditing_policy_name,
                        'str'),
        "subscriptionId":
        _SERIALIZER.url("subscription_id", subscription_id, 'str'),
    }

    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query(
        "api_version", api_version, 'str')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="GET",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
def build_create_or_update_request_initial(
    subscription_id,  # type: str
    resource_group_name,  # type: str
    vmm_server_name,  # type: str
    **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    api_version = kwargs.pop('api_version', "2020-06-05-preview")  # type: str
    content_type = kwargs.pop('content_type', None)  # type: Optional[str]

    accept = "application/json"
    # Construct URL
    _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}")  # pylint: disable=line-too-long
    path_format_arguments = {
        "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
        "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
        "vmmServerName": _SERIALIZER.url("vmm_server_name", vmm_server_name, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    _header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    if content_type is not None:
        _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
    _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="PUT",
        url=_url,
        params=_query_parameters,
        headers=_header_parameters,
        **kwargs
    )
def build_delete_request_initial(subscription_id: str,
                                 resource_group_name: str, scope_name: str,
                                 name: str, **kwargs: Any) -> HttpRequest:
    api_version = "2019-10-17-preview"
    # Construct URL
    url = kwargs.pop(
        "template_url",
        '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/privateLinkScopes/{scopeName}/scopedResources/{name}'
    )
    path_format_arguments = {
        "subscriptionId":
        _SERIALIZER.url("subscription_id",
                        subscription_id,
                        'str',
                        min_length=1),
        "resourceGroupName":
        _SERIALIZER.url("resource_group_name",
                        resource_group_name,
                        'str',
                        max_length=90,
                        min_length=1),
        "scopeName":
        _SERIALIZER.url("scope_name", scope_name, 'str'),
        "name":
        _SERIALIZER.url("name", name, 'str'),
    }

    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query(
        "api_version", api_version, 'str')

    return HttpRequest(method="DELETE",
                       url=url,
                       params=query_parameters,
                       **kwargs)
def build_check_name_availability_request(
    subscription_id: str,
    *,
    json: JSONType = None,
    content: Any = None,
    **kwargs: Any
) -> HttpRequest:
    api_version = kwargs.pop('api_version', "2022-05-01")  # type: str
    content_type = kwargs.pop('content_type', None)  # type: Optional[str]

    accept = "application/json"
    # Construct URL
    _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AppConfiguration/checkNameAvailability")  # pylint: disable=line-too-long
    path_format_arguments = {
        "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    _header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    if content_type is not None:
        _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
    _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="POST",
        url=_url,
        params=_query_parameters,
        headers=_header_parameters,
        json=json,
        content=content,
        **kwargs
    )
def build_restart_request_initial(resource_group_name: str,
                                  host_group_name: str, host_name: str,
                                  subscription_id: str,
                                  **kwargs: Any) -> HttpRequest:
    api_version = "2021-11-01"
    accept = "application/json"
    # Construct URL
    url = kwargs.pop(
        "template_url",
        '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/restart'
    )
    path_format_arguments = {
        "resourceGroupName":
        _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
        "hostGroupName":
        _SERIALIZER.url("host_group_name", host_group_name, 'str'),
        "hostName":
        _SERIALIZER.url("host_name", host_name, 'str'),
        "subscriptionId":
        _SERIALIZER.url("subscription_id", subscription_id, 'str'),
    }

    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query(
        "api_version", api_version, 'str')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(method="POST",
                       url=url,
                       params=query_parameters,
                       headers=header_parameters,
                       **kwargs)
def build_get_request(
    vault_name,  # type: str
    resource_group_name,  # type: str
    subscription_id,  # type: str
    fabric_name,  # type: str
    operation_id,  # type: str
    **kwargs  # type: Any
):
    # type: (...) -> HttpRequest
    api_version = "2021-10-01"
    accept = "application/json"
    # Construct URL
    url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/operationResults/{operationId}')
    path_format_arguments = {
        "vaultName": _SERIALIZER.url("vault_name", vault_name, 'str'),
        "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
        "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
        "fabricName": _SERIALIZER.url("fabric_name", fabric_name, 'str'),
        "operationId": _SERIALIZER.url("operation_id", operation_id, 'str'),
    }

    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="GET",
        url=url,
        params=query_parameters,
        headers=header_parameters,
        **kwargs
    )
def build_delete_request_initial(
    subscription_id: str,
    resource_group_name: str,
    gallery_name: str,
    gallery_application_name: str,
    gallery_application_version_name: str,
    **kwargs: Any
) -> HttpRequest:
    api_version = kwargs.pop('api_version', "2021-07-01")  # type: str

    accept = "application/json"
    # Construct URL
    _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}")  # pylint: disable=line-too-long
    path_format_arguments = {
        "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
        "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
        "galleryName": _SERIALIZER.url("gallery_name", gallery_name, 'str'),
        "galleryApplicationName": _SERIALIZER.url("gallery_application_name", gallery_application_name, 'str'),
        "galleryApplicationVersionName": _SERIALIZER.url("gallery_application_version_name", gallery_application_version_name, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    _header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="DELETE",
        url=_url,
        params=_query_parameters,
        headers=_header_parameters,
        **kwargs
    )
Exemple #28
0
def build_delete_request_initial(resource_group_name: str, policy_name: str,
                                 subscription_id: str,
                                 **kwargs: Any) -> HttpRequest:
    api_version = "2020-11-01"
    # Construct URL
    url = kwargs.pop(
        "template_url",
        '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/{policyName}'
    )
    path_format_arguments = {
        "resourceGroupName":
        _SERIALIZER.url("resource_group_name",
                        resource_group_name,
                        'str',
                        max_length=80,
                        min_length=1,
                        pattern=r'^[a-zA-Z0-9_\-\(\)\.]*[^\.]$'),
        "policyName":
        _SERIALIZER.url("policy_name",
                        policy_name,
                        'str',
                        max_length=128,
                        min_length=0),
        "subscriptionId":
        _SERIALIZER.url("subscription_id", subscription_id, 'str'),
    }

    url = _format_url_section(url, **path_format_arguments)

    # Construct parameters
    query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    query_parameters['api-version'] = _SERIALIZER.query(
        "api_version", api_version, 'str')

    return HttpRequest(method="DELETE",
                       url=url,
                       params=query_parameters,
                       **kwargs)
Exemple #29
0
def build_get_request(
    subscription_id: str,
    resource_group_name: str,
    service_name: str,
    build_service_name: str,
    builder_name: str,
    **kwargs: Any
) -> HttpRequest:
    api_version = kwargs.pop('api_version', "2022-04-01")  # type: str

    accept = "application/json"
    # Construct URL
    _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}")  # pylint: disable=line-too-long
    path_format_arguments = {
        "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
        "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
        "serviceName": _SERIALIZER.url("service_name", service_name, 'str'),
        "buildServiceName": _SERIALIZER.url("build_service_name", build_service_name, 'str'),
        "builderName": _SERIALIZER.url("builder_name", builder_name, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')

    # Construct headers
    _header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="GET",
        url=_url,
        params=_query_parameters,
        headers=_header_parameters,
        **kwargs
    )
def build_get_request(
    subscription_id: str,
    resource_group_name: str,
    gallery_name: str,
    *,
    select: Optional[Union[str, "_models.SelectPermissions"]] = None,
    **kwargs: Any
) -> HttpRequest:
    api_version = kwargs.pop('api_version', "2020-09-30")  # type: str

    accept = "application/json"
    # Construct URL
    _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}")  # pylint: disable=line-too-long
    path_format_arguments = {
        "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
        "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'),
        "galleryName": _SERIALIZER.url("gallery_name", gallery_name, 'str'),
    }

    _url = _format_url_section(_url, **path_format_arguments)

    # Construct parameters
    _query_parameters = kwargs.pop("params", {})  # type: Dict[str, Any]
    _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
    if select is not None:
        _query_parameters['$select'] = _SERIALIZER.query("select", select, 'str')

    # Construct headers
    _header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
    _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')

    return HttpRequest(
        method="GET",
        url=_url,
        params=_query_parameters,
        headers=_header_parameters,
        **kwargs
    )