예제 #1
0
        public OneSignalClient(string apiKey)
        {
            _apiKey = apiKey;

            // Configure the Http Client
            HttpClient = new HttpClient
            {
                BaseAddress = new Uri(ApiEndpoint)
            };
            HttpClient.DefaultRequestHeaders.Add("authorization", $"Basic {_apiKey}");

            // Initialize the endpoints
            Apps            = new AppsEndpoint(this);
            DevicesEndpoint = new DevicesEndpoint(this);
            Notifications   = new NotificationsEndpoint(this);
        }
예제 #2
0
 public static SandboxesClient FromRequest(HttpRequestMessage requestMessage, AppsEndpoint endpoint,
     ProductInfoHeaderValue userAgent)
     => new SandboxesClient(endpoint, requestMessage.GetCredentials(), userAgent);
예제 #3
0
 public SandboxesClient(AppsEndpoint endpoint, VtexCredentials credentials, ProductInfoHeaderValue userAgent)
     : this(new HttpCachedGalleryConnector(endpoint.GetUri(), credentials, userAgent))
 {
 }
예제 #4
0
 public static WorkspaceAppsClient FromRequest(HttpRequestMessage requestMessage, AppsEndpoint endpoint,
     ProductInfoHeaderValue userAgent)
     => new WorkspaceAppsClient(
         endpoint, requestMessage.GetCredentials(), userAgent, requestMessage.ShouldAcceptSnapshot());
예제 #5
0
 public WorkspaceAppsClient(AppsEndpoint endpoint, VtexCredentials credentials, ProductInfoHeaderValue userAgent,
     bool acceptSnapshot = true)
     : this(new HttpCachedGalleryConnector(endpoint.GetUri(), credentials, userAgent), acceptSnapshot)
 {
 }