Skip to content

Commit

Permalink
regenerated resource graph (#10450)
Browse files Browse the repository at this point in the history
* regenerated resource graph

* fixed tests
  • Loading branch information
Zim Kalinowski authored Mar 26, 2020
1 parent ccdedb6 commit 92f693f
Show file tree
Hide file tree
Showing 16 changed files with 202 additions and 939 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,14 @@ class ResourceGraphClientConfiguration(AzureConfiguration):
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The Azure subscription Id.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):
self, credentials, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

Expand All @@ -45,4 +41,3 @@ def __init__(
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,34 @@
from ._configuration import ResourceGraphClientConfiguration
from .operations import ResourceGraphClientOperationsMixin
from .operations import Operations
from .operations import GraphQueryOperations
from . import models


class ResourceGraphClient(ResourceGraphClientOperationsMixin, SDKClient):
"""ResourceGraphClient
"""Azure Resource Graph API Reference
:ivar config: Configuration for client.
:vartype config: ResourceGraphClientConfiguration
:ivar operations: Operations operations
:vartype operations: azure.mgmt.resourcegraph.operations.Operations
:ivar graph_query: GraphQuery operations
:vartype graph_query: azure.mgmt.resourcegraph.operations.GraphQueryOperations
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The Azure subscription Id.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):
self, credentials, base_url=None):

