Class: MicrosoftGraph::Models::SecurityKubernetesServicePort

Inherits:
Object
  • Object
show all
Includes:
MicrosoftKiotaAbstractions::AdditionalDataHolder, MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/security_kubernetes_service_port.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

Instantiates a new securityKubernetesServicePort and sets the default values.



67
68
69
# File 'lib/models/security_kubernetes_service_port.rb', line 67

def initialize()
    @additional_data = Hash.new
end

Class Method Details

.create_from_discriminator_value(parse_node) ⇒ Object

Creates a new instance of the appropriate class based on discriminator value

Parameters:

  • parse_node

    The parse node to use to read the discriminator value and create the object

Returns:

  • a security_kubernetes_service_port

Raises:

  • (StandardError)


75
76
77
78
# File 'lib/models/security_kubernetes_service_port.rb', line 75

def self.create_from_discriminator_value(parse_node)
    raise StandardError, 'parse_node cannot be null' if parse_node.nil?
    return SecurityKubernetesServicePort.new
end

Instance Method Details

#additional_dataObject

Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.

Returns:

  • a i_dictionary



37
38
39
# File 'lib/models/security_kubernetes_service_port.rb', line 37

def additional_data
    return @additional_data
end

#additional_data=(value) ⇒ Object

Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.

Parameters:

  • value

    Value to set for the additionalData property.

Returns:

  • a void



45
46
47
# File 'lib/models/security_kubernetes_service_port.rb', line 45

def additional_data=(value)
    @additional_data = value
end

#app_protocolObject

Gets the appProtocol property value. The application protocol for this port.

Returns:

  • a string



52
53
54
# File 'lib/models/security_kubernetes_service_port.rb', line 52

def app_protocol
    return @app_protocol
end

#app_protocol=(value) ⇒ Object

Sets the appProtocol property value. The application protocol for this port.

Parameters:

  • value

    Value to set for the appProtocol property.

Returns:

  • a void



60
61
62
# File 'lib/models/security_kubernetes_service_port.rb', line 60

def app_protocol=(value)
    @app_protocol = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



83
84
85
86
87
88
89
90
91
92
93
# File 'lib/models/security_kubernetes_service_port.rb', line 83

def get_field_deserializers()
    return {
        "appProtocol" => lambda {|n| @app_protocol = n.get_string_value() },
        "name" => lambda {|n| @name = n.get_string_value() },
        "nodePort" => lambda {|n| @node_port = n.get_number_value() },
        "@odata.type" => lambda {|n| @odata_type = n.get_string_value() },
        "port" => lambda {|n| @port = n.get_number_value() },
        "protocol" => lambda {|n| @protocol = n.get_enum_value(MicrosoftGraph::Models::SecurityContainerPortProtocol) },
        "targetPort" => lambda {|n| @target_port = n.get_string_value() },
    }
end

#nameObject

Gets the name property value. The name of this port within the service.

Returns:

  • a string



98
99
100
# File 'lib/models/security_kubernetes_service_port.rb', line 98

def name
    return @name
end

#name=(value) ⇒ Object

Sets the name property value. The name of this port within the service.

Parameters:

  • value

    Value to set for the name property.

Returns:

  • a void



106
107
108
# File 'lib/models/security_kubernetes_service_port.rb', line 106

def name=(value)
    @name = value
end

#node_portObject

Gets the nodePort property value. The port on each node on which this service is exposed when the type is either NodePort or LoadBalancer.

Returns:

  • a integer



113
114
115
# File 'lib/models/security_kubernetes_service_port.rb', line 113

def node_port
    return @node_port
end

#node_port=(value) ⇒ Object

Sets the nodePort property value. The port on each node on which this service is exposed when the type is either NodePort or LoadBalancer.

Parameters:

  • value

    Value to set for the nodePort property.

Returns:

  • a void



121
122
123
# File 'lib/models/security_kubernetes_service_port.rb', line 121

def node_port=(value)
    @node_port = value
end

#odata_typeObject

Gets the @odata.type property value. The OdataType property

Returns:

  • a string



128
129
130
# File 'lib/models/security_kubernetes_service_port.rb', line 128

def odata_type
    return @odata_type
end

#odata_type=(value) ⇒ Object

Sets the @odata.type property value. The OdataType property

Parameters:

  • value

    Value to set for the @odata.type property.

Returns:

  • a void



136
137
138
# File 'lib/models/security_kubernetes_service_port.rb', line 136

def odata_type=(value)
    @odata_type = value
end

#portObject

Gets the port property value. The port that this service exposes.

Returns:

  • a integer



143
144
145
# File 'lib/models/security_kubernetes_service_port.rb', line 143

def port
    return @port
end

#port=(value) ⇒ Object

Sets the port property value. The port that this service exposes.

Parameters:

  • value

    Value to set for the port property.

Returns:

  • a void



151
152
153
# File 'lib/models/security_kubernetes_service_port.rb', line 151

def port=(value)
    @port = value
end

#protocolObject

Gets the protocol property value. The protocol name. Possible values are: udp, tcp, sctp, unknownFutureValue.

Returns:

  • a security_container_port_protocol



158
159
160
# File 'lib/models/security_kubernetes_service_port.rb', line 158

def protocol
    return @protocol
end

#protocol=(value) ⇒ Object

Sets the protocol property value. The protocol name. Possible values are: udp, tcp, sctp, unknownFutureValue.

Parameters:

  • value

    Value to set for the protocol property.

Returns:

  • a void



166
167
168
# File 'lib/models/security_kubernetes_service_port.rb', line 166

def protocol=(value)
    @protocol = value
end

#serialize(writer) ⇒ Object

Serializes information the current object

Parameters:

  • writer

    Serialization writer to use to serialize this model

Returns:

  • a void

Raises:

  • (StandardError)


174
175
176
177
178
179
180
181
182
183
184
# File 'lib/models/security_kubernetes_service_port.rb', line 174

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    writer.write_string_value("appProtocol", @app_protocol)
    writer.write_string_value("name", @name)
    writer.write_number_value("nodePort", @node_port)
    writer.write_string_value("@odata.type", @odata_type)
    writer.write_number_value("port", @port)
    writer.write_enum_value("protocol", @protocol)
    writer.write_string_value("targetPort", @target_port)
    writer.write_additional_data(@additional_data)
end

#target_portObject

Gets the targetPort property value. The name or number of the port to access on the pods targeted by the service. The port number must be in the range 1 to 65535. The name must be an IANASVCNAME.

Returns:

  • a string



189
190
191
# File 'lib/models/security_kubernetes_service_port.rb', line 189

def target_port
    return @target_port
end

#target_port=(value) ⇒ Object

Sets the targetPort property value. The name or number of the port to access on the pods targeted by the service. The port number must be in the range 1 to 65535. The name must be an IANASVCNAME.

Parameters:

  • value

    Value to set for the targetPort property.

Returns:

  • a void



197
198
199
# File 'lib/models/security_kubernetes_service_port.rb', line 197

def target_port=(value)
    @target_port = value
end