Skip to content

everyday-as/gmodstore-csharp-sdk

Repository files navigation

Everyday.GmodStore.Sdk - the C# library for the GmodStore API

Welcome to the GmodStore API! You can use our API to access GmodStore API endpoints, which can be used interact with GmodStore programmatically.

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.2.0
  • SDK version: 3.1.0
  • Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen For more information, please visit https://docs.gmodstore.com

Frameworks supported

  • .NET Core >=1.0
  • .NET Framework >=4.6
  • Mono/Xamarin >=vNext

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.

Installation

Generate the DLL using your preferred tool (e.g. dotnet build)

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using Everyday.GmodStore.Sdk.Api;
using Everyday.GmodStore.Sdk.Client;
using Everyday.GmodStore.Sdk.Model;

Usage

To use the API client with a HTTP proxy, setup a System.Net.WebProxy

Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using Everyday.GmodStore.Sdk.Api;
using Everyday.GmodStore.Sdk.Client;
using Everyday.GmodStore.Sdk.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration config = new Configuration();
            config.BasePath = "https://api.gmodstore.com/v2";
            // Configure Bearer token for authorization: bearerAuth
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new AddonCouponsApi(config);
            var addonId = 789;  // long | Id of the addon
            var addonCoupon = new AddonCoupon(); // AddonCoupon | 
            var with = new List<string>(); // List<string> | The relations you want to fetch with the `AddonCoupon` (optional) 

            try
            {
                // Create an addon coupon
                AddonCouponResponse result = apiInstance.CreateAddonCoupon(addonId, addonCoupon, with);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling AddonCouponsApi.CreateAddonCoupon: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://api.gmodstore.com/v2

Class Method HTTP request Description
AddonCouponsApi CreateAddonCoupon POST /addons/{addon_id}/coupons Create an addon coupon
AddonCouponsApi DeleteAddonCoupon DELETE /addons/{addon_id}/coupons/{coupon_id} Destroy an addon's coupon
AddonCouponsApi GetAddonCoupon GET /addons/{addon_id}/coupons/{coupon_id} Fetch an addon's coupon
AddonCouponsApi ListAddonCoupons GET /addons/{addon_id}/coupons Fetch all the coupons for an addon
AddonCouponsApi UpdateAddonCoupon PUT /addons/{addon_id}/coupons/{coupon_id} Update an addon's coupon
AddonPurchasesApi CreateAddonPurchase POST /addons/{addon_id}/purchases Create a purchase for an addon
AddonPurchasesApi GetAddonPurchase GET /addons/{addon_id}/purchases/{user_id} Get a purchase of an addon by user
AddonPurchasesApi ListAddonPurchases GET /addons/{addon_id}/purchases Fetch all purchases of an addon
AddonPurchasesApi UpdateAddonPurchase PUT /addons/{addon_id}/purchases/{user_id} Update a purchase for an addon
AddonReviewsApi GetAddonReview GET /addons/{addon_id}/reviews/{review_id} Fetch a review of an addon
AddonReviewsApi ListAddonReviews GET /addons/{addon_id}/reviews Fetch all the reviews of an addon
AddonStatsApi GetAddonStats GET /addons/{addon_id}/stats Fetch all the stats for an addon
AddonVersionsApi CreateAddonVersion POST /addons/{addon_id}/versions Create a new version for an addon
AddonVersionsApi DownloadAddonVersion GET /addons/{addon_id}/versions/{version_id}/download Generate a download token for a specific version of an addon
AddonVersionsApi GetAddonVersion GET /addons/{addon_id}/versions/{version_id} Fetch a specific version of an addon
AddonVersionsApi ListAddonVersions GET /addons/{addon_id}/versions Fetch all the versions of an addon
AddonVersionsApi UpdateAddonVersion PUT /addons/{addon_id}/versions/{version_id} Update a version of an addon
AddonsApi GetAddon GET /addons/{addon_id} Fetch a single addon
AddonsApi ListSelfAddons GET /addons Fetch all the addons that you have access to
AdventCalendarApi GetAdventCalendarStats GET /events/advent-calendar/stats Fetch statistics relating to the advent calendar event
CurrentAPIKeyApi GetCurrentApiKey GET /me Get meta information about the current API key
PermissionGroupsApi ListPermissionGroups GET /permission-groups Fetches all available permission groups
TeamAddonsApi ListTeamAddons GET /teams/{team_id}/addons Fetch all the addons in the given team
TeamUsersApi ListTeamUsers GET /teams/{team_id}/users Fetch all the users in the given team
TeamsApi GetTeam GET /teams/{team_id} Fetch a single team
UserAddonsApi ListUserAddons GET /users/{user_id}/addons Fetch all the addons authored / co-authored by a user
UserBadgesApi CreateUserBadge POST /users/{user_id}/badges Give a user a badge
UserBadgesApi DeleteUserBadge DELETE /users/{user_id}/badges/{badge_id} Destroy a users's badge
UserBadgesApi ListUserBadges GET /users/{user_id}/badges Fetch all the badges a user has
UserBansApi ListUserBans GET /users/{user_id}/bans Fetch all active bans associated with this user
UserPurchasesApi ListUserPurchases GET /users/{user_id}/purchases Fetch all purchases a user has made
UserTeamsApi ListUserTeams GET /users/{user_id}/teams Fetch all the teams of a user
UsersApi GetSelfUser GET /users/me Fetches the current user (API Key Owner)
UsersApi GetUser GET /users/{user_id} Fetch a single user

Documentation for Models

Documentation for Authorization

bearerAuth

  • Type: Bearer Authentication