Passed
Push — main ( 6e8bbe...6c1cc7 )
by Acho
01:10
created

stubs.VariantsListResponse   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
package stubs
2
3
// VariantGetResponse is a dummy response to the GET /v1/variants/:id endpoint
4
func VariantGetResponse() []byte {
5
	return []byte(`
6
{
7
  "jsonapi": {
8
    "version": "1.0"
9
  },
10
  "links": {
11
    "self": "https://api.lemonsqueezy.com/v1/variants/1"
12
  },
13
  "data": {
14
    "type": "variants",
15
    "id": "1",
16
    "attributes": {
17
      "product_id": 1,
18
      "name": "Example Variant",
19
      "slug": "46beb127-a8a9-33e6-89b5-078505657239",
20
      "description": "<p>Lorem ipsum...</p>",
21
      "price": 999,
22
      "is_subscription": false,
23
      "interval": null,
24
      "interval_count": null,
25
      "has_free_trial": false,
26
      "trial_interval": "day",
27
      "trial_interval_count": 30,
28
      "pay_what_you_want": false,
29
      "min_price": 0,
30
      "suggested_price": 0,
31
      "has_license_keys": false,
32
      "license_activation_limit": 5,
33
      "is_license_limit_unlimited": false,
34
      "license_length_value": 1,
35
      "license_length_unit": "years",
36
      "is_license_length_unlimited": false,
37
      "sort": 1,
38
      "status": "published",
39
      "status_formatted": "Published",
40
      "created_at": "2021-05-24T14:15:06.000000Z",
41
      "updated_at": "2021-06-24T14:44:38.000000Z"
42
    },
43
    "relationships": {
44
      "product": {
45
        "links": {
46
          "related": "https://api.lemonsqueezy.com/v1/variants/1/product",
47
          "self": "https://api.lemonsqueezy.com/v1/variants/1/relationships/product"
48
        }
49
      }
50
    },
51
    "links": {
52
      "self": "https://api.lemonsqueezy.com/v1/variants/1"
53
    }
54
  }
55
}
56
`)
57
}
58
59
// VariantsListResponse is a dummy response to GET /v1/variants
60
func VariantsListResponse() []byte {
61
	return []byte(`
62
{
63
  "meta": {
64
    "page": {
65
      "currentPage": 1,
66
      "from": 1,
67
      "lastPage": 1,
68
      "perPage": 10,
69
      "to": 10,
70
      "total": 10
71
    }
72
  },
73
  "jsonapi": {
74
    "version": "1.0"
75
  },
76
  "links": {
77
    "first": "https:\/\/api.lemonsqueezy.com\/v1\/variants?page%5Bnumber%5D=1&page%5Bsize%5D=10&sort=sort",
78
    "last": "https:\/\/api.lemonsqueezy.com\/v1\/variants?page%5Bnumber%5D=1&page%5Bsize%5D=10&sort=sort"
79
  },
80
  "data": [
81
    {
82
      "type": "variants",
83
      "id": "1",
84
      "attributes": {
85
        "product_id": 1,
86
        "name": "Example Variant",
87
        "slug": "46beb127-a8a9-33e6-89b5-078505657239",
88
        "description": "<p>Lorem ipsum...<\/p>",
89
        "price": 999,
90
        "is_subscription": false,
91
        "interval": null,
92
        "interval_count": null,
93
        "has_free_trial": false,
94
        "trial_interval": "day",
95
        "trial_interval_count": 30,
96
        "pay_what_you_want": false,
97
        "min_price": 0,
98
        "suggested_price": 0,
99
        "has_license_keys": false,
100
        "license_activation_limit": 5,
101
        "is_license_limit_unlimited": false,
102
        "license_length_value": 1,
103
        "license_length_unit": "years",
104
        "is_license_length_unlimited": false,
105
        "sort": 1,
106
        "status": "published",
107
        "status_formatted": "Published",
108
        "created_at": "2021-05-24T14:15:06.000000Z",
109
        "updated_at": "2021-06-24T14:44:38.000000Z"
110
      },
111
      "relationships": {
112
        "product": {
113
          "links": {
114
            "related": "https:\/\/api.lemonsqueezy.com\/v1\/variants\/1\/product",
115
            "self": "https:\/\/api.lemonsqueezy.com\/v1\/variants\/1\/relationships\/product"
116
          }
117
        }
118
      },
119
      "links": {
120
        "self": "https:\/\/api.lemonsqueezy.com\/v1\/variants\/1"
121
      }
122
    },
123
	{
124
      "type": "variants",
125
      "id": "2",
126
      "attributes": {
127
        "product_id": 1,
128
        "name": "Example Variant",
129
        "slug": "46beb127-a8a9-33e6-89b5-078505657239",
130
        "description": "<p>Lorem ipsum...<\/p>",
131
        "price": 999,
132
        "is_subscription": false,
133
        "interval": null,
134
        "interval_count": null,
135
        "has_free_trial": false,
136
        "trial_interval": "day",
137
        "trial_interval_count": 30,
138
        "pay_what_you_want": false,
139
        "min_price": 0,
140
        "suggested_price": 0,
141
        "has_license_keys": false,
142
        "license_activation_limit": 5,
143
        "is_license_limit_unlimited": false,
144
        "license_length_value": 1,
145
        "license_length_unit": "years",
146
        "is_license_length_unlimited": false,
147
        "sort": 1,
148
        "status": "published",
149
        "status_formatted": "Published",
150
        "created_at": "2021-05-24T14:15:06.000000Z",
151
        "updated_at": "2021-06-24T14:44:38.000000Z"
152
      },
153
      "relationships": {
154
        "product": {
155
          "links": {
156
            "related": "https:\/\/api.lemonsqueezy.com\/v1\/variants\/1\/product",
157
            "self": "https:\/\/api.lemonsqueezy.com\/v1\/variants\/1\/relationships\/product"
158
          }
159
        }
160
      },
161
      "links": {
162
        "self": "https:\/\/api.lemonsqueezy.com\/v1\/variants\/1"
163
      }
164
    }
165
  ]
166
}
167
`)
168
}
169