Class: Google::Apis::DiscoveryV1::RestDescription
- Inherits:
-
Object
- Object
- Google::Apis::DiscoveryV1::RestDescription
- Defined in:
- lib/google/apis/generator/model.rb
Defined Under Namespace
Classes: Auth
Constant Summary collapse
- PARAMETER_BLACKLIST =
Don't expose these in the API directly.
%w(alt access_token bearer_token oauth_token pp prettyPrint $.xgafv callback upload_protocol uploadType)
Instance Attribute Summary collapse
-
#force_alt_json ⇒ Object
(also: #force_alt_json?)
Returns the value of attribute force_alt_json.
Instance Method Summary collapse
- #all_methods ⇒ Object
- #api_methods ⇒ Object
- #module_name ⇒ Object
- #name ⇒ Object
- #parameters ⇒ Object
- #qualified_name ⇒ Object
- #resources ⇒ Object
- #schemas ⇒ Object
- #service_name ⇒ Object
- #version ⇒ Object
Instance Attribute Details
#force_alt_json ⇒ Object Also known as: force_alt_json?
Returns the value of attribute force_alt_json.
122 123 124 |
# File 'lib/google/apis/generator/model.rb', line 122 def force_alt_json @force_alt_json end |
Instance Method Details
#all_methods ⇒ Object
158 159 160 161 162 163 |
# File 'lib/google/apis/generator/model.rb', line 158 def all_methods m = [] m << api_methods.values unless api_methods.nil? m << resources.map { |_k, r| r.all_methods } unless resources.nil? m.flatten end |
#api_methods ⇒ Object
150 151 152 |
# File 'lib/google/apis/generator/model.rb', line 150 def api_methods Hash[(@api_methods || {}).sort] end |
#module_name ⇒ Object
137 138 139 |
# File 'lib/google/apis/generator/model.rb', line 137 def module_name name + version end |
#name ⇒ Object
133 134 135 |
# File 'lib/google/apis/generator/model.rb', line 133 def name ActiveSupport::Inflector.camelize(@name) end |
#parameters ⇒ Object
165 166 167 |
# File 'lib/google/apis/generator/model.rb', line 165 def parameters Hash[(@parameters || {}).sort].delete_if { |k, _v| PARAMETER_BLACKLIST.include?(k) } end |
#qualified_name ⇒ Object
141 142 143 |
# File 'lib/google/apis/generator/model.rb', line 141 def qualified_name sprintf('Google::Apis::%s', module_name) end |
#resources ⇒ Object
154 155 156 |
# File 'lib/google/apis/generator/model.rb', line 154 def resources Hash[(@resources || {}).sort] end |
#schemas ⇒ Object
169 170 171 |
# File 'lib/google/apis/generator/model.rb', line 169 def schemas Hash[(@schemas || {}).sort] end |
#service_name ⇒ Object
145 146 147 148 |
# File 'lib/google/apis/generator/model.rb', line 145 def service_name class_name = (canonical_name || name).gsub(/\W/, '') ActiveSupport::Inflector.camelize(sprintf('%sService', class_name)) end |
#version ⇒ Object
129 130 131 |
# File 'lib/google/apis/generator/model.rb', line 129 def version ActiveSupport::Inflector.camelize(@version.gsub(/\W/, '-')).gsub(/-/, '_') end |