예제 #1
0
        /// <summary>
        /// Update the metadata of the leaderboard configuration with the given ID.
        /// Documentation https://developers.google.com/gamesconfiguration/v1configuration/reference/leaderboardConfigurations/update
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Gamesconfiguration service.</param>
        /// <param name="leaderboardId">The ID of the leaderboard.</param>
        /// <param name="body">A valid Gamesconfiguration v1configuration body.</param>
        /// <returns>LeaderboardConfigurationResponse</returns>
        public static LeaderboardConfiguration Update(GamesconfigurationService service, string leaderboardId, LeaderboardConfiguration body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (leaderboardId == null)
                {
                    throw new ArgumentNullException(leaderboardId);
                }

                // Make the request.
                return(service.LeaderboardConfigurations.Update(body, leaderboardId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request LeaderboardConfigurations.Update failed.", ex);
            }
        }
        /// <summary>
        /// Update the metadata of the achievement configuration with the given ID.
        /// Documentation https://developers.google.com/gamesconfiguration/v1configuration/reference/achievementConfigurations/update
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Gamesconfiguration service.</param>
        /// <param name="achievementId">The ID of the achievement used by this method.</param>
        /// <param name="body">A valid Gamesconfiguration v1configuration body.</param>
        /// <returns>AchievementConfigurationResponse</returns>
        public static AchievementConfiguration Update(GamesconfigurationService service, string achievementId, AchievementConfiguration body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (achievementId == null)
                {
                    throw new ArgumentNullException(achievementId);
                }

                // Make the request.
                return(service.AchievementConfigurations.Update(body, achievementId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request AchievementConfigurations.Update failed.", ex);
            }
        }
예제 #3
0
        /// <summary>
        /// Returns a list of the leaderboard configurations in this application.
        /// Documentation https://developers.google.com/gamesconfiguration/v1configuration/reference/leaderboardConfigurations/list
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Gamesconfiguration service.</param>
        /// <param name="applicationId">The application ID from the Google Play developer console.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>LeaderboardConfigurationListResponseResponse</returns>
        public static LeaderboardConfigurationListResponse List(GamesconfigurationService service, string applicationId, LeaderboardConfigurationsListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (applicationId == null)
                {
                    throw new ArgumentNullException(applicationId);
                }

                // Building the initial request.
                var request = service.LeaderboardConfigurations.List(applicationId);

                // Applying optional parameters to the request.
                request = (LeaderboardConfigurationsResource.ListRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request LeaderboardConfigurations.List failed.", ex);
            }
        }
예제 #4
0
        /// <summary>
        /// Uploads an image for a resource with the given ID and image type.
        /// Documentation https://developers.google.com/gamesconfiguration/v1configuration/reference/imageConfigurations/upload
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Gamesconfiguration service.</param>
        /// <param name="resourceId">The ID of the resource used by this method.</param>
        /// <param name="imageType">Selects which image in a resource for this method.</param>
        /// <returns>ImageConfigurationResponse</returns>
        public static ImageConfiguration Upload(GamesconfigurationService service, string resourceId, string imageType)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (resourceId == null)
                {
                    throw new ArgumentNullException(resourceId);
                }
                if (imageType == null)
                {
                    throw new ArgumentNullException(imageType);
                }

                // Make the request.
                return(service.ImageConfigurations.Upload(resourceId, imageType).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request ImageConfigurations.Upload failed.", ex);
            }
        }
예제 #5
0
        /// <summary>
        /// Delete the leaderboard configuration with the given ID.
        /// Documentation https://developers.google.com/gamesconfiguration/v1configuration/reference/leaderboardConfigurations/delete
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Gamesconfiguration service.</param>
        /// <param name="leaderboardId">The ID of the leaderboard.</param>
        public static void Delete(GamesconfigurationService service, string leaderboardId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (leaderboardId == null)
                {
                    throw new ArgumentNullException(leaderboardId);
                }

                // Make the request.
                service.LeaderboardConfigurations.Delete(leaderboardId).Execute();
            }
            catch (Exception ex)
            {
                throw new Exception("Request LeaderboardConfigurations.Delete failed.", ex);
            }
        }