Skip to content

Commit

Permalink
Rename ShopifyRestApiCredentials to ShopifyApiCredentials
Browse files Browse the repository at this point in the history
  • Loading branch information
nozzlegear committed Dec 15, 2023
1 parent 95289c5 commit 07f6c9a
Show file tree
Hide file tree
Showing 61 changed files with 140 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace ShopifySharp.Extensions.DependencyInjection.Tests;

public class FactoryServiceTests
{
private readonly ShopifyRestApiCredentials _credentials = new("some-shopify-domain", "some-access-token");
private readonly ShopifyApiCredentials _credentials = new("some-shopify-domain", "some-access-token");

[Fact]
public void FactoryServices_WhenRequestExecutionPolicyIsNotInjected_ShouldCreateService()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@

namespace ShopifySharp.Credentials
{
public readonly struct ShopifyRestApiCredentials(string shopDomain, string accessToken)
public readonly struct ShopifyApiCredentials(string shopDomain, string accessToken)
{
public string ShopDomain { get; } = shopDomain;
public string AccessToken { get; } = accessToken;

#if NETSTANDARD2_0
public override bool Equals(object obj)
{
return obj is ShopifyRestApiCredentials other
return obj is ShopifyApiCredentials other
&& ShopDomain == other.ShopDomain
&& AccessToken == other.AccessToken;
}
#else
public override bool Equals(object? obj)
{
return obj is ShopifyRestApiCredentials other
return obj is ShopifyApiCredentials other
&& ShopDomain == other.ShopDomain
&& AccessToken == other.AccessToken;
}
Expand All @@ -36,5 +36,15 @@ public override int GetHashCode()
return HashCode.Combine(ShopDomain, AccessToken);
#endif
}

public static bool operator ==(ShopifyApiCredentials left, ShopifyApiCredentials right)
{
return left.Equals(right);
}

public static bool operator !=(ShopifyApiCredentials left, ShopifyApiCredentials right)
{
return !(left == right);
}
}
}
10 changes: 10 additions & 0 deletions ShopifySharp/Credentials/ShopifyPartnerApiCredentials.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,15 @@ public override int GetHashCode()
return HashCode.Combine(PartnerOrganizationId, AccessToken);
#endif
}

public static bool operator ==(ShopifyPartnerApiCredentials left, ShopifyPartnerApiCredentials right)
{
return left.Equals(right);
}

public static bool operator !=(ShopifyPartnerApiCredentials left, ShopifyPartnerApiCredentials right)
{
return !(left == right);
}
}
}
4 changes: 2 additions & 2 deletions ShopifySharp/Factories/AccessScopeServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ShopifySharp.Factories;
public interface IAccessScopeServiceFactory
{
// ReSharper disable once UnusedMember.Global
IAccessScopeService Create(ShopifyRestApiCredentials credentials);
IAccessScopeService Create(ShopifyApiCredentials credentials);
}

