Class: Aws::Api::Customizer Private

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-sdk-core/api/customizer.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_class) ⇒ Customizer

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 a new instance of Customizer.



6
7
8
9
# File 'lib/aws-sdk-core/api/customizer.rb', line 6

def initialize(client_class)
  @client_class = client_class
  @api = client_class.api
end

Instance Attribute Details

#apiSeahorse::Model::Api (readonly)

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.



15
16
17
# File 'lib/aws-sdk-core/api/customizer.rb', line 15

def api
  @api
end

#client_classClass<Seahorse::Client::Base> (readonly)

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:



12
13
14
# File 'lib/aws-sdk-core/api/customizer.rb', line 12

def client_class
  @client_class
end

Instance Method Details

#add_plugin(plugin) ⇒ 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.

Parameters:



23
24
25
# File 'lib/aws-sdk-core/api/customizer.rb', line 23

def add_plugin(plugin)
  @client_class.add_plugin(plugin)
end

#add_shape(shape_name, definition) ⇒ 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.



36
37
38
# File 'lib/aws-sdk-core/api/customizer.rb', line 36

def add_shape(shape_name, definition)
  @client_class.api.definition['shapes'][shape_name] = definition
end

#apply(&customizations) ⇒ 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.



18
19
20
# File 'lib/aws-sdk-core/api/customizer.rb', line 18

def apply(&customizations)
  instance_eval(&customizations)
end

#each_operation(&block) ⇒ 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.



61
62
63
# File 'lib/aws-sdk-core/api/customizer.rb', line 61

def each_operation(&block)
  @client_class.api.definition['operations'].each(&block)
end

#metadata(key, value) ⇒ 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.



32
33
34
# File 'lib/aws-sdk-core/api/customizer.rb', line 32

def (key, value)
  @client_class.api.definition['metadata'][key] = value
end

#remove_plugin(plugin) ⇒ 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.

Parameters:



28
29
30
# File 'lib/aws-sdk-core/api/customizer.rb', line 28

def remove_plugin(plugin)
  @client_class.remove_plugin(plugin)
end

#reshape(shape_name, modifications) ⇒ 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.



40
41
42
43
44
# File 'lib/aws-sdk-core/api/customizer.rb', line 40

def reshape(shape_name, modifications)
  shape = @client_class.api.definition['shapes'][shape_name]
  shape = deep_merge(shape, modifications)
  @client_class.api.definition['shapes'][shape_name] = shape
end

#reshape_members(member_regex, modifications) ⇒ 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.



46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/aws-sdk-core/api/customizer.rb', line 46

def reshape_members(member_regex, modifications)
  if member_regex.is_a?(String)
    member_regex = /^#{member_regex}$/
  end
  @client_class.api.definition['shapes'].each do |shape_name, shape|
    if shape['members']
      shape['members'].each do |member_name, member_ref|
        if member_name.match(member_regex)
          shape['members'][member_name] = deep_merge(member_ref, modifications)
        end
      end
    end
  end
end