self.config = ResourceGraphClientConfiguration(credentials, subscription_id, base_url)
self.config = ResourceGraphClientConfiguration(credentials, base_url)
super(ResourceGraphClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2019-04-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
self.graph_query = GraphQueryOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
Expand Up @@ -13,80 +13,61 @@
from ._models_py3 import Column
from ._models_py3 import Error
from ._models_py3 import ErrorDetails
from ._models_py3 import ErrorFieldContract
from ._models_py3 import ErrorResponse, ErrorResponseException
from ._models_py3 import Facet
from ._models_py3 import FacetError
from ._models_py3 import FacetRequest
from ._models_py3 import FacetRequestOptions
from ._models_py3 import FacetResult
from ._models_py3 import GraphQueryError, GraphQueryErrorException
from ._models_py3 import GraphQueryResource
from ._models_py3 import GraphQueryUpdateParameters
from ._models_py3 import Operation
from ._models_py3 import OperationDisplay
from ._models_py3 import QueryRequest
from ._models_py3 import QueryRequestOptions
from ._models_py3 import QueryResponse
from ._models_py3 import Resource
from ._models_py3 import Table
except (SyntaxError, ImportError):
from ._models import Column
from ._models import Error
from ._models import ErrorDetails
from ._models import ErrorFieldContract
from ._models import ErrorResponse, ErrorResponseException
from ._models import Facet
from ._models import FacetError
from ._models import FacetRequest
from ._models import FacetRequestOptions
from ._models import FacetResult
from ._models import GraphQueryError, GraphQueryErrorException
from ._models import GraphQueryResource
from ._models import GraphQueryUpdateParameters
from ._models import Operation
from ._models import OperationDisplay
from ._models import QueryRequest
from ._models import QueryRequestOptions
from ._models import QueryResponse
from ._models import Resource
from ._models import Table
from ._paged_models import GraphQueryResourcePaged
from ._paged_models import OperationPaged
from ._resource_graph_client_enums import (
ResultFormat,
FacetSortOrder,
ResultTruncated,
ColumnDataType,
ResultKind,
)

__all__ = [
'Column',
'Error',
'ErrorDetails',
'ErrorFieldContract',
'ErrorResponse', 'ErrorResponseException',
'Facet',
'FacetError',
'FacetRequest',
'FacetRequestOptions',
'FacetResult',
'GraphQueryError', 'GraphQueryErrorException',
'GraphQueryResource',
'GraphQueryUpdateParameters',
'Operation',
'OperationDisplay',
'QueryRequest',
'QueryRequestOptions',
'QueryResponse',
'Resource',
'Table',
'OperationPaged',
'GraphQueryResourcePaged',
'ResultFormat',
'FacetSortOrder',
'ResultTruncated',
'ColumnDataType',
'ResultKind',
]
Original file line number Diff line number Diff line change
Expand Up @@ -114,30 +114,6 @@ def __init__(self, **kwargs):
self.message = kwargs.get('message', None)


class ErrorFieldContract(Model):
"""Error Field contract.
:param code: Property level error code.
:type code: str
:param message: Human-readable representation of property-level error.
:type message: str
:param target: Property name.
:type target: str
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'target': {'key': 'target', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ErrorFieldContract, self).__init__(**kwargs)
self.code = kwargs.get('code', None)
self.message = kwargs.get('message', None)
self.target = kwargs.get('target', None)


class ErrorResponse(Model):
"""Error response.
Expand Down Expand Up @@ -349,181 +325,6 @@ def __init__(self, **kwargs):
self.result_type = 'FacetResult'


class GraphQueryError(Model):
"""Error message body that will indicate why the operation failed.
:param code: Service-defined error code. This code serves as a sub-status
for the HTTP error code specified in the response.
:type code: str
:param message: Human-readable representation of the error.
:type message: str
:param details: The list of invalid fields send in request, in case of
validation error.
:type details: list[~azure.mgmt.resourcegraph.models.ErrorFieldContract]
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'details': {'key': 'details', 'type': '[ErrorFieldContract]'},
}

def __init__(self, **kwargs):
super(GraphQueryError, self).__init__(**kwargs)
self.code = kwargs.get('code', None)
self.message = kwargs.get('message', None)
self.details = kwargs.get('details', None)


class GraphQueryErrorException(HttpOperationError):
"""Server responsed with exception of type: 'GraphQueryError'.
:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

def __init__(self, deserialize, response, *args):

super(GraphQueryErrorException, self).__init__(deserialize, response, 'GraphQueryError', *args)


class Resource(Model):
"""An azure resource object.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Azure resource Id
:vartype id: str
:ivar name: Azure resource name. This is GUID value. The display name
should be assigned within properties field.
:vartype name: str
:ivar type: Azure resource type
:vartype type: str
:param e_tag: This will be used to handle Optimistic Concurrency. If not
present, it will always overwrite the existing resource without checking
conflict.
:type e_tag: str
:param tags: Resource tags
:type tags: dict[str, str]
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'e_tag': {'key': 'eTag', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
}

def __init__(self, **kwargs):
super(Resource, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None
self.e_tag = kwargs.get('e_tag', None)
self.tags = kwargs.get('tags', None)


class GraphQueryResource(Resource):
"""Graph Query entity definition.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Azure resource Id
:vartype id: str
:ivar name: Azure resource name. This is GUID value. The display name
should be assigned within properties field.
:vartype name: str
:ivar type: Azure resource type
:vartype type: str
:param e_tag: This will be used to handle Optimistic Concurrency. If not
present, it will always overwrite the existing resource without checking
conflict.
:type e_tag: str
:param tags: Resource tags
:type tags: dict[str, str]
:ivar time_modified: Date and time in UTC of the last modification that
was made to this graph query definition.
:vartype time_modified: datetime
:param description: The description of a graph query.
:type description: str
:param query: Required. KQL query that will be graph.
:type query: str
:ivar result_kind: Enum indicating a type of graph query. Possible values
include: 'basic'
:vartype result_kind: str or ~azure.mgmt.resourcegraph.models.ResultKind
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'time_modified': {'readonly': True},
'query': {'required': True},
'result_kind': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'e_tag': {'key': 'eTag', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'time_modified': {'key': 'properties.timeModified', 'type': 'iso-8601'},
'description': {'key': 'properties.description', 'type': 'str'},
'query': {'key': 'properties.query', 'type': 'str'},
'result_kind': {'key': 'properties.resultKind', 'type': 'str'},
}

def __init__(self, **kwargs):
super(GraphQueryResource, self).__init__(**kwargs)
self.time_modified = None
self.description = kwargs.get('description', None)
self.query = kwargs.get('query', None)
self.result_kind = None


class GraphQueryUpdateParameters(Model):
"""The parameters that can be provided when updating workbook properties
properties.
:param tags: Resource tags
:type tags: dict[str, str]
:param e_tag: This will be used to handle Optimistic Concurrency. If not
present, it will always overwrite the existing resource without checking
conflict.
:type e_tag: str
:param description: The description of a graph query.
:type description: str
:param query: KQL query that will be graph.
:type query: str
"""

_attribute_map = {
'tags': {'key': 'tags', 'type': '{str}'},
'e_tag': {'key': 'eTag', 'type': 'str'},
'description': {'key': 'properties.description', 'type': 'str'},
'query': {'key': 'properties.query', 'type': 'str'},
}

def __init__(self, **kwargs):
super(GraphQueryUpdateParameters, self).__init__(**kwargs)
self.tags = kwargs.get('tags', None)
self.e_tag = kwargs.get('e_tag', None)
self.description = kwargs.get('description', None)
self.query = kwargs.get('query', None)


class Operation(Model):
"""Resource Graph REST API operation definition.
Expand Down
Loading

0 comments on commit 92f693f

Please sign in to comment.