text: # coding=utf-8
  # --------------------------------------------------------------------------
  # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.2.1, generator: {generator})
  # Changes may cause incorrect behavior and will be lost if the code is regenerated.
  # --------------------------------------------------------------------------
  from typing import Any, Callable, Dict, Generic, IO, List, Optional, TypeVar, Union
  import warnings
  
  from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
  from azure.core.pipeline import PipelineResponse
  from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
  
  from ... import models as _models
  
  T = TypeVar('T')
  ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
  
  class ItemOperations:
      """ItemOperations async 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: ~oscp.dataplane.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) -> None:
          self._client = client
          self._serialize = serializer
          self._deserialize = deserializer
          self._config = config
  
      async def get(
          self,
          sku: str,
          **kwargs
      ) -> "_models.Item":
          """get.
  
          :param sku:
          :type sku: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: Item, or the result of cls(response)
          :rtype: ~oscp.dataplane.models.Item
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["_models.Item"]
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}))
          api_version = "2020-11-01-preview"
          accept = "application/json, text/json"
  
          # Construct URL
          url = self.get.metadata['url']  # type: ignore
          path_format_arguments = {
              'sku': self._serialize.url("sku", sku, '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 = await 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)
              raise HttpResponseError(response=response)
  
          deserialized = self._deserialize('Item', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      get.metadata = {'url': '/items/{sku}'}  # type: ignore
  
      async def put(
          self,
          sku: str,
          item: "_models.Item",
          **kwargs
      ) -> "_models.Item":
          """put.
  
          :param sku:
          :type sku: str
          :param item:
          :type item: ~oscp.dataplane.models.Item
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: Item, or the result of cls(response)
          :rtype: ~oscp.dataplane.models.Item
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["_models.Item"]
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}))
          api_version = "2020-11-01-preview"
          content_type = kwargs.pop("content_type", "application/json")
          accept = "application/json, text/json"
  
          # Construct URL
          url = self.put.metadata['url']  # type: ignore
          path_format_arguments = {
              'sku': self._serialize.url("sku", sku, '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]
          body_content = self._serialize.body(item, 'Item')
          body_content_kwargs['content'] = body_content
          request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
          pipeline_response = await 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)
              raise HttpResponseError(response=response)
  
          deserialized = self._deserialize('Item', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      put.metadata = {'url': '/items/{sku}'}  # type: ignore
  
      async def delete(
          self,
          sku: str,
          **kwargs
      ) -> IO:
          """delete.
  
          :param sku:
          :type sku: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: IO, or the result of cls(response)
          :rtype: IO
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType[IO]
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}))
          api_version = "2020-11-01-preview"
          accept = "text/plain, application/json, text/json"
  
          # Construct URL
          url = self.delete.metadata['url']  # type: ignore
          path_format_arguments = {
              'sku': self._serialize.url("sku", sku, '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 = await self._client._pipeline.run(request, stream=True, **kwargs)
          response = pipeline_response.http_response
  
          if response.status_code not in [200, 200]:
              map_error(status_code=response.status_code, response=response, error_map=error_map)
              raise HttpResponseError(response=response)
  
          if response.status_code == 200:
              deserialized = self._deserialize('IO', pipeline_response)
  
          if response.status_code == 200:
              deserialized = self._deserialize('IO', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      delete.metadata = {'url': '/items/{sku}'}  # type: ignore
  
      async def bulk_put(
          self,
          items: List["_models.Item"],
          **kwargs
      ) -> List["_models.BulkResponseItemOfItem"]:
          """bulk_put.
  
          :param items:
          :type items: list[~oscp.dataplane.models.Item]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: list of BulkResponseItemOfItem, or the result of cls(response)
          :rtype: list[~oscp.dataplane.models.BulkResponseItemOfItem]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType[List["_models.BulkResponseItemOfItem"]]
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}))
          api_version = "2020-11-01-preview"
          content_type = kwargs.pop("content_type", "application/json")
          accept = "application/json, text/json"
  
          # Construct URL
          url = self.bulk_put.metadata['url']  # type: ignore
  
          # 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]
          body_content = self._serialize.body(items, '[Item]')
          body_content_kwargs['content'] = body_content
          request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
          pipeline_response = await 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)
              raise HttpResponseError(response=response)
  
          deserialized = self._deserialize('[BulkResponseItemOfItem]', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      bulk_put.metadata = {'url': '/items'}  # type: ignore
  
      async def bulk_delete(
          self,
          skus: List[str],
          **kwargs
      ) -> List["_models.BulkResponseItemOfString"]:
          """bulk_delete.
  
          :param skus:
          :type skus: list[str]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: list of BulkResponseItemOfString, or the result of cls(response)
          :rtype: list[~oscp.dataplane.models.BulkResponseItemOfString]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType[List["_models.BulkResponseItemOfString"]]
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}))
          api_version = "2020-11-01-preview"
          content_type = kwargs.pop("content_type", "application/json")
          accept = "application/json, text/json"
  
          # Construct URL
          url = self.bulk_delete.metadata['url']  # type: ignore
  
          # 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]
          body_content = self._serialize.body(skus, '[str]')
          body_content_kwargs['content'] = body_content
          request = self._client.delete(url, query_parameters, header_parameters, **body_content_kwargs)
          pipeline_response = await 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)
              raise HttpResponseError(response=response)
  
          deserialized = self._deserialize('[BulkResponseItemOfString]', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      bulk_delete.metadata = {'url': '/items'}  # type: ignore
  