AWSGameLiftCreateSessionRequest.cpp 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
  3. * its licensors.
  4. *
  5. * For complete copyright and license terms please see the LICENSE at the root of this
  6. * distribution (the "License"). All use of this software is governed by the License,
  7. * or, if provided, by the license below or the license accompanying this file. Do not
  8. * remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
  9. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. *
  11. */
  12. #include <AzCore/Serialization/EditContext.h>
  13. #include <AzCore/Serialization/SerializeContext.h>
  14. #include <Request/AWSGameLiftCreateSessionRequest.h>
  15. namespace AWSGameLift
  16. {
  17. void AWSGameLiftCreateSessionRequest::Reflect(AZ::ReflectContext* context)
  18. {
  19. if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
  20. {
  21. serializeContext->Class<AWSGameLiftCreateSessionRequest, AzFramework::CreateSessionRequest>()
  22. ->Version(0)
  23. ->Field("aliasId", &AWSGameLiftCreateSessionRequest::m_aliasId)
  24. ->Field("fleetId", &AWSGameLiftCreateSessionRequest::m_fleetId)
  25. ->Field("idempotencyToken", &AWSGameLiftCreateSessionRequest::m_idempotencyToken)
  26. ;
  27. if (AZ::EditContext* editContext = serializeContext->GetEditContext())
  28. {
  29. editContext->Class<AWSGameLiftCreateSessionRequest>("AWSGameLiftCreateSessionRequest", "")
  30. ->ClassElement(AZ::Edit::ClassElements::EditorData, "")
  31. ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)
  32. ->DataElement(
  33. AZ::Edit::UIHandlers::Default, &AWSGameLiftCreateSessionRequest::m_aliasId, "AliasId (Required, or FleetId)",
  34. "A unique identifier for the alias associated with the fleet to create a game session in")
  35. ->DataElement(
  36. AZ::Edit::UIHandlers::Default, &AWSGameLiftCreateSessionRequest::m_fleetId, "FleetId (Required, or AliasId)",
  37. "A unique identifier for the fleet to create a game session in")
  38. ->DataElement(
  39. AZ::Edit::UIHandlers::Default, &AWSGameLiftCreateSessionRequest::m_idempotencyToken, "IdempotencyToken",
  40. "Custom string that uniquely identifies the new game session request")
  41. ;
  42. }
  43. }
  44. if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
  45. {
  46. behaviorContext->Class<AWSGameLiftCreateSessionRequest>("AWSGameLiftCreateSessionRequest")
  47. ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)
  48. ->Property("CreatorId", BehaviorValueProperty(&AWSGameLiftCreateSessionRequest::m_creatorId))
  49. ->Property("SessionProperties", BehaviorValueProperty(&AWSGameLiftCreateSessionRequest::m_sessionProperties))
  50. ->Property("SessionName", BehaviorValueProperty(&AWSGameLiftCreateSessionRequest::m_sessionName))
  51. ->Property("MaxPlayer", BehaviorValueProperty(&AWSGameLiftCreateSessionRequest::m_maxPlayer))
  52. ->Property("AliasId", BehaviorValueProperty(&AWSGameLiftCreateSessionRequest::m_aliasId))
  53. ->Property("FleetId", BehaviorValueProperty(&AWSGameLiftCreateSessionRequest::m_fleetId))
  54. ->Property("IdempotencyToken", BehaviorValueProperty(&AWSGameLiftCreateSessionRequest::m_idempotencyToken))
  55. ;
  56. }
  57. }
  58. } // namespace AWSGameLift