Class: Com::Vmware::Vapi::Metadata::SourceType

Inherits:
VAPI::Bindings::VapiEnum
  • Object
show all
Defined in:
/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/metadata.rb

Overview

The ``Com::Vmware::Vapi::Metadata::SourceType`` enumerated type defines the types of sources for API metadata. You specify the type of source when adding a metadata source to a metadata service.

Constant Summary

FILE =
SourceType.new('FILE')
REMOTE =
SourceType.new('REMOTE')

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Attribute Details

- (Com::Vmware::Vapi::Metadata::SourceType) file

Indicates the metadata source is a JSON file.



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/metadata.rb', line 137

class SourceType < VAPI::Bindings::VapiEnum

    class << self
        # Holds (gets or creates) the binding type metadata for this enumeration type.
        # @scope class
        # @return [VAPI::Bindings::EnumType] the binding type
        def binding_type
            @binding_type ||= VAPI::Bindings::EnumType.new(
                'com.vmware.vapi.metadata.source_type',
                SourceType)
        end

        # Converts from a string value (perhaps off the wire) to an instance
        # of this enum type.
        # @param value [String] the actual value of the enum instance
        # @return [SourceType] the instance found for the value, otherwise
        #         an unknown instance will be built for the value
        def from_string(value)
            begin
                const_get(value)
            rescue NameError
                SourceType.new('UNKNOWN', value)
            end
        end
    end

    private

    # Constructs a new instance.
    # @param value [String] the actual value of the enum instance
    # @param unknown [String] the unknown value when value is 'UKNOWN'
    def initialize(value, unknown=nil)
        super(self.class.binding_type, value, unknown)
    end

    public

    # @!attribute [rw] file
    #     @return [Com::Vmware::Vapi::Metadata::SourceType]
    #     Indicates the metadata source is a JSON file.
    FILE = SourceType.new('FILE')

    # @!attribute [rw] remote
    #     @return [Com::Vmware::Vapi::Metadata::SourceType]
    #     Indicates the metadata source is a remote server.
    REMOTE = SourceType.new('REMOTE')

end

- (Com::Vmware::Vapi::Metadata::SourceType) remote

Indicates the metadata source is a remote server.



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/metadata.rb', line 137

class SourceType < VAPI::Bindings::VapiEnum

    class << self
        # Holds (gets or creates) the binding type metadata for this enumeration type.
        # @scope class
        # @return [VAPI::Bindings::EnumType] the binding type
        def binding_type
            @binding_type ||= VAPI::Bindings::EnumType.new(
                'com.vmware.vapi.metadata.source_type',
                SourceType)
        end

        # Converts from a string value (perhaps off the wire) to an instance
        # of this enum type.
        # @param value [String] the actual value of the enum instance
        # @return [SourceType] the instance found for the value, otherwise
        #         an unknown instance will be built for the value
        def from_string(value)
            begin
                const_get(value)
            rescue NameError
                SourceType.new('UNKNOWN', value)
            end
        end
    end

    private

    # Constructs a new instance.
    # @param value [String] the actual value of the enum instance
    # @param unknown [String] the unknown value when value is 'UKNOWN'
    def initialize(value, unknown=nil)
        super(self.class.binding_type, value, unknown)
    end

    public

    # @!attribute [rw] file
    #     @return [Com::Vmware::Vapi::Metadata::SourceType]
    #     Indicates the metadata source is a JSON file.
    FILE = SourceType.new('FILE')

    # @!attribute [rw] remote
    #     @return [Com::Vmware::Vapi::Metadata::SourceType]
    #     Indicates the metadata source is a remote server.
    REMOTE = SourceType.new('REMOTE')

end

Class Method Details

+ (VAPI::Bindings::EnumType) binding_type

Holds (gets or creates) the binding type metadata for this enumeration type.

Returns:

  • (VAPI::Bindings::EnumType)

    the binding type



143
144
145
146
147
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/metadata.rb', line 143

def binding_type
    @binding_type ||= VAPI::Bindings::EnumType.new(
        'com.vmware.vapi.metadata.source_type',
        SourceType)
end

+ (SourceType) from_string(value)

Converts from a string value (perhaps off the wire) to an instance of this enum type.

Parameters:

  • value (String)

    the actual value of the enum instance

Returns:

  • (SourceType)

    the instance found for the value, otherwise an unknown instance will be built for the value



154
155
156
157
158
159
160
# File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/vapi/metadata.rb', line 154

def from_string(value)
    begin
        const_get(value)
    rescue NameError
        SourceType.new('UNKNOWN', value)
    end
end