Class: TeamBattlesSdk::Generated::Models::GameCreateMatchBody

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

Overview

Request body for creating a two-sided game-originated match. The match is created ACCEPTED + PUBLISHED for the key’s bound game. Supports an optional Idempotency-Key header for safe retries.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

Instantiates a new GameCreateMatchBody and sets the default values.



103
104
105
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 103

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 game_create_match_body

Raises:

  • (StandardError)


111
112
113
114
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 111

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

Instance Method Details

#accepted_team_idObject

Gets the acceptedTeamId property value. ID of the opposing team. Required - game-originated matches are two-sided. Must belong to the key’s bound game.

Returns:

  • a string



58
59
60
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 58

def accepted_team_id
    return @accepted_team_id
end

#accepted_team_id=(value) ⇒ Object

Sets the acceptedTeamId property value. ID of the opposing team. Required - game-originated matches are two-sided. Must belong to the key’s bound game.

Parameters:

  • value

    Value to set for the acceptedTeamId property.

Returns:

  • a void



66
67
68
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 66

def accepted_team_id=(value)
    @accepted_team_id = value
end

#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



73
74
75
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 73

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



81
82
83
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 81

def additional_data=(value)
    @additional_data = value
end

#best_ofObject

Gets the bestOf property value. Number of maps in the series. One of 1, 3, 5, or 7.

Returns:

  • a double



88
89
90
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 88

def best_of
    return @best_of
end

#best_of=(value) ⇒ Object

Sets the bestOf property value. Number of maps in the series. One of 1, 3, 5, or 7.

Parameters:

  • value

    Value to set for the bestOf property.

Returns:

  • a void



96
97
98
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 96

def best_of=(value)
    @best_of = value
end

#creator_team_idObject

Gets the creatorTeamId property value. ID of the creating team. Must belong to the key’s bound game.

Returns:

  • a string



119
120
121
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 119

def creator_team_id
    return @creator_team_id
end

#creator_team_id=(value) ⇒ Object

Sets the creatorTeamId property value. ID of the creating team. Must belong to the key’s bound game.

Parameters:

  • value

    Value to set for the creatorTeamId property.

Returns:

  • a void



127
128
129
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 127

def creator_team_id=(value)
    @creator_team_id = value
end

#game_mode_idObject

Gets the gameModeId property value. Game mode identifier (e.g. search_and_destroy).

Returns:

  • a string



134
135
136
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 134

def game_mode_id
    return @game_mode_id
end

#game_mode_id=(value) ⇒ Object

Sets the gameModeId property value. Game mode identifier (e.g. search_and_destroy).

Parameters:

  • value

    Value to set for the gameModeId property.

Returns:

  • a void



142
143
144
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 142

def game_mode_id=(value)
    @game_mode_id = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 149

def get_field_deserializers()
    return {
        "acceptedTeamId" => lambda {|n| @accepted_team_id = n.get_string_value() },
        "bestOf" => lambda {|n| @best_of = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },
        "creatorTeamId" => lambda {|n| @creator_team_id = n.get_string_value() },
        "gameModeId" => lambda {|n| @game_mode_id = n.get_string_value() },
        "inputDevice" => lambda {|n| @input_device = n.get_enum_value(TeamBattlesSdk::Generated::Models::GameCreateMatchBodyInputDevice) },
        "mapPreferenceMode" => lambda {|n| @map_preference_mode = n.get_enum_value(TeamBattlesSdk::Generated::Models::GameCreateMatchBodyMapPreferenceMode) },
        "mapSelectionType" => lambda {|n| @map_selection_type = n.get_enum_value(TeamBattlesSdk::Generated::Models::GameCreateMatchBodyMapSelectionType) },
        "platform" => lambda {|n| @platform = n.get_enum_value(TeamBattlesSdk::Generated::Models::GameCreateMatchBodyPlatform) },
        "region" => lambda {|n| @region = n.get_enum_value(TeamBattlesSdk::Generated::Models::GameCreateMatchBodyRegion) },
        "scheduledAt" => lambda {|n| @scheduled_at = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },
        "selectedMaps" => lambda {|n| @selected_maps = n.get_collection_of_primitive_values(String) },
        "selectedObjectives" => lambda {|n| @selected_objectives = n.get_collection_of_primitive_values(String) },
        "teamSize" => lambda {|n| @team_size = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },
    }
end

#input_deviceObject

Gets the inputDevice property value. Allowed input device (e.g. ALL).

Returns:

  • a game_create_match_body_input_device



170
171
172
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 170

def input_device
    return @input_device
end

#input_device=(value) ⇒ Object

Sets the inputDevice property value. Allowed input device (e.g. ALL).

Parameters:

  • value

    Value to set for the inputDevice property.

Returns:

  • a void



178
179
180
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 178

def input_device=(value)
    @input_device = value
end

#map_preference_modeObject

