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

Inherits:
Object
  • Object
show all
Defined in:
lib/google/apis/generator/model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#generated_nameObject

Returns the value of attribute generated_name.



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

def generated_name
  @generated_name
end

#parentObject

Returns the value of attribute parent.



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

def parent
  @parent
end

Instance Method Details

#optional_query_parametersObject



96
97
98
# File 'lib/google/apis/generator/model.rb', line 96

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

#parametersObject



77
78
79
# File 'lib/google/apis/generator/model.rb', line 77

def parameters
  Hash[(@parameters || {}).sort]
end

#path_parametersObject



81
82
83
84
# File 'lib/google/apis/generator/model.rb', line 81

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

#query_parametersObject



86
87
88
89
# File 'lib/google/apis/generator/model.rb', line 86

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

#required_parametersObject



91
92
93
94
# File 'lib/google/apis/generator/model.rb', line 91

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