homeaway-api 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c656cecfa3035e83cc8c49914b151d25db76c72c
4
+ data.tar.gz: 9e2cb5e8dbf453da945626c06b4347dc2784cabc
5
+ SHA512:
6
+ metadata.gz: 0be559350c906f672c84d6cbbde4de649fb6bee81dcdc6782bbb214420d522ecfb792b49a2d5ed44d985677646089040caaf005da2255c5d8e25ed08e495b1f2
7
+ data.tar.gz: e645145aa8bd807a36abd341a6694720a915473ddc740d8b2627b64e6d7ea41c6aafe6be4d22c16cf1d541b09a0e46e1701c0d9e8762a82e4760b44ecf159b55
data/Gemfile ADDED
@@ -0,0 +1,18 @@
1
+ # Copyright (c) 2015 HomeAway.com, Inc.
2
+ # All rights reserved. http://www.homeaway.com
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ source 'https://rubygems.org'
17
+
18
+ gemspec
@@ -0,0 +1,209 @@
1
+ Certain components of this software are provided or made available only
2
+ subject to the licenses under which such components were licensed to
3
+ HomeAway. The relevant components and corresponding licenses are listed
4
+ [in the folder in the distribution titled 'licenses']. In any event, the
5
+ disclaimer of warranty and limitation of liability provision in this
6
+ Agreement will apply to all Software in this distribution.
7
+
8
+
9
+ Apache License
10
+ Version 2.0, January 2004
11
+ http://www.apache.org/licenses/
12
+
13
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
14
+
15
+ 1. Definitions.
16
+
17
+ "License" shall mean the terms and conditions for use, reproduction,
18
+ and distribution as defined by Sections 1 through 9 of this document.
19
+
20
+ "Licensor" shall mean the copyright owner or entity authorized by
21
+ the copyright owner that is granting the License.
22
+
23
+ "Legal Entity" shall mean the union of the acting entity and all
24
+ other entities that control, are controlled by, or are under common
25
+ control with that entity. For the purposes of this definition,
26
+ "control" means (i) the power, direct or indirect, to cause the
27
+ direction or management of such entity, whether by contract or
28
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
29
+ outstanding shares, or (iii) beneficial ownership of such entity.
30
+
31
+ "You" (or "Your") shall mean an individual or Legal Entity
32
+ exercising permissions granted by this License.
33
+
34
+ "Source" form shall mean the preferred form for making modifications,
35
+ including but not limited to software source code, documentation
36
+ source, and configuration files.
37
+
38
+ "Object" form shall mean any form resulting from mechanical
39
+ transformation or translation of a Source form, including but
40
+ not limited to compiled object code, generated documentation,
41
+ and conversions to other media types.
42
+
43
+ "Work" shall mean the work of authorship, whether in Source or
44
+ Object form, made available under the License, as indicated by a
45
+ copyright notice that is included in or attached to the work
46
+ (an example is provided in the Appendix below).
47
+
48
+ "Derivative Works" shall mean any work, whether in Source or Object
49
+ form, that is based on (or derived from) the Work and for which the
50
+ editorial revisions, annotations, elaborations, or other modifications
51
+ represent, as a whole, an original work of authorship. For the purposes
52
+ of this License, Derivative Works shall not include works that remain
53
+ separable from, or merely link (or bind by name) to the interfaces of,
54
+ the Work and Derivative Works thereof.
55
+
56
+ "Contribution" shall mean any work of authorship, including
57
+ the original version of the Work and any modifications or additions
58
+ to that Work or Derivative Works thereof, that is intentionally
59
+ submitted to Licensor for inclusion in the Work by the copyright owner
60
+ or by an individual or Legal Entity authorized to submit on behalf of
61
+ the copyright owner. For the purposes of this definition, "submitted"
62
+ means any form of electronic, verbal, or written communication sent
63
+ to the Licensor or its representatives, including but not limited to
64
+ communication on electronic mailing lists, source code control systems,
65
+ and issue tracking systems that are managed by, or on behalf of, the
66
+ Licensor for the purpose of discussing and improving the Work, but
67
+ excluding communication that is conspicuously marked or otherwise
68
+ designated in writing by the copyright owner as "Not a Contribution."
69
+
70
+ "Contributor" shall mean Licensor and any individual or Legal Entity
71
+ on behalf of whom a Contribution has been received by Licensor and
72
+ subsequently incorporated within the Work.
73
+
74
+ 2. Grant of Copyright License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ copyright license to reproduce, prepare Derivative Works of,
78
+ publicly display, publicly perform, sublicense, and distribute the
79
+ Work and such Derivative Works in Source or Object form.
80
+
81
+ 3. Grant of Patent License. Subject to the terms and conditions of
82
+ this License, each Contributor hereby grants to You a perpetual,
83
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
84
+ (except as stated in this section) patent license to make, have made,
85
+ use, offer to sell, sell, import, and otherwise transfer the Work,
86
+ where such license applies only to those patent claims licensable
87
+ by such Contributor that are necessarily infringed by their
88
+ Contribution(s) alone or by combination of their Contribution(s)
89
+ with the Work to which such Contribution(s) was submitted. If You
90
+ institute patent litigation against any entity (including a
91
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
92
+ or a Contribution incorporated within the Work constitutes direct
93
+ or contributory patent infringement, then any patent licenses
94
+ granted to You under this License for that Work shall terminate
95
+ as of the date such litigation is filed.
96
+
97
+ 4. Redistribution. You may reproduce and distribute copies of the
98
+ Work or Derivative Works thereof in any medium, with or without
99
+ modifications, and in Source or Object form, provided that You
100
+ meet the following conditions:
101
+
102
+ (a) You must give any other recipients of the Work or
103
+ Derivative Works a copy of this License; and
104
+
105
+ (b) You must cause any modified files to carry prominent notices
106
+ stating that You changed the files; and
107
+
108
+ (c) You must retain, in the Source form of any Derivative Works
109
+ that You distribute, all copyright, patent, trademark, and
110
+ attribution notices from the Source form of the Work,
111
+ excluding those notices that do not pertain to any part of
112
+ the Derivative Works; and
113
+
114
+ (d) If the Work includes a "NOTICE" text file as part of its
115
+ distribution, then any Derivative Works that You distribute must
116
+ include a readable copy of the attribution notices contained
117
+ within such NOTICE file, excluding those notices that do not
118
+ pertain to any part of the Derivative Works, in at least one
119
+ of the following places: within a NOTICE text file distributed
120
+ as part of the Derivative Works; within the Source form or
121
+ documentation, if provided along with the Derivative Works; or,
122
+ within a display generated by the Derivative Works, if and
123
+ wherever such third-party notices normally appear. The contents
124
+ of the NOTICE file are for informational purposes only and
125
+ do not modify the License. You may add Your own attribution
126
+ notices within Derivative Works that You distribute, alongside
127
+ or as an addendum to the NOTICE text from the Work, provided
128
+ that such additional attribution notices cannot be construed
129
+ as modifying the License.
130
+
131
+ You may add Your own copyright statement to Your modifications and
132
+ may provide additional or different license terms and conditions
133
+ for use, reproduction, or distribution of Your modifications, or
134
+ for any such Derivative Works as a whole, provided Your use,
135
+ reproduction, and distribution of the Work otherwise complies with
136
+ the conditions stated in this License.
137
+
138
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
139
+ any Contribution intentionally submitted for inclusion in the Work
140
+ by You to the Licensor shall be under the terms and conditions of
141
+ this License, without any additional terms or conditions.
142
+ Notwithstanding the above, nothing herein shall supersede or modify
143
+ the terms of any separate license agreement you may have executed
144
+ with Licensor regarding such Contributions.
145
+
146
+ 6. Trademarks. This License does not grant permission to use the trade
147
+ names, trademarks, service marks, or product names of the Licensor,
148
+ except as required for reasonable and customary use in describing the
149
+ origin of the Work and reproducing the content of the NOTICE file.
150
+
151
+ 7. Disclaimer of Warranty. Unless required by applicable law or
152
+ agreed to in writing, Licensor provides the Work (and each
153
+ Contributor provides its Contributions) on an "AS IS" BASIS,
154
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
155
+ implied, including, without limitation, any warranties or conditions
156
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
157
+ PARTICULAR PURPOSE. You are solely responsible for determining the
158
+ appropriateness of using or redistributing the Work and assume any
159
+ risks associated with Your exercise of permissions under this License.
160
+
161
+ 8. Limitation of Liability. In no event and under no legal theory,
162
+ whether in tort (including negligence), contract, or otherwise,
163
+ unless required by applicable law (such as deliberate and grossly
164
+ negligent acts) or agreed to in writing, shall any Contributor be
165
+ liable to You for damages, including any direct, indirect, special,
166
+ incidental, or consequential damages of any character arising as a
167
+ result of this License or out of the use or inability to use the
168
+ Work (including but not limited to damages for loss of goodwill,
169
+ work stoppage, computer failure or malfunction, or any and all
170
+ other commercial damages or losses), even if such Contributor
171
+ has been advised of the possibility of such damages.
172
+
173
+ 9. Accepting Warranty or Additional Liability. While redistributing
174
+ the Work or Derivative Works thereof, You may choose to offer,
175
+ and charge a fee for, acceptance of support, warranty, indemnity,
176
+ or other liability obligations and/or rights consistent with this
177
+ License. However, in accepting such obligations, You may act only
178
+ on Your own behalf and on Your sole responsibility, not on behalf
179
+ of any other Contributor, and only if You agree to indemnify,
180
+ defend, and hold each Contributor harmless for any liability
181
+ incurred by, or claims asserted against, such Contributor by reason
182
+ of your accepting any such warranty or additional liability.
183
+
184
+ END OF TERMS AND CONDITIONS
185
+
186
+ APPENDIX: How to apply the Apache License to your work.
187
+
188
+ To apply the Apache License to your work, attach the following
189
+ boilerplate notice, with the fields enclosed by brackets "[]"
190
+ replaced with your own identifying information. (Don't include
191
+ the brackets!) The text should be enclosed in the appropriate
192
+ comment syntax for the file format. We also recommend that a
193
+ file or class name and description of purpose be included on the
194
+ same "printed page" as the copyright notice for easier
195
+ identification within third-party archives.
196
+
197
+ Copyright (c) 2015 HomeAway.com, Inc.
198
+
199
+ Licensed under the Apache License, Version 2.0 (the "License");
200
+ you may not use this file except in compliance with the License.
201
+ You may obtain a copy of the License at
202
+
203
+ http://www.apache.org/licenses/LICENSE-2.0
204
+
205
+ Unless required by applicable law or agreed to in writing, software
206
+ distributed under the License is distributed on an "AS IS" BASIS,
207
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
208
+ See the License for the specific language governing permissions and
209
+ limitations under the License.
@@ -0,0 +1,127 @@
1
+ # HomeAway API
2
+
3
+ A Ruby SDK to interact with the HomeAway API
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'homeaway_api'
11
+ ```
12
+
13
+ And then execute in the checked out directory to install into your system gems:
14
+
15
+ $ rake install
16
+
17
+ or to install into your bundle:
18
+
19
+ $ bundle exec rake install
20
+
21
+ ## Usage
22
+
23
+ ### Authenticating
24
+
25
+ In order to use this gem, you must first have a HomeAway API client ID and client secret. Both of these can be obtained by registering yourself as an API developer at https://www.homeaway.com/platform/myClients
26
+
27
+ Once you have these credentials, to use this gem:
28
+
29
+ ```ruby
30
+ require 'homeaway_api'
31
+ client = HomeAway::API::Client.new(client_id: your_client_id, client_secret: your_client_secret)
32
+ ```
33
+
34
+ This will automatically have your client authenticate with HomeAway. If you wish to have your application be able to access the personal HomeAway data of the user of your application, you need to call:
35
+
36
+ ```ruby
37
+ client.auth_url
38
+ ```
39
+
40
+ which will return back a URL as a String that the user of your application must be sent to. It is up to you to define how that takes place. Once your user goes to that url they will prompted to login with their HomeAway credentials. As soon as they do that and authorize your application to access their HomeAway data, the client's web browser will be redirected back to the redirect url that you specified when you created your client above. This url will have a code appended to it as a parameter named code. Once you are able to grab that code, you can use it with this gem:
41
+
42
+ ```ruby
43
+ client.oauth_code = code_received_from_redirect_url
44
+ ```
45
+
46
+ As soon as you make that assignment, the client will contact HomeAway and obtain a token that can be used for interacting with the HomeAway for that user for that particular session. By default, this token has a 6 month expiration time.
47
+
48
+ ### Using an existing token
49
+
50
+ If you have a token string saved from a previous use of the HomeAway API it can be reused with this SDK to avoid having your user login to HomeAway again.
51
+
52
+ ```ruby
53
+ client = HomeAway::API::Client.new(
54
+ token: 'saved_token_value'
55
+ )
56
+ ```
57
+
58
+ ### Custom configuring the client
59
+
60
+ You will usually not need to do this often as the defaults will be sufficient for most use cases, but if necessary, you can specify any subset of the fields below:
61
+
62
+ ```ruby
63
+ client.configure do |c|
64
+ site: <site>, #override the hostname of the api
65
+ port: <port>, #defaults to 443
66
+ logger: <logger_instance>, #supply your own custom logger instance
67
+ cache_control: <value>, #set a custom cache control header to be sent on each request
68
+ auto_pagination: <true or false>, #will paginated resources automatically traverse their pages when being iterated over
69
+ connection_opts: <opts>, #set any connection options to the underlying Faraday connection object, must be a hash
70
+ page_size: <size>, #overwrite the default page size (10)
71
+ test_mode: <true or false> #enable or disable test mode, default disabled
72
+ end
73
+ ```
74
+
75
+ ## Operations
76
+
77
+ Each of the operations is detailed in the generated Yard documentation for this gem.
78
+
79
+ ## Quickstart
80
+
81
+ ```ruby
82
+ require 'homeaway_api'
83
+ client = HomeAway::API::Client.new(client_id: your_client_id, client_secret: your_client_secret)
84
+ response = @client.get_listing '123456', ['AVAILABILITY', 'RATES']
85
+ paginator = @client.search '4 bathrooms new york'
86
+ paginator.each do |search_result|
87
+ listing = @client.get_listing search_result.listing_id, ['DETAILS', 'RATES', 'LOCATION']
88
+ puts listing
89
+ end
90
+ ```
91
+
92
+ ## hacurl
93
+
94
+ If you install this gem, it will also install a command line utility named `hacurl`. `hacurl` is a tool that allows developers to easily interact with the HomeAway API without writing a single line of code. The available options:
95
+
96
+ ```
97
+ $ Usage: hacurl [options] url
98
+ -i, --client-id CLIENT_ID your client id
99
+ -s CLIENT_SECRET, your client secret
100
+ --client-secret
101
+ -e, --email EMAIL optional email address to use for operations that require 3-legged-oauth
102
+ -p, --password PASSWORD optional password to use for operations that require 3-legged-oauth
103
+ -d, --data FILE path to file for any operations that require a body (PUT OR POST)
104
+ -X, --method METHOD method to send (GET, PUT, POST)
105
+ -a, --get-auth only output the bearer authorization
106
+ -v, --verbose print verbose information
107
+ -t, --traveler login as a traveler
108
+ -o, --owner login as an owner (the default)
109
+ ```
110
+
111
+ An example invocation would be:
112
+
113
+ ```
114
+ $ hacurl -i <your_client_id> -s <your_client_secret> /public/listing?id=123456
115
+ ```
116
+
117
+ ## Other
118
+
119
+ The full API documentation is located at: https://homeaway.com/platform/documentation
120
+
121
+ ## Contributing
122
+
123
+ 1. Fork it https://github.com/homeaway/homeaway_api_ruby
124
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
125
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
126
+ 4. Push to the branch (`git push origin my-new-feature`)
127
+ 5. Create a new Pull Request
@@ -0,0 +1,8 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:unit) do |spec|
5
+ spec.rspec_opts = '-b'
6
+ end
7
+
8
+ task :default => :unit
@@ -0,0 +1,176 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Copyright (c) 2015 HomeAway.com, Inc.
4
+ # All rights reserved. http://www.homeaway.com
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ require 'homeaway_api'
19
+ require 'optparse'
20
+ require 'json'
21
+ require 'mechanize'
22
+ require 'cgi'
23
+ require 'json_color'
24
+
25
+ options = {
26
+ :auth_only => false,
27
+ :type => :owner
28
+ }
29
+ parser = OptionParser.new do |opts|
30
+ opts.banner = 'Usage: hacurl [options] url'
31
+
32
+ opts.on('-i', '--client-id CLIENT_ID', 'your client id') do |id|
33
+ options[:client_id] = id
34
+ end
35
+
36
+ opts.on('-s', '--client-secret CLIENT_SECRET', 'your client secret') do |secret|
37
+ options[:client_secret] = secret
38
+ end
39
+
40
+ opts.on('-e', '--email EMAIL', 'optional email address to use for operations that require 3-legged-oauth') do |email|
41
+ options[:email] = email
42
+ end
43
+
44
+ opts.on('-p', '--password PASSWORD', 'optional password to use for operations that require 3-legged-oauth') do |email|
45
+ options[:password] = email
46
+ end
47
+
48
+ opts.on('-d', '--data FILE', 'path to file for any operations that require a body (PUT OR POST)') do |path|
49
+ options[:data_path] = path
50
+ end
51
+
52
+ opts.on('-X', '--method METHOD', 'method to send (GET, PUT, POST)') do |method|
53
+ options[:method] = method.downcase.to_sym
54
+ end
55
+
56
+ opts.on('-a', '--get-auth', 'only output the bearer authorization') do
57
+ options[:auth_only] = true
58
+ end
59
+
60
+ opts.on('-v', '--verbose', 'print verbose information') do
61
+ options[:verbose] = true
62
+ end
63
+
64
+ opts.on('-t', '--traveler', 'login as a traveler') do
65
+ options[:type] = :traveler
66
+ end
67
+
68
+ opts.on('-o', '--owner', 'login as an owner (the default)') do
69
+ options[:type] = :owner
70
+ end
71
+
72
+ end
73
+
74
+ parser.parse!
75
+
76
+ ARGV.clear if options[:auth_only]
77
+
78
+ if ARGV.size == 0 and !options[:auth_only]
79
+ $stderr.puts 'url is requred'
80
+ $stderr.puts parser.help
81
+ exit 1
82
+ end
83
+
84
+ url = ARGV.first
85
+
86
+ if options[:client_id].nil?
87
+ $stderr.puts 'client id is required'
88
+ $stderr.puts parser.help
89
+ exit 1
90
+ end
91
+
92
+ if options[:client_secret].nil?
93
+ $stderr.puts 'client secret is required'
94
+ $stderr.puts parser.help
95
+ exit 1
96
+ end
97
+
98
+ configuration = {
99
+ site: 'https://ws.homeaway.com',
100
+ }
101
+
102
+ method = :get
103
+ allowed_methods = [:get, :post, :put]
104
+ method = options[:method] if options[:method] && allowed_methods.include?(options[:method].downcase.to_sym)
105
+ data = nil
106
+ if options[:data_path]
107
+ unless File.exist?(options[:data_path])
108
+ $stderr.puts "#{:data_path} does not exist"
109
+ $stderr.puts parser.help
110
+ exit 1
111
+ end
112
+ file = File.open(options[:data_path], 'r')
113
+ data = (JSON.load(file)).to_hash
114
+ file.close
115
+ end
116
+
117
+ oauth_site = configuration[:site]
118
+ oauth_site = configuration[:oauth_site] if configuration.has_key?(:oauth_site)
119
+
120
+ client = HomeAway::API::Client.new(
121
+ client_id: options[:client_id],
122
+ client_secret: options[:client_secret],
123
+ cas_url: configuration[:cas_url],
124
+ site: configuration[:site],
125
+ oauth_site: oauth_site
126
+ )
127
+
128
+ if options[:email] and options[:password]
129
+ agent = Mechanize.new
130
+ auth_url = "https://cas.homeaway.com/auth/homeaway/login?service=https%3A%2F%2Fws.homeaway.com%2Foauth%2Fowner%2Fj_spring_cas_security_check%3Fspring-security-redirect%3Dhttps%253A%252F%252Fws.homeaway.com%252Foauth%252Fowner%252FauthorizeOwner%253Fclient_id%253D#{options[:client_id]}%2526"
131
+ auth_url = "https://cas.homeaway.com/auth/homeaway/login?service=https%3A%2F%2Fws.homeaway.com%2Foauth%2Ftraveler%2Fj_spring_cas_security_check%3Fspring-security-redirect%3Dhttps%253A%252F%252Fws.homeaway.com%252Foauth%252Ftraveler%252FauthorizeTraveler%253Fclient_id%253D#{options[:client_id]}%2526" if options[:type] == :traveler
132
+ agent.get(auth_url) do |login_page|
133
+ login_page.form_with(:id => 'login-form') do |form|
134
+ form.username = options[:email]
135
+ form.password = options[:password]
136
+ end.submit
137
+
138
+ agent.follow_redirect = false
139
+ agent.get("https://cas.homeaway.com/auth/homeaway/login?service=https://ws.homeaway.com/oauth/authenticate?clientId=#{options[:client_id]}") do |page|
140
+ unless page.response['location']
141
+ $stderr.puts 'Login failed. Please check the email and password provided'
142
+ exit 1
143
+ end
144
+ client.oauth_code = CGI.parse(URI.parse(page.response['location']).query)['ticket'].first
145
+ end
146
+ end
147
+ end
148
+
149
+ if options[:auth_only]
150
+ puts "Bearer #{client.token}"
151
+ exit 0
152
+ end
153
+
154
+ begin
155
+ uri = URI.parse(url)
156
+ begin
157
+ query = CGI.parse(uri.query)
158
+ rescue => _
159
+ query = {}
160
+ end
161
+ path = uri.path
162
+ path = "/public#{path}" unless path.start_with? '/public'
163
+ if method == :get
164
+ response = client.send(method, path, query)
165
+ else
166
+ response = client.send(method, path, data, query)
167
+ end
168
+ rescue => e
169
+ $stderr.puts e.to_s
170
+ exit 1
171
+ end
172
+ response_hash = response.to_hash
173
+ response_hash.delete('Metadata')
174
+ puts JSON.pretty_generate(response._metadata.to_hash) if options[:verbose]
175
+ puts JsonColor.colorize(JSON.pretty_generate(response_hash))
176
+ exit 0