# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # NOTE: This class is auto generated by the swagger code generator program. # https://github.com/swagger-api/swagger-codegen.git # Do not edit the class manually. defmodule GoogleApi.Books.V1.Api.Layers do @moduledoc """ API calls for all endpoints tagged `Layers`. """ alias GoogleApi.Books.V1.Connection alias GoogleApi.Gax.{Request, Response} @doc """ Gets the annotation data. ## Parameters - connection (GoogleApi.Books.V1.Connection): Connection to server - volume_id (String.t): The volume to retrieve annotations for. - layer_id (String.t): The ID for the layer to get the annotations. - annotation_data_id (String.t): The ID of the annotation data to retrieve. - content_version (String.t): The content version for the volume you are trying to retrieve. - optional_params (KeywordList): [optional] Optional parameters - :alt (String.t): Data format for the response. - :fields (String.t): Selector specifying which fields to include in a partial response. - :key (String.t): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - :oauth_token (String.t): OAuth 2.0 token for the current user. - :prettyPrint (boolean()): Returns response with indentations and line breaks. - :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - :userIp (String.t): Deprecated. Please use quotaUser instead. - :allowWebDefinitions (boolean()): For the dictionary layer. Whether or not to allow web definitions. - :h (integer()): The requested pixel height for any images. If height is provided width must also be provided. - :locale (String.t): The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. - :scale (integer()): The requested scale for the image. - :source (String.t): String to identify the originator of this request. - :w (integer()): The requested pixel width for any images. If width is provided height must also be provided. ## Returns {:ok, %GoogleApi.Books.V1.Model.Annotationdata{}} on success {:error, info} on failure """ @spec books_layers_annotation_data_get( Tesla.Env.client(), String.t(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, GoogleApi.Books.V1.Model.Annotationdata.t()} | {:error, Tesla.Env.t()} def books_layers_annotation_data_get( connection, volume_id, layer_id, annotation_data_id, content_version, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :allowWebDefinitions => :query, :h => :query, :locale => :query, :scale => :query, :source => :query, :w => :query } request = Request.new() |> Request.method(:get) |> Request.url("/volumes/{volumeId}/layers/{layerId}/data/{annotationDataId}", %{ "volumeId" => URI.encode_www_form(volume_id), "layerId" => URI.encode_www_form(layer_id), "annotationDataId" => URI.encode_www_form(annotation_data_id) }) |> Request.add_param(:query, :contentVersion, content_version) |> Request.add_optional_params(optional_params_config, optional_params) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Books.V1.Model.Annotationdata{}]) end @doc """ Gets the annotation data for a volume and layer. ## Parameters - connection (GoogleApi.Books.V1.Connection): Connection to server - volume_id (String.t): The volume to retrieve annotation data for. - layer_id (String.t): The ID for the layer to get the annotation data. - content_version (String.t): The content version for the requested volume. - optional_params (KeywordList): [optional] Optional parameters - :alt (String.t): Data format for the response. - :fields (String.t): Selector specifying which fields to include in a partial response. - :key (String.t): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - :oauth_token (String.t): OAuth 2.0 token for the current user. - :prettyPrint (boolean()): Returns response with indentations and line breaks. - :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - :userIp (String.t): Deprecated. Please use quotaUser instead. - :annotationDataId ([String.t]): The list of Annotation Data Ids to retrieve. Pagination is ignored if this is set. - :h (integer()): The requested pixel height for any images. If height is provided width must also be provided. - :locale (String.t): The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. - :maxResults (integer()): Maximum number of results to return - :pageToken (String.t): The value of the nextToken from the previous page. - :scale (integer()): The requested scale for the image. - :source (String.t): String to identify the originator of this request. - :updatedMax (String.t): RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). - :updatedMin (String.t): RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). - :w (integer()): The requested pixel width for any images. If width is provided height must also be provided. ## Returns {:ok, %GoogleApi.Books.V1.Model.Annotationsdata{}} on success {:error, info} on failure """ @spec books_layers_annotation_data_list( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, GoogleApi.Books.V1.Model.Annotationsdata.t()} | {:error, Tesla.Env.t()} def books_layers_annotation_data_list( connection, volume_id, layer_id, content_version, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :annotationDataId => :query, :h => :query, :locale => :query, :maxResults => :query, :pageToken => :query, :scale => :query, :source => :query, :updatedMax => :query, :updatedMin => :query, :w => :query } request = Request.new() |> Request.method(:get) |> Request.url("/volumes/{volumeId}/layers/{layerId}/data", %{ "volumeId" => URI.encode_www_form(volume_id), "layerId" => URI.encode_www_form(layer_id) }) |> Request.add_param(:query, :contentVersion, content_version) |> Request.add_optional_params(optional_params_config, optional_params) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Books.V1.Model.Annotationsdata{}]) end @doc """ Gets the layer summary for a volume. ## Parameters - connection (GoogleApi.Books.V1.Connection): Connection to server - volume_id (String.t): The volume to retrieve layers for. - summary_id (String.t): The ID for the layer to get the summary for. - optional_params (KeywordList): [optional] Optional parameters - :alt (String.t): Data format for the response. - :fields (String.t): Selector specifying which fields to include in a partial response. - :key (String.t): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - :oauth_token (String.t): OAuth 2.0 token for the current user. - :prettyPrint (boolean()): Returns response with indentations and line breaks. - :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - :userIp (String.t): Deprecated. Please use quotaUser instead. - :contentVersion (String.t): The content version for the requested volume. - :source (String.t): String to identify the originator of this request. ## Returns {:ok, %GoogleApi.Books.V1.Model.Layersummary{}} on success {:error, info} on failure """ @spec books_layers_get(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, GoogleApi.Books.V1.Model.Layersummary.t()} | {:error, Tesla.Env.t()} def books_layers_get(connection, volume_id, summary_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :contentVersion => :query, :source => :query } request = Request.new() |> Request.method(:get) |> Request.url("/volumes/{volumeId}/layersummary/{summaryId}", %{ "volumeId" => URI.encode_www_form(volume_id), "summaryId" => URI.encode_www_form(summary_id) }) |> Request.add_optional_params(optional_params_config, optional_params) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Books.V1.Model.Layersummary{}]) end @doc """ List the layer summaries for a volume. ## Parameters - connection (GoogleApi.Books.V1.Connection): Connection to server - volume_id (String.t): The volume to retrieve layers for. - optional_params (KeywordList): [optional] Optional parameters - :alt (String.t): Data format for the response. - :fields (String.t): Selector specifying which fields to include in a partial response. - :key (String.t): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - :oauth_token (String.t): OAuth 2.0 token for the current user. - :prettyPrint (boolean()): Returns response with indentations and line breaks. - :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - :userIp (String.t): Deprecated. Please use quotaUser instead. - :contentVersion (String.t): The content version for the requested volume. - :maxResults (integer()): Maximum number of results to return - :pageToken (String.t): The value of the nextToken from the previous page. - :source (String.t): String to identify the originator of this request. ## Returns {:ok, %GoogleApi.Books.V1.Model.Layersummaries{}} on success {:error, info} on failure """ @spec books_layers_list(Tesla.Env.client(), String.t(), keyword()) :: {:ok, GoogleApi.Books.V1.Model.Layersummaries.t()} | {:error, Tesla.Env.t()} def books_layers_list(connection, volume_id, optional_params \\ [], opts \\ []) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :contentVersion => :query, :maxResults => :query, :pageToken => :query, :source => :query } request = Request.new() |> Request.method(:get) |> Request.url("/volumes/{volumeId}/layersummary", %{ "volumeId" => URI.encode_www_form(volume_id) }) |> Request.add_optional_params(optional_params_config, optional_params) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Books.V1.Model.Layersummaries{}]) end @doc """ Gets the volume annotation. ## Parameters - connection (GoogleApi.Books.V1.Connection): Connection to server - volume_id (String.t): The volume to retrieve annotations for. - layer_id (String.t): The ID for the layer to get the annotations. - annotation_id (String.t): The ID of the volume annotation to retrieve. - optional_params (KeywordList): [optional] Optional parameters - :alt (String.t): Data format for the response. - :fields (String.t): Selector specifying which fields to include in a partial response. - :key (String.t): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - :oauth_token (String.t): OAuth 2.0 token for the current user. - :prettyPrint (boolean()): Returns response with indentations and line breaks. - :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - :userIp (String.t): Deprecated. Please use quotaUser instead. - :locale (String.t): The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. - :source (String.t): String to identify the originator of this request. ## Returns {:ok, %GoogleApi.Books.V1.Model.Volumeannotation{}} on success {:error, info} on failure """ @spec books_layers_volume_annotations_get( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, GoogleApi.Books.V1.Model.Volumeannotation.t()} | {:error, Tesla.Env.t()} def books_layers_volume_annotations_get( connection, volume_id, layer_id, annotation_id, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :locale => :query, :source => :query } request = Request.new() |> Request.method(:get) |> Request.url("/volumes/{volumeId}/layers/{layerId}/annotations/{annotationId}", %{ "volumeId" => URI.encode_www_form(volume_id), "layerId" => URI.encode_www_form(layer_id), "annotationId" => URI.encode_www_form(annotation_id) }) |> Request.add_optional_params(optional_params_config, optional_params) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Books.V1.Model.Volumeannotation{}]) end @doc """ Gets the volume annotations for a volume and layer. ## Parameters - connection (GoogleApi.Books.V1.Connection): Connection to server - volume_id (String.t): The volume to retrieve annotations for. - layer_id (String.t): The ID for the layer to get the annotations. - content_version (String.t): The content version for the requested volume. - optional_params (KeywordList): [optional] Optional parameters - :alt (String.t): Data format for the response. - :fields (String.t): Selector specifying which fields to include in a partial response. - :key (String.t): API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - :oauth_token (String.t): OAuth 2.0 token for the current user. - :prettyPrint (boolean()): Returns response with indentations and line breaks. - :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - :userIp (String.t): Deprecated. Please use quotaUser instead. - :endOffset (String.t): The end offset to end retrieving data from. - :endPosition (String.t): The end position to end retrieving data from. - :locale (String.t): The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. - :maxResults (integer()): Maximum number of results to return - :pageToken (String.t): The value of the nextToken from the previous page. - :showDeleted (boolean()): Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. - :source (String.t): String to identify the originator of this request. - :startOffset (String.t): The start offset to start retrieving data from. - :startPosition (String.t): The start position to start retrieving data from. - :updatedMax (String.t): RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). - :updatedMin (String.t): RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). - :volumeAnnotationsVersion (String.t): The version of the volume annotations that you are requesting. ## Returns {:ok, %GoogleApi.Books.V1.Model.Volumeannotations{}} on success {:error, info} on failure """ @spec books_layers_volume_annotations_list( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, GoogleApi.Books.V1.Model.Volumeannotations.t()} | {:error, Tesla.Env.t()} def books_layers_volume_annotations_list( connection, volume_id, layer_id, content_version, optional_params \\ [], opts \\ [] ) do optional_params_config = %{ :alt => :query, :fields => :query, :key => :query, :oauth_token => :query, :prettyPrint => :query, :quotaUser => :query, :userIp => :query, :endOffset => :query, :endPosition => :query, :locale => :query, :maxResults => :query, :pageToken => :query, :showDeleted => :query, :source => :query, :startOffset => :query, :startPosition => :query, :updatedMax => :query, :updatedMin => :query, :volumeAnnotationsVersion => :query } request = Request.new() |> Request.method(:get) |> Request.url("/volumes/{volumeId}/layers/{layerId}", %{ "volumeId" => URI.encode_www_form(volume_id), "layerId" => URI.encode_www_form(layer_id) }) |> Request.add_param(:query, :contentVersion, content_version) |> Request.add_optional_params(optional_params_config, optional_params) connection |> Connection.execute(request) |> Response.decode(opts ++ [struct: %GoogleApi.Books.V1.Model.Volumeannotations{}]) end end