Class: Google::Apis::DiscoveryV1::RestMethod

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/generator/model.rb,
generated/google/apis/discovery_v1/classes.rb,
generated/google/apis/discovery_v1/representations.rb,
generated/google/apis/discovery_v1/representations.rb

Defined Under Namespace

Classes: MediaUpload, Request, Response

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ RestMethod

Returns a new instance of RestMethod.


757
758
759
# File 'generated/google/apis/discovery_v1/classes.rb', line 757

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#descriptionString

Description of this method. Corresponds to the JSON property description

Returns:

  • (String)

674
675
676
# File 'generated/google/apis/discovery_v1/classes.rb', line 674

def description
  @description
end

#etag_requiredBoolean Also known as: etag_required?

Whether this method requires an ETag to be specified. The ETag is sent as an HTTP If-Match or If-None-Match header. Corresponds to the JSON property etagRequired

Returns:

  • (Boolean)

680
681
682
# File 'generated/google/apis/discovery_v1/classes.rb', line 680

def etag_required
  @etag_required
end

#generated_nameObject

Returns the value of attribute generated_name


66
67
68
# File 'lib/google/apis/generator/model.rb', line 66

def generated_name
  @generated_name
end

#http_methodString

HTTP method used by this method. Corresponds to the JSON property httpMethod

Returns:

  • (String)

686
687
688
# File 'generated/google/apis/discovery_v1/classes.rb', line 686

def http_method
  @http_method
end

#idString

A unique ID for this method. This property can be used to match methods between different versions of Discovery. Corresponds to the JSON property id

Returns:

  • (String)

692
693
694
# File 'generated/google/apis/discovery_v1/classes.rb', line 692

def id
  @id
end

#media_uploadGoogle::Apis::DiscoveryV1::RestMethod::MediaUpload

Media upload parameters. Corresponds to the JSON property mediaUpload


697
698
699
# File 'generated/google/apis/discovery_v1/classes.rb', line 697

def media_upload
  @media_upload
end

#parameter_orderArray<String>

Ordered list of required parameters, serves as a hint to clients on how to structure their method signatures. The array is ordered such that the "most- significant" parameter appears first. Corresponds to the JSON property parameterOrder

Returns:

  • (Array<String>)

704
705
706
# File 'generated/google/apis/discovery_v1/classes.rb', line 704

def parameter_order
  @parameter_order
end

#parametersHash<String,Google::Apis::DiscoveryV1::JsonSchema>

Details for all parameters in this method. Corresponds to the JSON property parameters

Returns:


709
710
711
# File 'generated/google/apis/discovery_v1/classes.rb', line 709

def parameters
  @parameters
end

#parentObject

Returns the value of attribute parent


67
68
69
# File 'lib/google/apis/generator/model.rb', line 67

def parent
  @parent
end

#pathString

The URI path of this REST method. Should be used in conjunction with the basePath property at the api-level. Corresponds to the JSON property path

Returns:

  • (String)

715
716
717
# File 'generated/google/apis/discovery_v1/classes.rb', line 715

def path
  @path
end

#requestGoogle::Apis::DiscoveryV1::RestMethod::Request

The schema for the request. Corresponds to the JSON property request


720
721
722
# File 'generated/google/apis/discovery_v1/classes.rb', line 720

def request
  @request
end

#responseGoogle::Apis::DiscoveryV1::RestMethod::Response

The schema for the response. Corresponds to the JSON property response


725
726
727
# File 'generated/google/apis/discovery_v1/classes.rb', line 725

def response
  @response
end

#scopesArray<String>

OAuth 2.0 scopes applicable to this method. Corresponds to the JSON property scopes

Returns:

  • (Array<String>)

730
731
732
# File 'generated/google/apis/discovery_v1/classes.rb', line 730

def scopes
  @scopes
end

#supports_media_downloadBoolean Also known as: supports_media_download?

Whether this method supports media downloads. Corresponds to the JSON property supportsMediaDownload

Returns:

  • (Boolean)

735
736
737
# File 'generated/google/apis/discovery_v1/classes.rb', line 735

def supports_media_download
  @supports_media_download
end

#supports_media_uploadBoolean Also known as: supports_media_upload?

Whether this method supports media uploads. Corresponds to the JSON property supportsMediaUpload

Returns:

  • (Boolean)

741
742
743
# File 'generated/google/apis/discovery_v1/classes.rb', line 741

def supports_media_upload
  @supports_media_upload
end

#supports_subscriptionBoolean Also known as: supports_subscription?

Whether this method supports subscriptions. Corresponds to the JSON property supportsSubscription

Returns:

  • (Boolean)

747
748
749
# File 'generated/google/apis/discovery_v1/classes.rb', line 747

def supports_subscription
  @supports_subscription
end

#use_media_download_serviceBoolean Also known as: use_media_download_service?

Indicates that downloads from this method should use the download service URL ( i.e. "/download"). Only applies if the method supports media download. Corresponds to the JSON property useMediaDownloadService

Returns:

  • (Boolean)

754
755
756
# File 'generated/google/apis/discovery_v1/classes.rb', line 754

def use_media_download_service
  @use_media_download_service
end

Instance Method Details

#optional_query_parametersObject


84
85
86
# File 'lib/google/apis/generator/model.rb', line 84

def optional_query_parameters
  query_parameters.select { |param| param.required != true }
end

#path_parametersObject


69
70
71
72
# File 'lib/google/apis/generator/model.rb', line 69

def path_parameters
  return [] if parameter_order.nil? || parameters.nil?
  parameter_order.map { |name| parameters[name] }.select { |param| param.location == 'path' }
end

#query_parametersObject


74
75
76
77
# File 'lib/google/apis/generator/model.rb', line 74

def query_parameters
  return [] if parameters.nil?
  parameters.values.select { |param| param.location == 'query' }
end

#required_parametersObject


79
80
81
82
# File 'lib/google/apis/generator/model.rb', line 79

def required_parameters
  return [] if parameter_order.nil? || parameters.nil?
  parameter_order.map { |name| parameters[name] }.select { |param| param.location == 'path' || param.required }
end

#update!(**args) ⇒ Object

Update properties of this object


762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
# File 'generated/google/apis/discovery_v1/classes.rb', line 762

def update!(**args)
  @description = args[:description] if args.key?(:description)
  @etag_required = args[:etag_required] if args.key?(:etag_required)
  @http_method = args[:http_method] if args.key?(:http_method)
  @id = args[:id] if args.key?(:id)
  @media_upload = args[:media_upload] if args.key?(:media_upload)
  @parameter_order = args[:parameter_order] if args.key?(:parameter_order)
  @parameters = args[:parameters] if args.key?(:parameters)
  @path = args[:path] if args.key?(:path)
  @request = args[:request] if args.key?(:request)
  @response = args[:response] if args.key?(:response)
  @scopes = args[:scopes] if args.key?(:scopes)
  @supports_media_download = args[:supports_media_download] if args.key?(:supports_media_download)
  @supports_media_upload = args[:supports_media_upload] if args.key?(:supports_media_upload)
  @supports_subscription = args[:supports_subscription] if args.key?(:supports_subscription)
  @use_media_download_service = args[:use_media_download_service] if args.key?(:use_media_download_service)
end