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); }
public static SandboxesClient FromRequest(HttpRequestMessage requestMessage, AppsEndpoint endpoint, ProductInfoHeaderValue userAgent) => new SandboxesClient(endpoint, requestMessage.GetCredentials(), userAgent);
public SandboxesClient(AppsEndpoint endpoint, VtexCredentials credentials, ProductInfoHeaderValue userAgent) : this(new HttpCachedGalleryConnector(endpoint.GetUri(), credentials, userAgent)) { }
public static WorkspaceAppsClient FromRequest(HttpRequestMessage requestMessage, AppsEndpoint endpoint, ProductInfoHeaderValue userAgent) => new WorkspaceAppsClient( endpoint, requestMessage.GetCredentials(), userAgent, requestMessage.ShouldAcceptSnapshot());
public WorkspaceAppsClient(AppsEndpoint endpoint, VtexCredentials credentials, ProductInfoHeaderValue userAgent, bool acceptSnapshot = true) : this(new HttpCachedGalleryConnector(endpoint.GetUri(), credentials, userAgent), acceptSnapshot) { }