public class AccessScopeServiceFactory(
Expand All @@ -24,7 +24,7 @@ public class AccessScopeServiceFactory(
#endif
) : IAccessScopeServiceFactory
{
public virtual IAccessScopeService Create(ShopifyRestApiCredentials credentials)
public virtual IAccessScopeService Create(ShopifyApiCredentials credentials)
{
var service = new AccessScopeService(credentials.ShopDomain, credentials.AccessToken);

Expand Down
4 changes: 2 additions & 2 deletions ShopifySharp/Factories/ApplicationCreditServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ShopifySharp.Factories;
public interface IApplicationCreditServiceFactory
{
// ReSharper disable once UnusedMember.Global
IApplicationCreditService Create(ShopifyRestApiCredentials credentials);
IApplicationCreditService Create(ShopifyApiCredentials credentials);
}

public class ApplicationCreditServiceFactory(
Expand All @@ -24,7 +24,7 @@ public class ApplicationCreditServiceFactory(
#endif
) : IApplicationCreditServiceFactory
{
public virtual IApplicationCreditService Create(ShopifyRestApiCredentials credentials)
public virtual IApplicationCreditService Create(ShopifyApiCredentials credentials)
{
var service = new ApplicationCreditService(credentials.ShopDomain, credentials.AccessToken);

Expand Down
4 changes: 2 additions & 2 deletions ShopifySharp/Factories/ArticleServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ShopifySharp.Factories;
public interface IArticleServiceFactory
{
// ReSharper disable once UnusedMember.Global
IArticleService Create(ShopifyRestApiCredentials credentials);
IArticleService Create(ShopifyApiCredentials credentials);
}

public class ArticleServiceFactory(
Expand All @@ -24,7 +24,7 @@ public class ArticleServiceFactory(
#endif
) : IArticleServiceFactory
{
public virtual IArticleService Create(ShopifyRestApiCredentials credentials)
public virtual IArticleService Create(ShopifyApiCredentials credentials)
{
var service = new ArticleService(credentials.ShopDomain, credentials.AccessToken);

Expand Down
4 changes: 2 additions & 2 deletions ShopifySharp/Factories/AssetServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ShopifySharp.Factories;
public interface IAssetServiceFactory
{
// ReSharper disable once UnusedMember.Global
IAssetService Create(ShopifyRestApiCredentials credentials);
IAssetService Create(ShopifyApiCredentials credentials);
}

public class AssetServiceFactory(
Expand All @@ -24,7 +24,7 @@ public class AssetServiceFactory(
#endif
) : IAssetServiceFactory
{
public virtual IAssetService Create(ShopifyRestApiCredentials credentials)
public virtual IAssetService Create(ShopifyApiCredentials credentials)
{
var service = new AssetService(credentials.ShopDomain, credentials.AccessToken);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ShopifySharp.Factories;
public interface IAssignedFulfillmentOrderServiceFactory
{
// ReSharper disable once UnusedMember.Global
IAssignedFulfillmentOrderService Create(ShopifyRestApiCredentials credentials);
IAssignedFulfillmentOrderService Create(ShopifyApiCredentials credentials);
}

public class AssignedFulfillmentOrderServiceFactory(
Expand All @@ -24,7 +24,7 @@ public class AssignedFulfillmentOrderServiceFactory(
#endif
) : IAssignedFulfillmentOrderServiceFactory
{
public virtual IAssignedFulfillmentOrderService Create(ShopifyRestApiCredentials credentials)
public virtual IAssignedFulfillmentOrderService Create(ShopifyApiCredentials credentials)
{
var service = new AssignedFulfillmentOrderService(credentials.ShopDomain, credentials.AccessToken);

Expand Down
4 changes: 2 additions & 2 deletions ShopifySharp/Factories/BlogServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ShopifySharp.Factories;
public interface IBlogServiceFactory
{
// ReSharper disable once UnusedMember.Global
IBlogService Create(ShopifyRestApiCredentials credentials);
IBlogService Create(ShopifyApiCredentials credentials);
}

public class BlogServiceFactory(
Expand All @@ -24,7 +24,7 @@ public class BlogServiceFactory(
#endif
) : IBlogServiceFactory
{
public virtual IBlogService Create(ShopifyRestApiCredentials credentials)
public virtual IBlogService Create(ShopifyApiCredentials credentials)
{
var service = new BlogService(credentials.ShopDomain, credentials.AccessToken);

Expand Down
4 changes: 2 additions & 2 deletions ShopifySharp/Factories/CancellationRequestServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ShopifySharp.Factories;
public interface ICancellationRequestServiceFactory
{
// ReSharper disable once UnusedMember.Global
ICancellationRequestService Create(ShopifyRestApiCredentials credentials);
ICancellationRequestService Create(ShopifyApiCredentials credentials);
}

public class CancellationRequestServiceFactory(
Expand All @@ -24,7 +24,7 @@ public class CancellationRequestServiceFactory(
#endif
) : ICancellationRequestServiceFactory
{
public virtual ICancellationRequestService Create(ShopifyRestApiCredentials credentials)
public virtual ICancellationRequestService Create(ShopifyApiCredentials credentials)
{
var service = new CancellationRequestService(credentials.ShopDomain, credentials.AccessToken);

Expand Down
4 changes: 2 additions & 2 deletions ShopifySharp/Factories/CarrierServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ShopifySharp.Factories;
public interface ICarrierServiceFactory
{
// ReSharper disable once UnusedMember.Global
ICarrierService Create(ShopifyRestApiCredentials credentials);
ICarrierService Create(ShopifyApiCredentials credentials);
}

public class CarrierServiceFactory(
Expand All @@ -24,7 +24,7 @@ public class CarrierServiceFactory(
#endif
) : ICarrierServiceFactory
{
public virtual ICarrierService Create(ShopifyRestApiCredentials credentials)
public virtual ICarrierService Create(ShopifyApiCredentials credentials)
{
var service = new CarrierService(credentials.ShopDomain, credentials.AccessToken);

Expand Down
4 changes: 2 additions & 2 deletions ShopifySharp/Factories/ChargeServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ShopifySharp.Factories;
public interface IChargeServiceFactory
{
// ReSharper disable once UnusedMember.Global
IChargeService Create(ShopifyRestApiCredentials credentials);
IChargeService Create(ShopifyApiCredentials credentials);
}

public class ChargeServiceFactory(
Expand All @@ -24,7 +24,7 @@ public class ChargeServiceFactory(
#endif
) : IChargeServiceFactory
{
public virtual IChargeService Create(ShopifyRestApiCredentials credentials)
public virtual IChargeService Create(ShopifyApiCredentials credentials)
{
var service = new ChargeService(credentials.ShopDomain, credentials.AccessToken);

Expand Down
4 changes: 2 additions & 2 deletions ShopifySharp/Factories/CheckoutSalesChannelServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ShopifySharp.Factories;
public interface ICheckoutSalesChannelServiceFactory
{
// ReSharper disable once UnusedMember.Global
ICheckoutSalesChannelService Create(ShopifyRestApiCredentials credentials);
ICheckoutSalesChannelService Create(ShopifyApiCredentials credentials);
}

public class CheckoutSalesChannelServiceFactory(
Expand All @@ -24,7 +24,7 @@ public class CheckoutSalesChannelServiceFactory(
#endif
) : ICheckoutSalesChannelServiceFactory
{
public virtual ICheckoutSalesChannelService Create(ShopifyRestApiCredentials credentials)
public virtual ICheckoutSalesChannelService Create(ShopifyApiCredentials credentials)
{
var service = new CheckoutSalesChannelService(credentials.ShopDomain, credentials.AccessToken);

Expand Down
4 changes: 2 additions & 2 deletions ShopifySharp/Factories/CheckoutServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ShopifySharp.Factories;
public interface ICheckoutServiceFactory
{
// ReSharper disable once UnusedMember.Global
ICheckoutService Create(ShopifyRestApiCredentials credentials);
ICheckoutService Create(ShopifyApiCredentials credentials);
}

public class CheckoutServiceFactory(
Expand All @@ -24,7 +24,7 @@ public class CheckoutServiceFactory(
#endif
) : ICheckoutServiceFactory
{
public virtual ICheckoutService Create(ShopifyRestApiCredentials credentials)
public virtual ICheckoutService Create(ShopifyApiCredentials credentials)
{
var service = new CheckoutService(credentials.ShopDomain, credentials.AccessToken);

Expand Down
4 changes: 2 additions & 2 deletions ShopifySharp/Factories/CollectServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ShopifySharp.Factories;
public interface ICollectServiceFactory
{
// ReSharper disable once UnusedMember.Global
ICollectService Create(ShopifyRestApiCredentials credentials);
ICollectService Create(ShopifyApiCredentials credentials);
}

public class CollectServiceFactory(
Expand All @@ -24,7 +24,7 @@ public class CollectServiceFactory(
#endif
) : ICollectServiceFactory
{
public virtual ICollectService Create(ShopifyRestApiCredentials credentials)
public virtual ICollectService Create(ShopifyApiCredentials credentials)
{
var service = new CollectService(credentials.ShopDomain, credentials.AccessToken);

Expand Down
4 changes: 2 additions & 2 deletions ShopifySharp/Factories/CollectionListingServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ShopifySharp.Factories;
public interface ICollectionListingServiceFactory
{
// ReSharper disable once UnusedMember.Global
ICollectionListingService Create(ShopifyRestApiCredentials credentials);
ICollectionListingService Create(ShopifyApiCredentials credentials);
}

public class CollectionListingServiceFactory(
Expand All @@ -24,7 +24,7 @@ public class CollectionListingServiceFactory(
#endif
) : ICollectionListingServiceFactory
{
public virtual ICollectionListingService Create(ShopifyRestApiCredentials credentials)
public virtual ICollectionListingService Create(ShopifyApiCredentials credentials)
{
var service = new CollectionListingService(credentials.ShopDomain, credentials.AccessToken);

Expand Down
4 changes: 2 additions & 2 deletions ShopifySharp/Factories/CollectionServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ShopifySharp.Factories;
public interface ICollectionServiceFactory
{
// ReSharper disable once UnusedMember.Global
ICollectionService Create(ShopifyRestApiCredentials credentials);
ICollectionService Create(ShopifyApiCredentials credentials);
}

public class CollectionServiceFactory(
Expand All @@ -24,7 +24,7 @@ public class CollectionServiceFactory(
#endif
) : ICollectionServiceFactory
{
public virtual ICollectionService Create(ShopifyRestApiCredentials credentials)
public virtual ICollectionService Create(ShopifyApiCredentials credentials)
{
var service = new CollectionService(credentials.ShopDomain, credentials.AccessToken);

Expand Down
4 changes: 2 additions & 2 deletions ShopifySharp/Factories/CountryServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ShopifySharp.Factories;
public interface ICountryServiceFactory
{
// ReSharper disable once UnusedMember.Global
ICountryService Create(ShopifyRestApiCredentials credentials);
ICountryService Create(ShopifyApiCredentials credentials);
}

public class CountryServiceFactory(
Expand All @@ -24,7 +24,7 @@ public class CountryServiceFactory(
#endif
) : ICountryServiceFactory
{
public virtual ICountryService Create(ShopifyRestApiCredentials credentials)
public virtual ICountryService Create(ShopifyApiCredentials credentials)
{
var service = new CountryService(credentials.ShopDomain, credentials.AccessToken);

Expand Down
4 changes: 2 additions & 2 deletions ShopifySharp/Factories/CustomCollectionServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ShopifySharp.Factories;
public interface ICustomCollectionServiceFactory
{
// ReSharper disable once UnusedMember.Global
ICustomCollectionService Create(ShopifyRestApiCredentials credentials);
ICustomCollectionService Create(ShopifyApiCredentials credentials);
}

public class CustomCollectionServiceFactory(
Expand All @@ -24,7 +24,7 @@ public class CustomCollectionServiceFactory(
#endif
) : ICustomCollectionServiceFactory
{
public virtual ICustomCollectionService Create(ShopifyRestApiCredentials credentials)
public virtual ICustomCollectionService Create(ShopifyApiCredentials credentials)
{
var service = new CustomCollectionService(credentials.ShopDomain, credentials.AccessToken);

Expand Down
4 changes: 2 additions & 2 deletions ShopifySharp/Factories/CustomerAddressServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ShopifySharp.Factories;
public interface ICustomerAddressServiceFactory
{
// ReSharper disable once UnusedMember.Global
ICustomerAddressService Create(ShopifyRestApiCredentials credentials);
ICustomerAddressService Create(ShopifyApiCredentials credentials);
}

public class CustomerAddressServiceFactory(
Expand All @@ -24,7 +24,7 @@ public class CustomerAddressServiceFactory(
#endif
) : ICustomerAddressServiceFactory
{
public virtual ICustomerAddressService Create(ShopifyRestApiCredentials credentials)
public virtual ICustomerAddressService Create(ShopifyApiCredentials credentials)
{
var service = new CustomerAddressService(credentials.ShopDomain, credentials.AccessToken);

Expand Down
4 changes: 2 additions & 2 deletions ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ShopifySharp.Factories;
public interface ICustomerSavedSearchServiceFactory
{
// ReSharper disable once UnusedMember.Global
ICustomerSavedSearchService Create(ShopifyRestApiCredentials credentials);
ICustomerSavedSearchService Create(ShopifyApiCredentials credentials);
}

public class CustomerSavedSearchServiceFactory(
Expand All @@ -24,7 +24,7 @@ public class CustomerSavedSearchServiceFactory(
#endif
) : ICustomerSavedSearchServiceFactory
{
public virtual ICustomerSavedSearchService Create(ShopifyRestApiCredentials credentials)
public virtual ICustomerSavedSearchService Create(ShopifyApiCredentials credentials)
{
var service = new CustomerSavedSearchService(credentials.ShopDomain, credentials.AccessToken);

Check warning on line 29 in ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs

View workflow job for this annotation

GitHub Actions / Build

'CustomerSavedSearchService' is obsolete: 'Customer saved searches were deprecated in version 2022-04. Use the GraphQL customer Segment object instead.'

Check warning on line 29 in ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs

View workflow job for this annotation

GitHub Actions / Build

'CustomerSavedSearchService' is obsolete: 'Customer saved searches were deprecated in version 2022-04. Use the GraphQL customer Segment object instead.'

Check warning on line 29 in ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs

View workflow job for this annotation

GitHub Actions / Build

'CustomerSavedSearchService' is obsolete: 'Customer saved searches were deprecated in version 2022-04. Use the GraphQL customer Segment object instead.'

Check warning on line 29 in ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs

View workflow job for this annotation

GitHub Actions / Build

'CustomerSavedSearchService' is obsolete: 'Customer saved searches were deprecated in version 2022-04. Use the GraphQL customer Segment object instead.'

Check warning on line 29 in ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs

View workflow job for this annotation

GitHub Actions / Build

'CustomerSavedSearchService' is obsolete: 'Customer saved searches were deprecated in version 2022-04. Use the GraphQL customer Segment object instead.'

Check warning on line 29 in ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs

View workflow job for this annotation

GitHub Actions / Build

'CustomerSavedSearchService' is obsolete: 'Customer saved searches were deprecated in version 2022-04. Use the GraphQL customer Segment object instead.'

Check warning on line 29 in ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs

View workflow job for this annotation

GitHub Actions / Build

'CustomerSavedSearchService' is obsolete: 'Customer saved searches were deprecated in version 2022-04. Use the GraphQL customer Segment object instead.'

Check warning on line 29 in ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs

View workflow job for this annotation

GitHub Actions / Build

'CustomerSavedSearchService' is obsolete: 'Customer saved searches were deprecated in version 2022-04. Use the GraphQL customer Segment object instead.'

Check warning on line 29 in ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs

View workflow job for this annotation

GitHub Actions / Build

'CustomerSavedSearchService' is obsolete: 'Customer saved searches were deprecated in version 2022-04. Use the GraphQL customer Segment object instead.'

Check warning on line 29 in ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs

View workflow job for this annotation

GitHub Actions / Build

'CustomerSavedSearchService' is obsolete: 'Customer saved searches were deprecated in version 2022-04. Use the GraphQL customer Segment object instead.'

Check warning on line 29 in ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs

View workflow job for this annotation

GitHub Actions / Unit tests

'CustomerSavedSearchService' is obsolete: 'Customer saved searches were deprecated in version 2022-04. Use the GraphQL customer Segment object instead.'

Check warning on line 29 in ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs

View workflow job for this annotation

GitHub Actions / Unit tests

'CustomerSavedSearchService' is obsolete: 'Customer saved searches were deprecated in version 2022-04. Use the GraphQL customer Segment object instead.'

Check warning on line 29 in ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs

View workflow job for this annotation

GitHub Actions / Unit tests

'CustomerSavedSearchService' is obsolete: 'Customer saved searches were deprecated in version 2022-04. Use the GraphQL customer Segment object instead.'

Check warning on line 29 in ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs

View workflow job for this annotation

GitHub Actions / Unit tests

'CustomerSavedSearchService' is obsolete: 'Customer saved searches were deprecated in version 2022-04. Use the GraphQL customer Segment object instead.'

Expand Down
Loading

0 comments on commit 07f6c9a

Please sign in to comment.