Module: Aws::Structure Private
- Included in:
- EmptyStructure, Aws::SSO::Types::AccountInfo, Aws::SSO::Types::GetRoleCredentialsRequest, Aws::SSO::Types::GetRoleCredentialsResponse, Aws::SSO::Types::InvalidRequestException, Aws::SSO::Types::ListAccountRolesRequest, Aws::SSO::Types::ListAccountRolesResponse, Aws::SSO::Types::ListAccountsRequest, Aws::SSO::Types::ListAccountsResponse, Aws::SSO::Types::LogoutRequest, Aws::SSO::Types::ResourceNotFoundException, Aws::SSO::Types::RoleCredentials, Aws::SSO::Types::RoleInfo, Aws::SSO::Types::TooManyRequestsException, Aws::SSO::Types::UnauthorizedException, Aws::STS::Types::AssumeRoleRequest, Aws::STS::Types::AssumeRoleResponse, Aws::STS::Types::AssumeRoleWithSAMLRequest, Aws::STS::Types::AssumeRoleWithSAMLResponse, Aws::STS::Types::AssumeRoleWithWebIdentityRequest, Aws::STS::Types::AssumeRoleWithWebIdentityResponse, Aws::STS::Types::AssumedRoleUser, Aws::STS::Types::Credentials, Aws::STS::Types::DecodeAuthorizationMessageRequest, Aws::STS::Types::DecodeAuthorizationMessageResponse, Aws::STS::Types::ExpiredTokenException, Aws::STS::Types::FederatedUser, Aws::STS::Types::GetAccessKeyInfoRequest, Aws::STS::Types::GetAccessKeyInfoResponse, Aws::STS::Types::GetCallerIdentityResponse, Aws::STS::Types::GetFederationTokenRequest, Aws::STS::Types::GetFederationTokenResponse, Aws::STS::Types::GetSessionTokenRequest, Aws::STS::Types::GetSessionTokenResponse, Aws::STS::Types::IDPCommunicationErrorException, Aws::STS::Types::IDPRejectedClaimException, Aws::STS::Types::InvalidAuthorizationMessageException, Aws::STS::Types::InvalidIdentityTokenException, Aws::STS::Types::MalformedPolicyDocumentException, Aws::STS::Types::PackedPolicyTooLargeException, Aws::STS::Types::PolicyDescriptorType, Aws::STS::Types::RegionDisabledException, Aws::STS::Types::Tag
- Defined in:
- lib/aws-sdk-core/structure.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Modules: Union
Class Method Summary collapse
- .included(base_class) ⇒ Object private
- .new(*args) ⇒ Object private
Instance Method Summary collapse
-
#empty? ⇒ Boolean
private
Returns
trueif all of the member values arenil. - #initialize(values = {}) ⇒ Object private
-
#key?(member_name) ⇒ Boolean
private
Returns
trueif this structure has a value set for the given member. -
#to_h(obj = self) ⇒ Hash
(also: #to_hash)
private
Deeply converts the Structure into a hash.
-
#to_s(obj = self) ⇒ Object
private
Wraps the default #to_s logic with filtering of sensitive parameters.
Class Method Details
.included(base_class) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
68 69 70 |
# File 'lib/aws-sdk-core/structure.rb', line 68 def self.included(base_class) base_class.send(:undef_method, :each) end |
.new(*args) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
57 58 59 60 61 62 63 64 65 |
# File 'lib/aws-sdk-core/structure.rb', line 57 def new(*args) if args.empty? Aws::EmptyStructure else struct = Struct.new(*args) struct.send(:include, Aws::Structure) struct end end |
Instance Method Details
#empty? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns true if all of the member values are nil.
20 21 22 |
# File 'lib/aws-sdk-core/structure.rb', line 20 def empty? values.compact == [] end |
#initialize(values = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
7 8 9 10 11 |
# File 'lib/aws-sdk-core/structure.rb', line 7 def initialize(values = {}) values.each do |k, v| self[k] = v end end |
#key?(member_name) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns true if this structure has a value set for the given member.
15 16 17 |
# File 'lib/aws-sdk-core/structure.rb', line 15 def key?(member_name) !self[member_name].nil? end |
#to_h(obj = self) ⇒ Hash Also known as: to_hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Deeply converts the Structure into a hash. Structure members that are nil are omitted from the resultant hash.
You can call #orig_to_h to get vanilla #to_h behavior as defined in stdlib Struct.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/aws-sdk-core/structure.rb', line 31 def to_h(obj = self) case obj when Struct obj.each_pair.with_object({}) do |(member, value), hash| hash[member] = to_hash(value) unless value.nil? end when Hash obj.each.with_object({}) do |(key, value), hash| hash[key] = to_hash(value) end when Array obj.collect { |value| to_hash(value) } else obj end end |
#to_s(obj = self) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Wraps the default #to_s logic with filtering of sensitive parameters.
50 51 52 |
# File 'lib/aws-sdk-core/structure.rb', line 50 def to_s(obj = self) Aws::Log::ParamFilter.new.filter(obj, obj.class).to_s end |