Coverage for mindsdb / integrations / handlers / shopify_handler / models / common.py: 0%

64 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-01-21 00:36 +0000

1from enum import Enum 

2 

3 

4class AliasesEnum(Enum): 

5 """A class to represent a Shopify GraphQL resource. 

6 It adds easy method to get the aliases of the Enum class. 

7 """ 

8 

9 @classmethod 

10 def aliases(cls): 

11 return ((name, field.value) for name, field in cls.__members__.items()) 

12 

13 

14class Count(AliasesEnum): 

15 """A class to represent a Shopify GraphQL count. 

16 Reference: https://shopify.dev/docs/api/admin-graphql/latest/objects/Count 

17 """ 

18 

19 count = "count" 

20 precision = "precision" 

21 

22 

23class TaxonomyAttribute(AliasesEnum): 

24 """A class to represent a Shopify GraphQL taxonomy attribute. 

25 Reference: https://shopify.dev/docs/api/admin-graphql/latest/objects/TaxonomyAttribute 

26 """ 

27 

28 id = "id" 

29 

30 

31class TaxonomyChoiceListAttribute(AliasesEnum): 

32 """A class to represent a Shopify GraphQL taxonomy choice list attribute. 

33 Reference: https://shopify.dev/docs/api/admin-graphql/latest/objects/TaxonomyChoiceListAttribute 

34 """ 

35 

36 id = "id" 

37 name = "name" 

38 # values = Nodes() 

39 

40 

41class TaxonomyMeasurementAttribute(AliasesEnum): 

42 """A class to represent a Shopify GraphQL taxonomy measurement attribute. 

43 Reference: https://shopify.dev/docs/api/admin-graphql/latest/objects/TaxonomyMeasurementAttribute 

44 """ 

45 

46 id = "id" 

47 name = "name" 

48 # options = Attribute 

49 

50 

51class SEO(AliasesEnum): 

52 """A class to represent a Shopify GraphQL SEO. 

53 Reference: https://shopify.dev/docs/api/admin-graphql/latest/objects/SEO 

54 """ 

55 

56 description = "description" 

57 title = "title" 

58 

59 

60class TaxonomyCategory(AliasesEnum): 

61 """A class to represent a Shopify GraphQL taxonomy category. 

62 Reference: https://shopify.dev/docs/api/admin-graphql/latest/objects/TaxonomyCategory 

63 """ 

64 

65 ancestorIds = "ancestorIds" 

66 # attributes = Nodes(TaxonomyCategoryAttributeConnection) 

67 childrenIds = "childrenIds" 

68 fullName = "fullName" 

69 id = "id" 

70 name = "name" 

71 

72 

73class MoneyV2(AliasesEnum): 

74 """A class to represent a Shopify GraphQL money v2. 

75 Reference: https://shopify.dev/docs/api/admin-graphql/latest/objects/MoneyV2 

76 """ 

77 

78 amount = "amount" 

79 currencyCode = "currencyCode" 

80 

81 

82class ProductPriceRangeV2(AliasesEnum): 

83 """A class to represent a Shopify GraphQL product price range v2. 

84 Reference: https://shopify.dev/docs/api/admin-graphql/latest/objects/ProductPriceRangeV2 

85 Require `read_products` permission. 

86 """ 

87 

88 maxVariantPrice = MoneyV2 

89 minVariantPrice = MoneyV2 

90 

91 

92class ProductCompareAtPriceRange(AliasesEnum): 

93 """A class to represent a Shopify GraphQL product compare at price range. 

94 Reference: https://shopify.dev/docs/api/admin-graphql/latest/objects/ProductCompareAtPriceRange 

95 Require `read_products` permission. 

96 """ 

97 

98 maxVariantCompareAtPrice = MoneyV2 

99 minVariantCompareAtPrice = MoneyV2 

100 

101 

102class CollectionConnection(AliasesEnum): 

103 """A class to represent a Shopify GraphQL collection connection short. 

104 Reference: https://shopify.dev/docs/api/storefront/latest/connections/collectionconnection 

105 Just a subset of fields. 

106 """ 

107 

108 id = "id" 

109 title = "title" 

110 

111 

112class MailingAddress(AliasesEnum): 

113 """A class to represent a Shopify GraphQL mailing address. 

114 Reference: https://shopify.dev/docs/api/admin-graphql/latest/objects/MailingAddress 

115 """ 

116 

117 address1 = "address1" 

118 address2 = "address2" 

119 city = "city" 

120 company = "company" 

121 coordinatesValidated = "coordinatesValidated" 

122 country = "country" 

123 countryCodeV2 = "countryCodeV2" 

124 firstName = "firstName" 

125 formatted = "formatted" 

126 formattedArea = "formattedArea" 

127 id = "id" 

128 lastName = "lastName" 

129 latitude = "latitude" 

130 longitude = "longitude" 

131 name = "name" 

132 phone = "phone" 

133 province = "province" 

134 provinceCode = "provinceCode" 

135 timeZone = "timeZone" 

136 validationResultSummary = "validationResultSummary" 

137 zip = "zip" 

138 

139 

140class OrderCancellation(AliasesEnum): 

141 """A class to represent a Shopify GraphQL order cancellation. 

142 Reference: https://shopify.dev/docs/api/admin-graphql/latest/objects/OrderCancellation 

143 Require `read_orders` permission. 

144 """ 

145 

146 staffNote = "staffNote" 

147 

148 

149class MoneyBag(AliasesEnum): 

150 """A class to represent a Shopify GraphQL money bag. 

151 Reference: https://shopify.dev/docs/api/admin-graphql/latest/objects/MoneyBag 

152 """ 

153 

154 presentmentMoney = MoneyV2 

155 shopMoney = MoneyV2