Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include output parameter in S3 GetBucketLocation definition #899

Merged
merged 1 commit into from
Aug 20, 2015

Conversation

dtan4
Copy link
Contributor

@dtan4 dtan4 commented Aug 17, 2015

WHAT

Include output parameter in S3 GetBucketLocation (Aws::S3::Client#get_bucket_location) definition.
This fix enables us to stub response of Aws::S3::Client#get_bucket_location.

WHY

At aws-sdk-core v2.1.14, I cannot stub response of Aws::S3::Client#get_bucket_location.

# test code
      let(:hoge_location) do
        { location_constraint: "ap-northeast-1" }
      end

      before do
        client.stub_responses(:get_bucket_location, hoge_location)
      end
# test result
   Failure/Error: client.stub_responses(:get_bucket_location, hoge_location)
     ArgumentError:
       unexpected value at params[:location_constraint]
     # ./vendor/bundle/ruby/2.2.0/gems/aws-sdk-core-2.1.14/lib/aws-sdk-core/param_validator.rb:26:in `validate!'
...

By inspection on Pry, I found that GetBucketLocation output returns EmptyStructure. I think It may not be expected result...

$ pry -raws-sdk-core
[1] pry(main)> client = Aws::S3::Client.new
=> #<Aws::S3::Client>
[2] pry(main)> client.operation(:get_bucket_location).output
=> #<Seahorse::Model::Shapes::ShapeRef:0x007f88031bb060
 @deprecated=false,
 @metadata={},
 @required=false,
 @shape=
  #<Seahorse::Model::Shapes::StructureShape:0x007f88031bb308
   @members={},
   @members_by_location_name={},
   @metadata={"struct_class"=>Aws::EmptyStructure},
   @name="EmptyStructure",
   @required=#<Set: {}>>>

trevorrowe added a commit that referenced this pull request Aug 20, 2015
Include output parameter in S3 GetBucketLocation definition
@trevorrowe trevorrowe merged commit 4a56478 into aws:master Aug 20, 2015
@trevorrowe
Copy link
Member

Thanks!

@dtan4 dtan4 deleted the include-getbucketlocation-output branch August 20, 2015 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants