示例#1
0
        /// <summary>
        /// Initialises a new instance of the request with the given description.
        /// </summary>
        ///
        /// <param name="desc">The description.</param>
        /// <param name="connectAccessToken">A valid session ConnectAccessToken obtained through one of the login endpoints.</param>
        /// <param name="serverUrl">The server url for this call.</param>
        public QueryCollectionRequest(QueryCollectionRequestDesc desc, string connectAccessToken, string serverUrl)
        {
            ReleaseAssert.IsNotNull(desc, "A description object cannot be null.");

            ReleaseAssert.IsNotNull(desc.Key, "Key cannot be null.");

            ReleaseAssert.IsNotNull(connectAccessToken, "Connect Access Token cannot be null.");

            Key   = desc.Key;
            Query = desc.Query;
            if (desc.Params != null)
            {
                Params = Mutability.ToImmutable(desc.Params);
            }
            if (desc.SortFields != null)
            {
                SortFields = Mutability.ToImmutable(desc.SortFields);
            }
            Page               = desc.Page;
            Randomize          = desc.Randomize;
            ConnectAccessToken = connectAccessToken;

            Url = serverUrl + "/1.0/data/collection/query";
            HttpRequestMethod = HttpRequestMethod.Post;
        }
        /// <summary>
        /// Initialises a new instance of the request with the given description.
        /// </summary>
        ///
        /// <param name="desc">The description.</param>
        /// <param name="connectAccessToken">A valid session ConnectAccessToken obtained through one of the login endpoints.</param>
        public CreateMatchRequest(CreateMatchRequestDesc desc, string connectAccessToken)
        {
            ReleaseAssert.IsNotNull(desc, "A description object cannot be null.");

            ReleaseAssert.IsNotNull(desc.MatchTypeKey, "MatchTypeKey cannot be null.");
            ReleaseAssert.IsNotNull(desc.TurnType, "TurnType cannot be null.");

            ReleaseAssert.IsNotNull(connectAccessToken, "Connect Access Token cannot be null.");

            MatchTypeKey = desc.MatchTypeKey;
            TurnType     = desc.TurnType;
            PlayerLimit  = desc.PlayerLimit;
            if (desc.Properties != null)
            {
                Properties = Mutability.ToImmutable(desc.Properties);
            }
            StateData      = desc.StateData;
            TurnTimeout    = desc.TurnTimeout;
            WaitingTimeout = desc.WaitingTimeout;
            TurnOrderType  = desc.TurnOrderType;
            if (desc.Players != null)
            {
                Players = Mutability.ToImmutable(desc.Players);
            }
            AutoStart          = desc.AutoStart;
            Private            = desc.Private;
            ConnectAccessToken = connectAccessToken;

            Url = "https://connect.chilliconnect.com/1.0/multiplayer/async/match/create";
            HttpRequestMethod = HttpRequestMethod.Post;
        }
