Class: Google::Apis::ServicemanagementV1::Field

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/servicemanagement_v1/classes.rb,
lib/google/apis/servicemanagement_v1/representations.rb,
lib/google/apis/servicemanagement_v1/representations.rb

Overview

A single field of a message type. New usages of this message as an alternative to FieldDescriptorProto are strongly discouraged. This message does not reliability preserve all information necessary to model the schema and preserve semantics. Instead make use of FileDescriptorSet which preserves the necessary information.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Field

Returns a new instance of Field.



1942
1943
1944
# File 'lib/google/apis/servicemanagement_v1/classes.rb', line 1942

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#cardinalityString

The field cardinality. Corresponds to the JSON property cardinality

Returns:

  • (String)


1892
1893
1894
# File 'lib/google/apis/servicemanagement_v1/classes.rb', line 1892

def cardinality
  @cardinality
end

#default_valueString

The string value of the default value of this field. Proto2 syntax only. Corresponds to the JSON property defaultValue

Returns:

  • (String)


1897
1898
1899
# File 'lib/google/apis/servicemanagement_v1/classes.rb', line 1897

def default_value
  @default_value
end

#json_nameString

The field JSON name. Corresponds to the JSON property jsonName

Returns:

  • (String)


1902
1903
1904
# File 'lib/google/apis/servicemanagement_v1/classes.rb', line 1902

def json_name
  @json_name
end

#kindString

The field type. Corresponds to the JSON property kind

Returns:

  • (String)


1907
1908
1909
# File 'lib/google/apis/servicemanagement_v1/classes.rb', line 1907

def kind
  @kind
end

#nameString

The field name. Corresponds to the JSON property name

Returns:

  • (String)


1912
1913
1914
# File 'lib/google/apis/servicemanagement_v1/classes.rb', line 1912

def name
  @name
end

#numberFixnum

The field number. Corresponds to the JSON property number

Returns:

  • (Fixnum)


1917
1918
1919
# File 'lib/google/apis/servicemanagement_v1/classes.rb', line 1917

def number
  @number
end

#oneof_indexFixnum

The index of the field type in Type.oneofs, for message or enumeration types. The first type has index 1; zero means the type is not in the list. Corresponds to the JSON property oneofIndex

Returns:

  • (Fixnum)


1923
1924
1925
# File 'lib/google/apis/servicemanagement_v1/classes.rb', line 1923

def oneof_index
  @oneof_index
end

#optionsArray<Google::Apis::ServicemanagementV1::Option>

The protocol buffer options. Corresponds to the JSON property options



1928
1929
1930
# File 'lib/google/apis/servicemanagement_v1/classes.rb', line 1928

def options
  @options
end

#packedBoolean Also known as: packed?

Whether to use alternative packed wire representation. Corresponds to the JSON property packed

Returns:

  • (Boolean)


1933
1934
1935
# File 'lib/google/apis/servicemanagement_v1/classes.rb', line 1933

def packed
  @packed
end

#type_urlString

The field type URL, without the scheme, for message or enumeration types. Example: "type.googleapis.com/google.protobuf.Timestamp". Corresponds to the JSON property typeUrl

Returns:

  • (String)


1940
1941
1942
# File 'lib/google/apis/servicemanagement_v1/classes.rb', line 1940

def type_url
  @type_url
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
# File 'lib/google/apis/servicemanagement_v1/classes.rb', line 1947

def update!(**args)
  @cardinality = args[:cardinality] if args.key?(:cardinality)
  @default_value = args[:default_value] if args.key?(:default_value)
  @json_name = args[:json_name] if args.key?(:json_name)
  @kind = args[:kind] if args.key?(:kind)
  @name = args[:name] if args.key?(:name)
  @number = args[:number] if args.key?(:number)
  @oneof_index = args[:oneof_index] if args.key?(:oneof_index)
  @options = args[:options] if args.key?(:options)
  @packed = args[:packed] if args.key?(:packed)
  @type_url = args[:type_url] if args.key?(:type_url)
end