bunny_app 2.0.0 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ef0fdf58b7fc7c4973466ba5c722802b73b2d94529087aa3dd1332290f2c044
4
- data.tar.gz: 8903c12d6412863560b7f25b6be25c2580a0b01cc8f8d9451b121e810b93333c
3
+ metadata.gz: a0679df10d54f538c211fe1ed824c1b537d859f009ceb9131f2bb8165e14ebd8
4
+ data.tar.gz: 40ebd43e2d84bd49d9f4c224dad09d48d6a5ba07b8a6c5a67d97d1ae27db0a66
5
5
  SHA512:
6
- metadata.gz: b95f160e2ed4c9b90a498310efd2dffc0909a825bb60ea3c8707c2bb2b7343b6e565561b046186c9874467c3cceaaef6795c696bbc8c969506aa18255ccd28d1
7
- data.tar.gz: 8a4e13af567f9cfd02f99135ca9fdd72bbf0a1e9787137944b6f3c22aef529f4c9ac8a2d35bd5991c96c9284a0ff4150b5a60b018757f0f24c70847984bc8180
6
+ metadata.gz: f573c0bcb3569634e4cf14590bef2bf54d9630a4425392a11a1c12b3046c182a78bb4284410645d14866ce4bfa683eaf4eb41a92fca2ecc130d1a071dd58c185
7
+ data.tar.gz: dd07c19832a5e5e81f9c4e562de088560e175214e41f2ed3bc09ac583336249fab5a3f4fc9da3d87a147df41ecb7246f5ac4f3888e5a130d9a36f62ffcfc10db
@@ -76,7 +76,10 @@ module BunnyApp
76
76
  when /403/ # HTTP 403
77
77
  raise AuthorizationError, res.parsed_response['error_decscription']
78
78
  else
79
- raise ResponseError, res.body # HTTP 400, 500 etc
79
+ # HTTP 400, 500 etc
80
+ puts "Bunny SDK Response Error Headers: #{res.headers}"
81
+ puts "Bunny SDK Response Error Body: #{res.body}"
82
+ raise ResponseError, res.body
80
83
  end
81
84
  end
82
85
 
@@ -19,6 +19,7 @@ module BunnyApp
19
19
  startDate
20
20
  endDate
21
21
  state
22
+ evergreen
22
23
  plan {
23
24
  code
24
25
  name
@@ -51,7 +52,8 @@ module BunnyApp
51
52
  variables = {
52
53
  attributes: {
53
54
  priceListCode: price_list_code,
54
- trial: options[:trial] || false
55
+ trial: options[:trial] || false,
56
+ evergreen: options[:evergreen] || false
55
57
  }
56
58
  }
57
59
 
@@ -0,0 +1,26 @@
1
+ module BunnyApp
2
+ class TenantMetrics
3
+ @tenant_metrics_update_mutation = <<-'GRAPHQL'
4
+ mutation tenantMetricsUpdate ($code: String!, $attributes: TenantMetricsAttributes!) {
5
+ tenantMetricsUpdate (code: $code, attributes: $attributes) {
6
+ errors
7
+ }
8
+ }
9
+ GRAPHQL
10
+
11
+ def self.update(code:, last_login:, user_count:, utilization_metrics: {})
12
+ variables = {
13
+ code:,
14
+ attributes: {
15
+ lastLogin: last_login,
16
+ userCount: user_count,
17
+ utilizationMetrics: utilization_metrics
18
+ }
19
+ }
20
+
21
+ Client.new.query(@tenant_metrics_update_mutation, variables)
22
+
23
+ true
24
+ end
25
+ end
26
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BunnyApp
4
- VERSION = '2.0.0'
4
+ VERSION = '2.0.4'
5
5
  end
data/lib/bunny_app.rb CHANGED
@@ -7,6 +7,7 @@ require 'bunny_app/tenant'
7
7
  require 'bunny_app/subscription'
8
8
  require 'bunny_app/webhook'
9
9
  require 'bunny_app/portal_session'
10
+ require 'bunny_app/tenant_metrics'
10
11
 
11
12
  module BunnyApp
12
13
  class << self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunny_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bunny
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-08-18 00:00:00.000000000 Z
12
+ date: 2023-12-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -144,6 +144,7 @@ files:
144
144
  - lib/bunny_app/portal_session.rb
145
145
  - lib/bunny_app/subscription.rb
146
146
  - lib/bunny_app/tenant.rb
147
+ - lib/bunny_app/tenant_metrics.rb
147
148
  - lib/bunny_app/version.rb
148
149
  - lib/bunny_app/webhook.rb
149
150
  - lib/generators/bunny_app/install_generator.rb