示例#3
0
        /// <summary>
        /// Initialises a new instance of the request with the given description.
        /// </summary>
        ///
        /// <param name="desc">The description.</param>
        /// <param name="connectAccessToken">A valid session ConnectAccessToken obtained through one of the login endpoints.</param>
        /// <param name="serverUrl">The server url for this call.</param>
        public SendMessageRequest(SendMessageRequestDesc desc, string connectAccessToken, string serverUrl)
        {
            ReleaseAssert.IsNotNull(desc, "A description object cannot be null.");

            ReleaseAssert.IsNotNull(desc.To, "To cannot be null.");

            ReleaseAssert.IsNotNull(connectAccessToken, "Connect Access Token cannot be null.");

            To    = desc.To;
            From  = desc.From;
            Title = desc.Title;
            Text  = desc.Text;
            Data  = desc.Data;
            if (desc.Tags != null)
            {
                Tags = Mutability.ToImmutable(desc.Tags);
            }
            Expiry             = desc.Expiry;
            Gifts              = desc.Gifts;
            Transfer           = desc.Transfer;
            ConnectAccessToken = connectAccessToken;

            Url = serverUrl + "/1.0/message/send";
            HttpRequestMethod = HttpRequestMethod.Post;
        }
        /// <summary>
        /// Initialises a new instance with the given description.
        /// </summary>
        ///
        /// <param name="desc">The description.</param>
        public Message(MessageDesc desc)
        {
            ReleaseAssert.IsNotNull(desc, "A description object cannot be null.");

            ReleaseAssert.IsNotNull(desc.MessageId, "MessageId cannot be null.");
            ReleaseAssert.IsNotNull(desc.From, "From cannot be null.");
            ReleaseAssert.IsNotNull(desc.SentOn, "SentOn cannot be null.");

            MessageId  = desc.MessageId;
            From       = desc.From;
            SentOn     = desc.SentOn;
            Read       = desc.Read;
            ReadOn     = desc.ReadOn;
            Redeemed   = desc.Redeemed;
            RedeemedOn = desc.RedeemedOn;
            if (desc.Tags != null)
            {
                Tags = Mutability.ToImmutable(desc.Tags);
            }
            Expiry  = desc.Expiry;
            Title   = desc.Title;
            Text    = desc.Text;
            Data    = desc.Data;
            Rewards = desc.Rewards;
        }
        /// <summary>
        /// Initialises a new instance with the given properties.
        /// </summary>
        ///
        /// <param name="currencies">The Currency items to be exchanged.</param>
        /// <param name="items">The Inventory items to be exchanged.</param>
        public PurchaseExchangeDefinition(IList <PurchaseCurrencyExchangeDefinition> currencies, IList <PurchaseInventoryExchangeDefinition> items)
        {
            ReleaseAssert.IsNotNull(currencies, "Currencies cannot be null.");
            ReleaseAssert.IsNotNull(items, "Items cannot be null.");

            Currencies = Mutability.ToImmutable(currencies);
            Items      = Mutability.ToImmutable(items);
        }
示例#6
0
        /// <summary>
        /// Initialises a new instance with the given properties.
        /// </summary>
        ///
        /// <param name="currencies">A list of Currencies.</param>
        /// <param name="itemIDs">A list of Inventory ItemIDs.</param>
        public MessageTransfer(IList <MessageSendCurrency> currencies, IList <string> itemIDs)
        {
            ReleaseAssert.IsNotNull(currencies, "Currencies cannot be null.");
            ReleaseAssert.IsNotNull(itemIDs, "Item I Ds cannot be null.");

            Currencies = Mutability.ToImmutable(currencies);
            ItemIDs    = Mutability.ToImmutable(itemIDs);
        }
        /// <summary>
        /// Initialises a new instance with the given properties.
        /// </summary>
        ///
        /// <param name="currencies">A list of Currencies.</param>
        /// <param name="items">A list of Inventory Items.</param>
        public MessageRewardRedeemed(IList <MessageRewardRedeemedCurrency> currencies, IList <MessageRewardRedeemedInventory> items)
        {
            ReleaseAssert.IsNotNull(currencies, "Currencies cannot be null.");
            ReleaseAssert.IsNotNull(items, "Items cannot be null.");

            Currencies = Mutability.ToImmutable(currencies);
            Items      = Mutability.ToImmutable(items);
        }
示例#8
0
        /// <summary>
        /// Initialises a new instance of the description with the given required properties.
        /// </summary>
        ///
        /// <param name="key">The Key that identifies the leaderboard</param>
        /// <param name="chilliConnectIds">A list of ChilliConnectIDs to find scores for. Maximum 100.</param>
        public GetScoresForChilliConnectIdsRequestDesc(string key, IList <string> chilliConnectIds)
        {
            ReleaseAssert.IsNotNull(key, "Key cannot be null.");
            ReleaseAssert.IsNotNull(chilliConnectIds, "Chilli Connect Ids cannot be null.");

            Key = key;
            ChilliConnectIds = Mutability.ToImmutable(chilliConnectIds);
        }
        /// <summary>
        /// Initialises a new instance with the given required properties.
        /// </summary>
        ///
        /// <param name="key">The key of the item.</param>
        /// <param name="name">The name of the item.</param>
        /// <param name="tags">The tags of the item.</param>
        public CustomDefinitionDesc(string key, string name, IList <string> tags)
        {
            ReleaseAssert.IsNotNull(key, "Key cannot be null.");
            ReleaseAssert.IsNotNull(name, "Name cannot be null.");
            ReleaseAssert.IsNotNull(tags, "Tags cannot be null.");

            Key  = key;
            Name = name;
            Tags = Mutability.ToImmutable(tags);
        }
        /// <summary>
        /// Initialises a new instance with the given properties.
        /// </summary>
        ///
        /// <param name="name">The name of the item.</param>
        /// <param name="key">The Key of the item.</param>
        /// <param name="amount">The amount of the item exchanged.</param>
        /// <param name="itemIds">The ID's of the items that were added to removed from the player's inventory .</param>
        public PurchaseInventoryExchange(string name, string key, int amount, IList <string> itemIds)
        {
            ReleaseAssert.IsNotNull(name, "Name cannot be null.");
            ReleaseAssert.IsNotNull(key, "Key cannot be null.");
            ReleaseAssert.IsNotNull(itemIds, "Item Ids cannot be null.");

            Name    = name;
            Key     = key;
            Amount  = amount;
            ItemIds = Mutability.ToImmutable(itemIds);
        }
示例#11
0
        /// <summary>
        /// Initialises a new instance with the given required properties.
        /// </summary>
        ///
        /// <param name="key">The key of the item.</param>
        /// <param name="name">The name of the item.</param>
        /// <param name="tags">The tags of the item.</param>
        /// <param name="initialAllocation">The initial allocation of the item given to new players on creation.</param>
        public InventoryDefinitionDesc(string key, string name, IList <string> tags, int initialAllocation)
        {
            ReleaseAssert.IsNotNull(key, "Key cannot be null.");
            ReleaseAssert.IsNotNull(name, "Name cannot be null.");
            ReleaseAssert.IsNotNull(tags, "Tags cannot be null.");

            Key  = key;
            Name = name;
            Tags = Mutability.ToImmutable(tags);
            InitialAllocation = initialAllocation;
        }
示例#12
0
        /// <summary>
        /// Initialises a new instance with the given properties.
        /// </summary>
        ///
        /// <param name="url">The URL that the Package can be downloaded from.</param>
        /// <param name="checksum">The package SHA1 Checksum.</param>
        /// <param name="size">The Package size in bytes.</param>
        /// <param name="files">A list of files contained in the Package.</param>
        public ZipPackageDefinitionPackage(string url, string checksum, int size, IList <ZipPackageDefinitionPackageFile> files)
        {
            ReleaseAssert.IsNotNull(url, "Url cannot be null.");
            ReleaseAssert.IsNotNull(checksum, "Checksum cannot be null.");
            ReleaseAssert.IsNotNull(files, "Files cannot be null.");

            Url      = url;
            Checksum = checksum;
            Size     = size;
            Files    = Mutability.ToImmutable(files);
        }
        /// <summary>
        /// Initialises a new instance with the given required properties.
        /// </summary>
        ///
        /// <param name="key">The key of the item.</param>
        /// <param name="name">The name of the item.</param>
        /// <param name="tags">The tags of the item.</param>
        /// <param name="patches">A map of UnrealMobilePatch Patches keyed by the patch label. Note: Patches are
        /// keyed by label to enable future multi-patch support. Currently a single Patch is
        /// available under the label 'Default'.</param>
        public UnrealMobilePatchDefinitionDesc(string key, string name, IList <string> tags, IDictionary <string, UnrealMobilePatchDefinitionPatch> patches)
        {
            ReleaseAssert.IsNotNull(key, "Key cannot be null.");
            ReleaseAssert.IsNotNull(name, "Name cannot be null.");
            ReleaseAssert.IsNotNull(tags, "Tags cannot be null.");
            ReleaseAssert.IsNotNull(patches, "Patches cannot be null.");

            Key     = key;
            Name    = name;
            Tags    = Mutability.ToImmutable(tags);
            Patches = Mutability.ToImmutable(patches);
        }
        /// <summary>
        /// Initialises a new instance of the request with the given properties.
        /// </summary>
        ///
        /// <param name="keys">Return only items with these Keys from the player's inventory. Maximum 5.</param>
        /// <param name="connectAccessToken">A valid session AccessToken obtained through one of the login endpoints.</param>
        public GetInventoryForKeysRequest(IList <string> keys, string connectAccessToken)
        {
            ReleaseAssert.IsNotNull(keys, "Keys cannot be null.");

            ReleaseAssert.IsNotNull(connectAccessToken, "Connect Access Token cannot be null.");

            Keys = Mutability.ToImmutable(keys);
            ConnectAccessToken = connectAccessToken;

            Url = "https://connect.chilliconnect.com/2.0/economy/inventory/get/keys";
            HttpRequestMethod = HttpRequestMethod.Post;
        }
示例#15
0
        /// <summary>
        /// Initialises a new instance of the request with the given properties.
        /// </summary>
        ///
        /// <param name="keys">The Custom Data Keys for which to retrieve the values of.</param>
        /// <param name="connectAccessToken">A valid session ConnectAccessToken obtained through one of the login endpoints.</param>
        public GetPlayerDataRequest(IList <string> keys, string connectAccessToken)
        {
            ReleaseAssert.IsNotNull(keys, "Keys cannot be null.");

            ReleaseAssert.IsNotNull(connectAccessToken, "Connect Access Token cannot be null.");

            Keys = Mutability.ToImmutable(keys);
            ConnectAccessToken = connectAccessToken;

            Url = "https://connect.chilliconnect.com/1.0/data/player/get";
            HttpRequestMethod = HttpRequestMethod.Post;
        }
示例#16
0
        /// <summary>
        /// Initialises a new instance with the given required properties.
        /// </summary>
        ///
        /// <param name="key">The key of the item.</param>
        /// <param name="name">The name of the item.</param>
        /// <param name="tags">The tags of the item.</param>
        /// <param name="initial">The initial balance of the item.</param>
        /// <param name="max">The maximum balance of the item. 0 means no limit.</param>
        public CurrencyDefinitionDesc(string key, string name, IList <string> tags, int initial, int max)
        {
            ReleaseAssert.IsNotNull(key, "Key cannot be null.");
            ReleaseAssert.IsNotNull(name, "Name cannot be null.");
            ReleaseAssert.IsNotNull(tags, "Tags cannot be null.");

            Key     = key;
            Name    = name;
            Tags    = Mutability.ToImmutable(tags);
            Initial = initial;
            Max     = max;
        }
示例#17
0
        /// <summary>
        /// Initialises a new instance of the request with the given properties.
        /// </summary>
        ///
        /// <param name="properties">A set of Key-Value pairs of the Player Properties to be set or updated. Keys and
        /// Value-types are defined in Game settings.</param>
        /// <param name="connectAccessToken">A valid session ConnectAccessToken obtained through one of the login endpoints.</param>
        /// <param name="serverUrl">The server url for this call.</param>
        public SetPlayerPropertiesRequest(IDictionary <string, MultiTypeValue> properties, string connectAccessToken, string serverUrl)
        {
            ReleaseAssert.IsNotNull(properties, "Properties cannot be null.");

            ReleaseAssert.IsNotNull(connectAccessToken, "Connect Access Token cannot be null.");

            Properties         = Mutability.ToImmutable(properties);
            ConnectAccessToken = connectAccessToken;

            Url = serverUrl + "/1.0/player/properties/set";
            HttpRequestMethod = HttpRequestMethod.Post;
        }
示例#18
0
        /// <summary>
        /// Initialises a new instance with the given required properties.
        /// </summary>
        ///
        /// <param name="key">The key of the MatchType.</param>
        /// <param name="name">The name of the MatchType.</param>
        /// <param name="turnTypes">The allowed TurnTypes.</param>
        /// <param name="defaultWaitingTimeout">Amount of time a Match in WAITING State will wait before entering State TIMEOUT.</param>
        /// <param name="defaultTurnTimeout">Amount of time before the Match will enter State TIMEOUT.</param>
        public MatchTypeDefinitionDesc(string key, string name, IList <string> turnTypes, int defaultWaitingTimeout, int defaultTurnTimeout)
        {
            ReleaseAssert.IsNotNull(key, "Key cannot be null.");
            ReleaseAssert.IsNotNull(name, "Name cannot be null.");
            ReleaseAssert.IsNotNull(turnTypes, "Turn Types cannot be null.");

            Key                   = key;
            Name                  = name;
            TurnTypes             = Mutability.ToImmutable(turnTypes);
            DefaultWaitingTimeout = defaultWaitingTimeout;
            DefaultTurnTimeout    = defaultTurnTimeout;
        }
        /// <summary>
        /// Initialises a new instance of the request with the given properties.
        /// </summary>
        ///
        /// <param name="groups">A list of Push Groups that the player belongs to, up to a maximum of 10.</param>
        /// <param name="connectAccessToken">A valid session ConnectAccessToken obtained through one of the login endpoints.</param>
        public SetPushGroupsRequest(IList <string> groups, string connectAccessToken)
        {
            ReleaseAssert.IsNotNull(groups, "Groups cannot be null.");

            ReleaseAssert.IsNotNull(connectAccessToken, "Connect Access Token cannot be null.");

            Groups             = Mutability.ToImmutable(groups);
            ConnectAccessToken = connectAccessToken;

            Url = "https://connect.chilliconnect.com/1.0/push/groups";
            HttpRequestMethod = HttpRequestMethod.Post;
        }
        /// <summary>
        /// Initialises a new instance of the request with the given properties.
        /// </summary>
        ///
        /// <param name="itemIds">Return only these items witihin the player's inventory.</param>
        /// <param name="connectAccessToken">A valid session AccessToken obtained through one of the login endpoints.</param>
        public GetInventoryForItemIdsRequest(IList <string> itemIds, string connectAccessToken)
        {
            ReleaseAssert.IsNotNull(itemIds, "Item Ids cannot be null.");

            ReleaseAssert.IsNotNull(connectAccessToken, "Connect Access Token cannot be null.");

            ItemIds            = Mutability.ToImmutable(itemIds);
            ConnectAccessToken = connectAccessToken;

            Url = "https://connect.chilliconnect.com/1.0/economy/inventory/get/items";
            HttpRequestMethod = HttpRequestMethod.Post;
        }
