Skip to content

Commit

Permalink
CodeGen from PR 16877 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Published/azure/azure rest api specs pr/dev orbital microsoft.orbital 2021 04 04 preview (Azure#16877)

* New Swagger Spec File

* New Swagger Example Spec File

* New Readme Config File

* New Azure AZ Readme Config File

* New Azure CLI Readme Config File

* New Go Language Readme Config File

* New Python Language Readme Config File

* New Typescript Language Readme Config File

* New C# Language Readme Config File

* Orbital sdk 2021 04 04 preview (#5253)

* New Readme Config File

* New Go Language Readme Config File

* New Typescript Language Readme Config File

* New Python Language Readme Config File

* New C# Language Readme Config File

* New Ruby Language Readme Config File

* New Swagger Spec File

* New Swagger Example Spec File

* Added orbital.json file

* Passed linting using AutoRest for 2020-09-01 Azure Orbital Private Privew

* Updated Operation object under Azure Orbital 2020-09-01 preview.

* Updated Operation object under Azure Orbital 2020-09-01 preview.

* Updated Satellites object for Azure Orbital 2020-09-01 preview

* Updated examples for Azure Orbital Private Preview 2020-09-01

* Updated examples for Azure Orbital Private Preview 2020-09-01

* Updated examples for Azure Orbital Private Preview 2020-09-01

* Addressed feedback from ARMChangesRequested

* Updated the GetAvailableContacts api to add long running operation

* Updated the api version

* Updated the objects based on discussion with PM.

* list available ground station made a POST request (#2521)

* list available ground station made a POST request

* Swagger LintDiff fix

Co-authored-by: Devanshu Singh <[email protected]>

* swagger specs for version-20210404-preview

* removed cross version references. Copied over unchanged examples from the previous API version 2021-09-01-preview

* removed availableGroundStations API

* New Readme Config File

New Go Language Readme Config File

New Typescript Language Readme Config File

New Python Language Readme Config File

New C# Language Readme Config File

New Ruby Language Readme Config File

New Swagger Spec File

New Swagger Example Spec File

Added orbital.json file

Passed linting using AutoRest for 2020-09-01 Azure Orbital Private Privew

Updated Operation object under Azure Orbital 2020-09-01 preview.

Updated Operation object under Azure Orbital 2020-09-01 preview.

Updated Satellites object for Azure Orbital 2020-09-01 preview

Updated examples for Azure Orbital Private Preview 2020-09-01

Updated examples for Azure Orbital Private Preview 2020-09-01

Updated examples for Azure Orbital Private Preview 2020-09-01

Addressed feedback from ARMChangesRequested

Updated the GetAvailableContacts api to add long running operation

Updated the api version

Updated the objects based on discussion with PM.

list available ground station made a POST request (#2521)

* list available ground station made a POST request

* Swagger LintDiff fix

Co-authored-by: Devanshu Singh <[email protected]>

* validation check changes. Avocado, SpellCheck and prettier

* validation checks changes

* Modify readme.md for sdk generation

* added system data

* sdk pre namer validation changes

* lintdiff warning changes

* add comms scenario swagger (#3794)

* add comms scenario swagger

* remove unused example

* fix some validation errors

* fix style issues

* update spec based on feedback

* add updated example files

* fix CI errors

* change endpoints/connections list APIs to posts from gets

* connections lists from endpoints return resource IDs rather than full
objects.

* update examples files for endpoints connections list APIs

* fix operationIds and add descriptions

* fix more op ids and add descriptions for real

* fix typos, add constraints, and remove kbps/gbps from bandwidth (#4023)

* Updates to Resource Types (Modifications and Renames) (#4294)

* update orbital.json

* update examples

* prettier fix

* unfix old api version

* fix ci issues

* make more fields immutable

* update provisioning states

* swagger specs for Available groundstation APIs, version 2021-preview (#4920)

* swagger specs for Available groundstation APIs, version 2021-preview

* npm prettier check

* added type object

* removed capability and global comms info from responses

* prettier fix

* changed AP id response

* changes to schema to follow ARM format, resource id update

* Spelling check fix

* Ground Station spell check

* added groundstation to custom words

* Revert "added groundstation to custom words"

This reverts commit 0d7e18217de98836dcb8ba991685e15436004836.

* Revert "Ground Station spell check"

This reverts commit ef85b3b26f9ddf81dc1f50a9b677f9d8f115c4cf.

* Revert "Spelling check fix"

This reverts commit 6bd95c6e013889b6d488703846bbe87bbbb9c494.

* word addition

* type in response

* type definition in swagger

* readonly add

Co-authored-by: Akanksha Bhattacharyya <[email protected]>

* removed comms APIs

* readme updated

* fixed Swagger Avocado errors

* swagger lintDiff fix 1

* swagger lintDiff fix 2

* swagger lintDiff fix 3

Co-authored-by: Sunny Patel <[email protected]>
Co-authored-by: Sunny Patel <[email protected]>
Co-authored-by: Arthur Ning <[email protected]>
Co-authored-by: Devanshu Singh <[email protected]>
Co-authored-by: Zhenglai Zhang <[email protected]>
Co-authored-by: Jim Harris <[email protected]>
Co-authored-by: Akanksha Bhattacharyya <[email protected]>
Co-authored-by: Akanksha Bhattacharyya <[email protected]>

* operation IDs updated (#5461)

Co-authored-by: Devanshu Singh <[email protected]>

* Dev orbital microsoft.orbital 2021 04 04 preview (#5491)

* operation IDs updated

* updated OperationListResult definition

* review points implemented

Co-authored-by: Devanshu Singh <[email protected]>

* Azure Orbital - Review points implemented (#5507)

* operation IDs updated

* updated OperationListResult definition

* review points implemented

* referencing CloudError, ApiVersionParameter, ResourceGroupNameParameter, SubscriptionIdParameter from common-types

* reverting cloudError refs

* prettify json

* reorder some parameters

Co-authored-by: Devanshu Singh <[email protected]>
Co-authored-by: ArcturusZhang <[email protected]>

* Removed Empty allOf (#5510)

* operation IDs updated

* updated OperationListResult definition

* review points implemented

* referencing CloudError, ApiVersionParameter, ResourceGroupNameParameter, SubscriptionIdParameter from common-types

* reverting cloudError refs

* prettify json

* removed empty allOf

* validation checks

Co-authored-by: Devanshu Singh <[email protected]>

* readme.go.md fixed (#5512)

* operation IDs updated

* updated OperationListResult definition

* review points implemented

* referencing CloudError, ApiVersionParameter, ResourceGroupNameParameter, SubscriptionIdParameter from common-types

* reverting cloudError refs

* prettify json

* removed empty allOf

* validation checks

* readme.go.md fixed

Co-authored-by: Devanshu Singh <[email protected]>

* Remove last empty allOf (#5513)

* operation IDs updated

* updated OperationListResult definition

* review points implemented

* referencing CloudError, ApiVersionParameter, ResourceGroupNameParameter, SubscriptionIdParameter from common-types

* reverting cloudError refs

* prettify json

* removed empty allOf

* validation checks

* readme.go.md fixed

* remove one last empty allOf

Co-authored-by: Devanshu Singh <[email protected]>

* Add EventHubUri field to Contact Profile

Co-authored-by: Devanshu Singh <[email protected]>
Co-authored-by: Sunny Patel <[email protected]>
Co-authored-by: Sunny Patel <[email protected]>
Co-authored-by: Arthur Ning <[email protected]>
Co-authored-by: Devanshu Singh <[email protected]>
Co-authored-by: Zhenglai Zhang <[email protected]>
Co-authored-by: Jim Harris <[email protected]>
Co-authored-by: Akanksha Bhattacharyya <[email protected]>
Co-authored-by: Akanksha Bhattacharyya <[email protected]>
Co-authored-by: ArcturusZhang <[email protected]>
  • Loading branch information
11 people committed Jan 5, 2022
1 parent bc99c22 commit e7b2cc8
Show file tree
Hide file tree
Showing 25 changed files with 2,413 additions and 2,846 deletions.
10 changes: 5 additions & 5 deletions sdk/orbital/azure-mgmt-orbital/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.4.5",
"autorest": "3.7.2",
"use": [
"@autorest/python@5.8.4",
"@autorest/[email protected].2"
"@autorest/python@5.12.0",
"@autorest/[email protected].3"
],
"commit": "8c7612b823f693c6d7bc607594ed30b5ecb72730",
"commit": "0ba55a0ac6a76e3539b02ac30c4edb14c1175cc6",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/orbital/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/[email protected].2 --version=3.4.5",
"autorest_command": "autorest specification/orbital/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/[email protected].3 --version=3.7.2",
"readme": "specification/orbital/resource-manager/readme.md"
}
9 changes: 4 additions & 5 deletions sdk/orbital/azure-mgmt-orbital/azure/mgmt/orbital/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
__version__ = VERSION
__all__ = ['AzureOrbital']

try:
from ._patch import patch_sdk # type: ignore
patch_sdk()
except ImportError:
pass
# `._patch.py` is used for handwritten extensions to the generated code
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
from ._patch import patch_sdk
patch_sdk()
96 changes: 46 additions & 50 deletions sdk/orbital/azure-mgmt-orbital/azure/mgmt/orbital/_azure_orbital.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,22 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING
from copy import deepcopy
from typing import Any, Optional, TYPE_CHECKING

from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from msrest import Deserializer, Serializer

from . import models
from ._configuration import AzureOrbitalConfiguration
from .operations import AvailableGroundStationsOperations, ContactProfilesOperations, ContactsOperations, Operations, SpacecraftsOperations

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import AzureOrbitalConfiguration
from .operations import Operations
from .operations import SpacecraftsOperations
from .operations import ContactsOperations
from .operations import ContactProfilesOperations
from .operations import AvailableGroundStationsOperations
from . import models


class AzureOrbital(object):
class AzureOrbital:
"""Azure Orbital service.
:ivar operations: Operations operations
Expand All @@ -44,56 +38,58 @@ class AzureOrbital(object):
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
:type subscription_id: str
:param str base_url: Service URL
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:param base_url: Service URL. Default value is 'https://management.azure.com'.
:type base_url: 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, # type: "TokenCredential"
subscription_id, # type: str
base_url=None, # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> None
if not base_url:
base_url = 'https://management.azure.com'
self._config = AzureOrbitalConfiguration(credential, subscription_id, **kwargs)
credential: "TokenCredential",
subscription_id: str,
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = AzureOrbitalConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.spacecrafts = SpacecraftsOperations(self._client, self._config, self._serialize, self._deserialize)
self.contacts = ContactsOperations(self._client, self._config, self._serialize, self._deserialize)
self.contact_profiles = ContactProfilesOperations(self._client, self._config, self._serialize, self._deserialize)
self.available_ground_stations = AvailableGroundStationsOperations(self._client, self._config, self._serialize, self._deserialize)

self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self.spacecrafts = SpacecraftsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.contacts = ContactsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.contact_profiles = ContactProfilesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.available_ground_stations = AvailableGroundStationsOperations(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse

def _send_request(
self,
request, # type: HttpRequest
**kwargs: Any
) -> HttpResponse:
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
>>> 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/python/protocol/quickstart
: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.pipeline.transport.HttpResponse
:rtype: ~azure.core.rest.HttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, **kwargs)

def close(self):
# type: () -> None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

from ._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any

from azure.core.credentials import TokenCredential


Expand All @@ -35,16 +33,15 @@ class AzureOrbitalConfiguration(Configuration):

def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
**kwargs # type: Any
):
# type: (...) -> None
credential: "TokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
super(AzureOrbitalConfiguration, self).__init__(**kwargs)
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.")
super(AzureOrbitalConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
Expand All @@ -68,4 +65,4 @@ def _configure(
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
21 changes: 10 additions & 11 deletions sdk/orbital/azure-mgmt-orbital/azure/mgmt/orbital/_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"name": "AzureOrbital",
"filename": "_azure_orbital",
"description": "Azure Orbital service.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"host_value": "\"https://management.azure.com\"",
"parameterized_host_template": null,
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureOrbitalConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureOrbitalConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureOrbitalConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AzureOrbitalConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
},
"global_parameters": {
"sync": {
Expand Down Expand Up @@ -54,7 +54,7 @@
"required": false
},
"base_url": {
"signature": "base_url=None, # type: Optional[str]",
"signature": "base_url=\"https://management.azure.com\", # type: str",
"description": "Service URL",
"docstring_type": "str",
"required": false
Expand All @@ -74,7 +74,7 @@
"required": false
},
"base_url": {
"signature": "base_url: Optional[str] = None,",
"signature": "base_url: str = \"https://management.azure.com\",",
"description": "Service URL",
"docstring_type": "str",
"required": false
Expand All @@ -91,11 +91,10 @@
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_default_policy_type": "BearerTokenCredentialPolicy",
"credential_default_policy_type_has_async_version": true,
"credential_key_header_name": null,
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
"credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
"credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"operations": "Operations",
Expand Down
31 changes: 31 additions & 0 deletions sdk/orbital/azure-mgmt-orbital/azure/mgmt/orbital/_patch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# coding=utf-8
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------

# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass
27 changes: 27 additions & 0 deletions sdk/orbital/azure-mgmt-orbital/azure/mgmt/orbital/_vendor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from azure.core.pipeline.transport import HttpRequest

def _convert_request(request, files=None):
data = request.content if not files else None
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
if files:
request.set_formdata_body(files)
return request

def _format_url_section(template, **kwargs):
components = template.split("/")
while components:
try:
return template.format(**kwargs)
except KeyError as key:
formatted_components = template.split("/")
components = [
c for c in formatted_components if "{}".format(key.args[0]) not in c
]
template = "/".join(components)
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@

from ._azure_orbital import AzureOrbital
__all__ = ['AzureOrbital']

# `._patch.py` is used for handwritten extensions to the generated code
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
from ._patch import patch_sdk
patch_sdk()
Loading

0 comments on commit e7b2cc8

Please sign in to comment.