AllocationRequest constructor

AllocationRequest({
  1. String? namespace,
  2. MultiClusterSetting? multiClusterSetting,
  3. @Deprecated('This field is deprecated.') GameServerSelector? requiredGameServerSelector,
  4. @Deprecated('This field is deprecated.') Iterable<GameServerSelector>? preferredGameServerSelectors,
  5. AllocationRequest_SchedulingStrategy? scheduling,
  6. MetaPatch? metaPatch,
  7. MetaPatch? metadata,
  8. Iterable<GameServerSelector>? gameServerSelectors,
})

Implementation

factory AllocationRequest({
  $core.String? namespace,
  MultiClusterSetting? multiClusterSetting,
  @$core.Deprecated('This field is deprecated.')
      GameServerSelector? requiredGameServerSelector,
  @$core.Deprecated('This field is deprecated.')
      $core.Iterable<GameServerSelector>? preferredGameServerSelectors,
  AllocationRequest_SchedulingStrategy? scheduling,
  MetaPatch? metaPatch,
  MetaPatch? metadata,
  $core.Iterable<GameServerSelector>? gameServerSelectors,
}) {
  final _result = create();
  if (namespace != null) {
    _result.namespace = namespace;
  }
  if (multiClusterSetting != null) {
    _result.multiClusterSetting = multiClusterSetting;
  }
  if (requiredGameServerSelector != null) {
    // ignore: deprecated_member_use_from_same_package
    _result.requiredGameServerSelector = requiredGameServerSelector;
  }
  if (preferredGameServerSelectors != null) {
    // ignore: deprecated_member_use_from_same_package
    _result.preferredGameServerSelectors.addAll(preferredGameServerSelectors);
  }
  if (scheduling != null) {
    _result.scheduling = scheduling;
  }
  if (metaPatch != null) {
    _result.metaPatch = metaPatch;
  }
  if (metadata != null) {
    _result.metadata = metadata;
  }
  if (gameServerSelectors != null) {
    _result.gameServerSelectors.addAll(gameServerSelectors);
  }
  return _result;
}