示例#21
0
        /// <summary>
        /// Initialises a new instance of the request with the given properties.
        /// </summary>
        ///
        /// <param name="tags">An array list of Tags for the player to search for.</param>
        /// <param name="connectAccessToken">A valid session ConnectAccessToken obtained through one of the login endpoints.</param>
        public GetDlcUsingTagRequest(IList <string> tags, string connectAccessToken)
        {
            ReleaseAssert.IsNotNull(tags, "Tags cannot be null.");

            ReleaseAssert.IsNotNull(connectAccessToken, "Connect Access Token cannot be null.");

            Tags = Mutability.ToImmutable(tags);
            ConnectAccessToken = connectAccessToken;

            Url = "https://connect.chilliconnect.com/1.0/dlc/tag";
            HttpRequestMethod = HttpRequestMethod.Post;
        }
        /// <summary>
        /// Initialises a new instance of the request with the given properties.
        /// </summary>
        ///
        /// <param name="userNames">An array of UserNames to look up. Maximum 10.</param>
        /// <param name="connectAccessToken">A valid session ConnectAccessToken obtained through one of the login endpoints.</param>
        public LookupUserNamesRequest(IList <string> userNames, string connectAccessToken)
        {
            ReleaseAssert.IsNotNull(userNames, "User Names cannot be null.");

            ReleaseAssert.IsNotNull(connectAccessToken, "Connect Access Token cannot be null.");

            UserNames          = Mutability.ToImmutable(userNames);
            ConnectAccessToken = connectAccessToken;

            Url = "https://connect.chilliconnect.com/1.0/player/lookup/username";
            HttpRequestMethod = HttpRequestMethod.Post;
        }
        /// <summary>
        /// Initialises a new instance of the request with the given properties.
        /// </summary>
        ///
        /// <param name="facebookIds">An array of FacebookIDs to look up. Maximum 10.</param>
        /// <param name="connectAccessToken">A valid session ConnectAccessToken obtained through one of the login endpoints.</param>
        public LookupFacebookPlayersRequest(IList <string> facebookIds, string connectAccessToken)
        {
            ReleaseAssert.IsNotNull(facebookIds, "Facebook Ids cannot be null.");

            ReleaseAssert.IsNotNull(connectAccessToken, "Connect Access Token cannot be null.");

            FacebookIds        = Mutability.ToImmutable(facebookIds);
            ConnectAccessToken = connectAccessToken;

            Url = "https://connect.chilliconnect.com/1.0/player/lookup/facebook";
            HttpRequestMethod = HttpRequestMethod.Post;
        }
示例#24
0
        /// <summary>
        /// Initialises a new instance of the request with the given properties.
        /// </summary>
        ///
        /// <param name="events">An array of events.</param>
        /// <param name="metricsAccessToken">MetricsAccessToken as returned from a Player login call.</param>
        /// <param name="serverUrl">The server url for this call.</param>
        public AddEventsRequest(IList <MetricsEvent> events, string metricsAccessToken, string serverUrl)
        {
            ReleaseAssert.IsNotNull(events, "Events cannot be null.");

            ReleaseAssert.IsNotNull(metricsAccessToken, "Metrics Access Token cannot be null.");

            Events             = Mutability.ToImmutable(events);
            MetricsAccessToken = metricsAccessToken;

            Url = serverUrl + "/1.0/events/batch";
            HttpRequestMethod = HttpRequestMethod.Post;
        }
示例#25
0
        /// <summary>
        /// Initialises a new instance of the request with the given properties.
        /// </summary>
        ///
        /// <param name="events">An array of events.</param>
        /// <param name="metricsAccessToken">MetricsAccessToken as returned from a call to SessionStart.</param>
        public AddEventsRequest(IList <MetricsEvent> events, string metricsAccessToken)
        {
            ReleaseAssert.IsNotNull(events, "Events cannot be null.");

            ReleaseAssert.IsNotNull(metricsAccessToken, "Metrics Access Token cannot be null.");

            Events             = Mutability.ToImmutable(events);
            MetricsAccessToken = metricsAccessToken;

            Url = "https://metrics.chilliconnect.com/1.0/events/batch";
            HttpRequestMethod = HttpRequestMethod.Post;
        }
示例#26
0
        /// <summary>
        /// Initialises a new instance with the given properties.
        /// </summary>
        ///
        /// <param name="name">The file name.</param>
        /// <param name="location">The file location within the package.</param>
        /// <param name="size">The file size in bytes.</param>
        /// <param name="checksum">The file SHA1 checksum.</param>
        /// <param name="items">A list of items contained in the File.</param>
        public EconomyPackageFile(string name, string location, int size, string checksum, IList <EconomyPackageFileItem> items)
        {
            ReleaseAssert.IsNotNull(name, "Name cannot be null.");
            ReleaseAssert.IsNotNull(location, "Location cannot be null.");
            ReleaseAssert.IsNotNull(checksum, "Checksum cannot be null.");
            ReleaseAssert.IsNotNull(items, "Items cannot be null.");

            Name     = name;
            Location = location;
            Size     = size;
            Checksum = checksum;
            Items    = Mutability.ToImmutable(items);
        }
