AWSGameLiftSearchSessionsRequest.cpp 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 <AzFramework/Session/SessionConfig.h>
  15. #include <Request/AWSGameLiftSearchSessionsRequest.h>
  16. #include <AWSGameLiftSessionConstants.h>
  17. namespace AWSGameLift
  18. {
  19. void AWSGameLiftSearchSessionsRequest::Reflect(AZ::ReflectContext* context)
  20. {
  21. AzFramework::SearchSessionsRequest::Reflect(context);
  22. if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
  23. {
  24. serializeContext->Class<AWSGameLiftSearchSessionsRequest, AzFramework::SearchSessionsRequest>()
  25. ->Version(0)
  26. ->Field("aliasId", &AWSGameLiftSearchSessionsRequest::m_aliasId)
  27. ->Field("fleetId", &AWSGameLiftSearchSessionsRequest::m_fleetId)
  28. ->Field("location", &AWSGameLiftSearchSessionsRequest::m_location);
  29. if (AZ::EditContext* editContext = serializeContext->GetEditContext())
  30. {
  31. editContext->Class<AWSGameLiftSearchSessionsRequest>("AWSGameLiftSearchSessionsRequest", "")
  32. ->ClassElement(AZ::Edit::ClassElements::EditorData, "")
  33. ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)
  34. ->DataElement(
  35. AZ::Edit::UIHandlers::Default, &AWSGameLiftSearchSessionsRequest::m_aliasId, "AliasId (Required, or FleetId)",
  36. "A unique identifier for the alias associated with the fleet to search for active game sessions.")
  37. ->DataElement(
  38. AZ::Edit::UIHandlers::Default, &AWSGameLiftSearchSessionsRequest::m_fleetId, "FleetId (Required, or AliasId)",
  39. "A unique identifier for the fleet to search for active game sessions.")
  40. ->DataElement(
  41. AZ::Edit::UIHandlers::Default, &AWSGameLiftSearchSessionsRequest::m_location, "Location",
  42. "A fleet location to search for game sessions.");
  43. }
  44. }
  45. if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
  46. {
  47. behaviorContext->Class<AzFramework::SearchSessionsRequest>("SearchSessionsRequest")
  48. ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)
  49. // Expose base type to BehaviorContext, but hide it to be used directly
  50. ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All);
  51. behaviorContext->Class<AWSGameLiftSearchSessionsRequest>("AWSGameLiftSearchSessionsRequest")
  52. ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)
  53. ->Property("FilterExpression", BehaviorValueProperty(&AWSGameLiftSearchSessionsRequest::m_filterExpression))
  54. ->Property("SortExpression", BehaviorValueProperty(&AWSGameLiftSearchSessionsRequest::m_sortExpression))
  55. ->Property("MaxResult", BehaviorValueProperty(&AWSGameLiftSearchSessionsRequest::m_maxResult))
  56. ->Property("NextToken", BehaviorValueProperty(&AWSGameLiftSearchSessionsRequest::m_nextToken))
  57. ->Property("AliasId", BehaviorValueProperty(&AWSGameLiftSearchSessionsRequest::m_aliasId))
  58. ->Property("FleetId", BehaviorValueProperty(&AWSGameLiftSearchSessionsRequest::m_fleetId))
  59. ->Property("Location", BehaviorValueProperty(&AWSGameLiftSearchSessionsRequest::m_location));
  60. }
  61. }
  62. } // namespace AWSGameLift