-
-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #891 from nozzlegear/service-interfaces
- Loading branch information
Showing
125 changed files
with
3,997 additions
and
2,933 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:Boolean x:Key="/Default/CodeEditing/SuppressUninitializedWarningFix/Enabled/@EntryValue">False</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=fulfillments/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=metafield/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=myshopify/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,26 @@ | ||
using System.Collections.Generic; | ||
using System.Net.Http; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using System.Threading; | ||
|
||
namespace ShopifySharp | ||
{ | ||
/// <summary> | ||
/// A service for getting the access scopes associated with the access token | ||
/// </summary> | ||
public class AccessScopeService : ShopifyService | ||
public class AccessScopeService : ShopifyService, IAccessScopeService | ||
{ | ||
//oauth endpoints don't support versioning | ||
protected override bool SupportsAPIVersioning => false; | ||
|
||
/// <summary> | ||
/// Creates a new instance of the service. | ||
/// </summary> | ||
/// <param name="myShopifyUrl">The shop's *.myshopify.com URL.</param> | ||
/// <param name="shopAccessToken">An API access token for the shop.</param> | ||
public AccessScopeService(string myShopifyUrl, string shopAccessToken) : base(myShopifyUrl, shopAccessToken) { } | ||
|
||
//oauth endpoints don't support versioning | ||
protected override bool SupportsAPIVersioning => false; | ||
|
||
/// <summary> | ||
/// Retrieves a list of access scopes associated to the access token. | ||
/// </summary> | ||
public virtual async Task<IEnumerable<AccessScope>> ListAsync(CancellationToken cancellationToken = default) | ||
{ | ||
return await ExecuteGetAsync<IEnumerable<AccessScope>>("oauth/access_scopes.json", "access_scopes", cancellationToken: cancellationToken); | ||
} | ||
/// <inheritdoc /> | ||
public virtual async Task<IEnumerable<AccessScope>> ListAsync(CancellationToken cancellationToken = default) => | ||
await ExecuteGetAsync<IEnumerable<AccessScope>>("oauth/access_scopes.json", "access_scopes", cancellationToken: cancellationToken); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace ShopifySharp | ||
{ | ||
public interface IAccessScopeService : IShopifyService | ||
{ | ||
/// <summary> | ||
/// Retrieves a list of access scopes associated to the access token. | ||
/// </summary> | ||
Task<IEnumerable<AccessScope>> ListAsync(CancellationToken cancellationToken = default); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
ShopifySharp/Services/ApplicationCredit/IApplicationCreditService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using ShopifySharp.Filters; | ||
using ShopifySharp.Lists; | ||
|
||
namespace ShopifySharp | ||
{ | ||
public interface IApplicationCreditService : IShopifyService | ||
{ | ||
/// <summary> | ||
/// Gets a list of all past and present application credits. | ||
/// </summary> | ||
Task<ListResult<ApplicationCredit>> ListAsync(ListFilter<ApplicationCredit> filter, CancellationToken cancellationToken = default); | ||
|
||
/// <summary> | ||
/// Gets a list of all past and present application credits. | ||
/// </summary> | ||
Task<ListResult<ApplicationCredit>> ListAsync(ApplicationCreditListFilter filter, CancellationToken cancellationToken = default); | ||
|
||
/// <summary> | ||
/// Retrieves the application credit with the given id. | ||
/// </summary> | ||
/// <param name="id">The application credit's id.</param> | ||
/// <param name="fields">A comma-separated list of fields to include in the response.</param> | ||
/// <param name="cancellationToken">Cancellation Token</param> | ||
Task<ApplicationCredit> GetAsync(long id, string fields = null, CancellationToken cancellationToken = default); | ||
|
||
/// <summary> | ||
/// Creates a new <see cref="ApplicationCredit"/>. | ||
/// </summary> | ||
/// <param name="credit">A new <see cref="ApplicationCredit"/>. Id should be set to null.</param> | ||
/// <param name="cancellationToken">Cancellation Token</param> | ||
Task<ApplicationCredit> CreateAsync(ApplicationCredit credit, CancellationToken cancellationToken = default); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.