示例#27
0
        /// <summary>
        /// Initialises a new instance with the given description.
        /// </summary>
        ///
        /// <param name="desc">The description.</param>
        public MetadataDefinition(MetadataDefinitionDesc desc)
        {
            ReleaseAssert.IsNotNull(desc, "A description object cannot be null.");

            ReleaseAssert.IsNotNull(desc.Key, "Key cannot be null.");
            ReleaseAssert.IsNotNull(desc.Name, "Name cannot be null.");
            ReleaseAssert.IsNotNull(desc.Tags, "Tags cannot be null.");

            Key        = desc.Key;
            Name       = desc.Name;
            Tags       = Mutability.ToImmutable(desc.Tags);
            CustomData = desc.CustomData;
        }
        /// <summary>
        /// Initialises a new instance with the given required properties.
        /// </summary>
        ///
        /// <param name="key">The key of the item.</param>
        /// <param name="name">The name of the item.</param>
        /// <param name="tags">The tags of the item.</param>
        /// <param name="costs">Costs that are required to make a purchase.</param>
        /// <param name="rewards">Rewards that will be allocated upon purchase.</param>
        public VirtualPurchaseDefinitionDesc(string key, string name, IList <string> tags, PurchaseExchangeDefinition costs, PurchaseExchangeDefinition rewards)
        {
            ReleaseAssert.IsNotNull(key, "Key cannot be null.");
            ReleaseAssert.IsNotNull(name, "Name cannot be null.");
            ReleaseAssert.IsNotNull(tags, "Tags cannot be null.");
            ReleaseAssert.IsNotNull(costs, "Costs cannot be null.");
            ReleaseAssert.IsNotNull(rewards, "Rewards cannot be null.");

            Key     = key;
            Name    = name;
            Tags    = Mutability.ToImmutable(tags);
            Costs   = costs;
            Rewards = rewards;
        }
示例#29
0
        /// <summary>
        /// Initialises a new instance of the request with the given properties.
        /// </summary>
        ///
        /// <param name="key">The Collection Key.</param>
        /// <param name="objectIds">The ObjectIDs for which to retrieve the objects of. Maximum 20.</param>
        /// <param name="connectAccessToken">A valid session ConnectAccessToken obtained through one of the login endpoints.</param>
        /// <param name="serverUrl">The server url for this call.</param>
        public GetCollectionObjectsRequest(string key, IList <string> objectIds, string connectAccessToken, string serverUrl)
        {
            ReleaseAssert.IsNotNull(key, "Key cannot be null.");
            ReleaseAssert.IsNotNull(objectIds, "Object Ids cannot be null.");

            ReleaseAssert.IsNotNull(connectAccessToken, "Connect Access Token cannot be null.");

            Key                = key;
            ObjectIds          = Mutability.ToImmutable(objectIds);
            ConnectAccessToken = connectAccessToken;

            Url = serverUrl + "/1.0/data/collection/object/get";
            HttpRequestMethod = HttpRequestMethod.Post;
        }
        /// <summary>
        /// Initialises a new instance with the given description.
        /// </summary>
        ///
        /// <param name="desc">The description.</param>
        public InventoryDefinition(InventoryDefinitionDesc desc)
        {
            ReleaseAssert.IsNotNull(desc, "A description object cannot be null.");

            ReleaseAssert.IsNotNull(desc.Key, "Key cannot be null.");
            ReleaseAssert.IsNotNull(desc.Name, "Name cannot be null.");
            ReleaseAssert.IsNotNull(desc.Tags, "Tags cannot be null.");

            Key               = desc.Key;
            Name              = desc.Name;
            Tags              = Mutability.ToImmutable(desc.Tags);
            CustomData        = desc.CustomData;
            InitialAllocation = desc.InitialAllocation;
        }