Gets the mapPreferenceMode property value. Map preference mode (PREFERRED, VETO, or MANUAL).

Returns:

  • a game_create_match_body_map_preference_mode



185
186
187
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 185

def map_preference_mode
    return @map_preference_mode
end

#map_preference_mode=(value) ⇒ Object

Sets the mapPreferenceMode property value. Map preference mode (PREFERRED, VETO, or MANUAL).

Parameters:

  • value

    Value to set for the mapPreferenceMode property.

Returns:

  • a void



193
194
195
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 193

def map_preference_mode=(value)
    @map_preference_mode = value
end

#map_selection_typeObject

Gets the mapSelectionType property value. Map selection type (COMPETITIVE or FLEX).

Returns:

  • a game_create_match_body_map_selection_type



200
201
202
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 200

def map_selection_type
    return @map_selection_type
end

#map_selection_type=(value) ⇒ Object

Sets the mapSelectionType property value. Map selection type (COMPETITIVE or FLEX).

Parameters:

  • value

    Value to set for the mapSelectionType property.

Returns:

  • a void



208
209
210
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 208

def map_selection_type=(value)
    @map_selection_type = value
end

#platformObject

Gets the platform property value. Match platform (e.g. CROSSPLAY).

Returns:

  • a game_create_match_body_platform



215
216
217
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 215

def platform
    return @platform
end

#platform=(value) ⇒ Object

Sets the platform property value. Match platform (e.g. CROSSPLAY).

Parameters:

  • value

    Value to set for the platform property.

Returns:

  • a void



223
224
225
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 223

def platform=(value)
    @platform = value
end

#regionObject

Gets the region property value. Match region (e.g. NONE).

Returns:

  • a game_create_match_body_region



230
231
232
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 230

def region
    return @region
end

#region=(value) ⇒ Object

Sets the region property value. Match region (e.g. NONE).

Parameters:

  • value

    Value to set for the region property.

Returns:

  • a void



238
239
240
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 238

def region=(value)
    @region = value
end

#scheduled_atObject

Gets the scheduledAt property value. Optional scheduled start time (epoch ms).

Returns:

  • a double



245
246
247
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 245

def scheduled_at
    return @scheduled_at
end

#scheduled_at=(value) ⇒ Object

Sets the scheduledAt property value. Optional scheduled start time (epoch ms).

Parameters:

  • value

    Value to set for the scheduledAt property.

Returns:

  • a void



253
254
255
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 253

def scheduled_at=(value)
    @scheduled_at = value
end

#selected_mapsObject

Gets the selectedMaps property value. Optional pre-selected map IDs.

Returns:

  • a string



260
261
262
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 260

def selected_maps
    return @selected_maps
end

#selected_maps=(value) ⇒ Object

Sets the selectedMaps property value. Optional pre-selected map IDs.

Parameters:

  • value

    Value to set for the selectedMaps property.

Returns:

  • a void



268
269
270
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 268

def selected_maps=(value)
    @selected_maps = value
end

#selected_objectivesObject

Gets the selectedObjectives property value. Optional pre-selected objective IDs.

Returns:

  • a string



275
276
277
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 275

def selected_objectives
    return @selected_objectives
end

#selected_objectives=(value) ⇒ Object

Sets the selectedObjectives property value. Optional pre-selected objective IDs.

Parameters:

  • value

    Value to set for the selectedObjectives property.

Returns:

  • a void



283
284
285
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 283

def selected_objectives=(value)
    @selected_objectives = 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)


291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 291

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    writer.write_string_value("acceptedTeamId", @accepted_team_id)
    writer.write_object_value("bestOf", @best_of)
    writer.write_string_value("creatorTeamId", @creator_team_id)
    writer.write_string_value("gameModeId", @game_mode_id)
    writer.write_enum_value("inputDevice", @input_device)
    writer.write_enum_value("mapPreferenceMode", @map_preference_mode)
    writer.write_enum_value("mapSelectionType", @map_selection_type)
    writer.write_enum_value("platform", @platform)
    writer.write_enum_value("region", @region)
    writer.write_object_value("scheduledAt", @scheduled_at)
    writer.write_collection_of_primitive_values("selectedMaps", @selected_maps)
    writer.write_collection_of_primitive_values("selectedObjectives", @selected_objectives)
    writer.write_object_value("teamSize", @team_size)
    writer.write_additional_data(@additional_data)
end

#team_sizeObject

Gets the teamSize property value. Players per team (validated against the game’s min/max).

Returns:

  • a double



312
313
314
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 312

def team_size
    return @team_size
end

#team_size=(value) ⇒ Object

Sets the teamSize property value. Players per team (validated against the game’s min/max).

Parameters:

  • value

    Value to set for the teamSize property.

Returns:

  • a void



320
321
322
# File 'lib/teambattles_sdk/generated/models/game_create_match_body.rb', line 320

def team_size=(value)
    @team_size = value
end