gitlab_support_readiness 1.0.25 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ab21d2be7f89338471a03f2646613b3b7f173bb687dde03e7bb925d11c28d35
4
- data.tar.gz: ba65dee2b2278ab90ddcb2d20ee6e20332b66c3aea28f72f1e552230b8037da4
3
+ metadata.gz: 1e0aa877d565ca7a4a041592019b2249d0d65416461b6fd98236ac8afacf801f
4
+ data.tar.gz: 3cd603b24a283aa772e12f13b105012434a846e7d24febea4eb1353579547f83
5
5
  SHA512:
6
- metadata.gz: e7d8737d99bf51afcfd919103a5d0d6a52aa8199a34a073f006c23e142f9a5e325e56e462c6adc82da4bb84d30d4379239fc744b47a628acae6a45b38b545704
7
- data.tar.gz: 8248245a1bc184d33b794d88451c3395a1760bdda62cd4f4568afd971bb9cc812a3d9c04cbca2b4eca5ab522744a2e09afa62b31f9966ddde29ff265c449aa9c
6
+ metadata.gz: 6aed7c494fa99b0590a99cafa0d75ddea51ba1a501d0e93c600ddbe308d2b42d79e31cc1fd9b38eef31abbd18beb43355b7fa0f33e766030fb3a90f60c8256f2
7
+ data.tar.gz: 0cb0269cbcadbce90a9617f451e80418475e4599400c960d2ee6fb9df8a971a55263383ec4829c480460a2640743edbe164241d5e7ff4e4d2b9bd705cf0679f0
@@ -74,6 +74,361 @@ module Readiness
74
74
  false
75
75
  end
76
76
 
77
+ ##
78
+ # Return an Array of accounts from Salesforce for Global support
79
+ #
80
+ # @author Jason Colyer
81
+ # @since 1.0.26
82
+ # @param client [Object] An instance of {Readiness::Salesforce::Client}
83
+ # @return [Array]
84
+ # @example
85
+ # config = Readiness::Salesforce::Configuration.new
86
+ # config.api_version = '58.0'
87
+ # config.client_id = ENV.fetch('SFDC_CLIENTID')
88
+ # config.client_secret = ENV.fetch('SFDC_CLIENTSECRET')
89
+ # config.password = ENV.fetch('SFDC_PASSWORD')
90
+ # config.security_token = ENV.fetch('SFDC_SECURITYTOKEN')
91
+ # config.username = ENV.fetch('SFDC_USERNAME')
92
+ # client = Readiness::Salesforce::Client.new(config)
93
+ # accounts = Readiness::Salesforce::Accounts.global_accounts(client)
94
+ # pp accounts.count
95
+ # # => 51234
96
+ def self.global_accounts(client)
97
+ query = Queries.new(global_sync_query_string)
98
+ results = Queries.run!(client, query)
99
+ results.map { |r| global_sync_object(r) }
100
+ end
101
+
102
+ ##
103
+ # Return an Array of accounts from Salesforce for US Government support
104
+ #
105
+ # @author Jason Colyer
106
+ # @since 1.0.26
107
+ # @param client [Object] An instance of {Readiness::Salesforce::Client}
108
+ # @return [Array]
109
+ # @example
110
+ # config = Readiness::Salesforce::Configuration.new
111
+ # config.api_version = '58.0'
112
+ # config.client_id = ENV.fetch('SFDC_CLIENTID')
113
+ # config.client_secret = ENV.fetch('SFDC_CLIENTSECRET')
114
+ # config.password = ENV.fetch('SFDC_PASSWORD')
115
+ # config.security_token = ENV.fetch('SFDC_SECURITYTOKEN')
116
+ # config.username = ENV.fetch('SFDC_USERNAME')
117
+ # client = Readiness::Salesforce::Client.new(config)
118
+ # accounts = Readiness::Salesforce::Accounts.usgov_accounts(client)
119
+ # pp accounts.count
120
+ # # => 7125
121
+ def self.usgov_accounts(client)
122
+ query = Queries.new(usgov_sync_query_string)
123
+ results = Queries.run!(client, query)
124
+ results.map { |r| usgov_sync_object(r) }
125
+ end
126
+
127
+ ##
128
+ # Return a Hash used for the account sync for Global support
129
+ #
130
+ # @author Jason Colyer
131
+ # @since 1.0.26
132
+ def self.global_sync_object(account)
133
+ subscriptions = account_subscriptions(account)
134
+ expiration = account_expiration(account)
135
+ type = account_type(account, expiration)
136
+ partner = %w[alliance_partner open_partner select_partner].include?(type)
137
+ {
138
+ "name" => "#{Digest::SHA1.hexdigest(account.Account_ID_18__c)[0..7]} #{account.Name}",
139
+ "salesforce_id" => account.Account_ID_18__c,
140
+ "sfdc_short_id" => account.Account_ID_18__c[..-4],
141
+ "support_level" => (partner ? 'ultimate' : global_highest_support_level(subscriptions)),
142
+ "aar" => account_arr(account).to_f,
143
+ "sales_segmentation" => account_market_segment(account),
144
+ "account_owner" => account.Account_Owner_Calc__c,
145
+ "type" => type,
146
+ "technical_account_manager" => account.Technical_Account_Manager_Name__c,
147
+ "solutions_architect" => account.Solutions_Architect_Lookup__r&.Name,
148
+ "seats_decimal" => account_seats(account).to_f,
149
+ "org_region" => account_region(account),
150
+ "health_score" => account_health_score(account),
151
+ "expiration_date" => expiration,
152
+ "restricted_account" => (account.Restricted_Account__c == 'Restricted Party'),
153
+ "greatly_expired" => (partner ? false : Date.parse(expiration) <= Date.today.years_ago(3)),
154
+ "sub_consumption_ai" => subscriptions.include?('sub_consumption_ai'),
155
+ "sub_consumption_cicd_minutes" => subscriptions.include?('sub_consumption_cicd_minutes'),
156
+ "sub_consumption_eap" => subscriptions.include?('sub_consumption_eap'),
157
+ "sub_consumption_storage" => subscriptions.include?('sub_consumption_storage'),
158
+ "sub_proserv" => subscriptions.include?('sub_proserv'),
159
+ "sub_dotcom_premium" => subscriptions.include?('sub_dotcom_premium'),
160
+ "sub_dotcom_ultimate" => subscriptions.include?('sub_dotcom_ultimate'),
161
+ "sub_sm_starter" => subscriptions.include?('sub_sm_starter'),
162
+ "sub_sm_premium" => subscriptions.include?('sub_sm_premium'),
163
+ "sub_sm_ultimate" => subscriptions.include?('sub_sm_ultimate'),
164
+ "sub_usgov_12x5" => subscriptions.include?('sub_usgov_12x5'),
165
+ "sub_usgov_24x7" => subscriptions.include?('sub_usgov_24x7'),
166
+ "sub_gitlab_dedicated" => subscriptions.include?('sub_gitlab_dedicated'),
167
+ "sub_edu" => subscriptions.include?('sub_edu'),
168
+ "sub_oss" => subscriptions.include?('sub_oss'),
169
+ "sub_community_other" => subscriptions.include?('sub_community_other'),
170
+ "sub_ss_ase" => subscriptions.include?('sub_ss_ase'),
171
+ "sub_other" => subscriptions.include?('sub_other'),
172
+ "partner_customer" => account_is_partner_customer?(account, type),
173
+ "not_in_sfdc" => false,
174
+ "support_hold" => account.Support_Hold__c,
175
+ "sold_to" => account_sold_to(account)
176
+ }
177
+ end
178
+
179
+ ##
180
+ # Return a Hash used for the account sync for US Government support
181
+ #
182
+ # @author Jason Colyer
183
+ # @since 1.0.26
184
+ def self.usgov_sync_object(account)
185
+ subscriptions = account_subscriptions(account)
186
+ expiration = account_expiration(account)
187
+ type = account_type(account, expiration)
188
+ partner = %w[alliance_partner open_partner select_partner].include?(type)
189
+ {
190
+ "name" => "#{Digest::SHA1.hexdigest(account.Account_ID_18__c)[0..7]} #{account.Name}",
191
+ "salesforce_id" => account.Account_ID_18__c,
192
+ "sfdc_short_id" => account.Account_ID_18__c[..-4],
193
+ "support_level" => usgov_highest_support_level(subscriptions),
194
+ "arr" => account_arr(account).to_f,
195
+ "market_segment" => account_market_segment(account),
196
+ "account_owner" => account.Account_Owner_Calc__c,
197
+ "type" => type,
198
+ "technical_account_manager" => account.Technical_Account_Manager_Name__c,
199
+ "solutions_architect" => account.Solutions_Architect_Lookup__r&.Name,
200
+ "number_of_seats" => account_seats(account).to_f,
201
+ "health_score" => account_health_score(account),
202
+ "expiration_date" => expiration,
203
+ "restricted_account" => (account.Restricted_Account__c == 'Restricted Party'),
204
+ "greatly_expired" => (partner ? false : Date.parse(expiration) <= Date.today.years_ago(3)),
205
+ "sub_consumption_ai" => subscriptions.include?('sub_consumption_ai'),
206
+ "sub_consumption_cicd_minutes" => subscriptions.include?('sub_consumption_cicd_minutes'),
207
+ "sub_consumption_eap" => subscriptions.include?('sub_consumption_eap'),
208
+ "sub_consumption_storage" => subscriptions.include?('sub_consumption_storage'),
209
+ "sub_proserv" => subscriptions.include?('sub_proserv'),
210
+ "sub_dotcom_premium" => subscriptions.include?('sub_dotcom_premium'),
211
+ "sub_dotcom_ultimate" => subscriptions.include?('sub_dotcom_ultimate'),
212
+ "sub_sm_starter" => subscriptions.include?('sub_sm_starter'),
213
+ "sub_sm_premium" => subscriptions.include?('sub_sm_premium'),
214
+ "sub_sm_ultimate" => subscriptions.include?('sub_sm_ultimate'),
215
+ "sub_usgov_12x5" => subscriptions.include?('sub_usgov_12x5'),
216
+ "sub_usgov_24x7" => subscriptions.include?('sub_usgov_24x7'),
217
+ "sub_gitlab_dedicated" => subscriptions.include?('sub_gitlab_dedicated'),
218
+ "sub_edu" => subscriptions.include?('sub_edu'),
219
+ "sub_oss" => subscriptions.include?('sub_oss'),
220
+ "sub_community_other" => subscriptions.include?('sub_community_other'),
221
+ "sub_ss_ase" => subscriptions.include?('sub_ss_ase'),
222
+ "sub_other" => subscriptions.include?('sub_other'),
223
+ "not_in_sfdc" => false,
224
+ "support_hold" => account.Support_Hold__c
225
+ }
226
+ end
227
+
228
+ ##
229
+ # Return an Array of subscriptions used for the account sync
230
+ #
231
+ # @author Jason Colyer
232
+ # @since 1.0.26
233
+ def self.account_subscriptions(account)
234
+ subs = []
235
+ return subs if account.Zuora__R00N40000001lGjTEAU__r.nil?
236
+
237
+ account.Zuora__R00N40000001lGjTEAU__r.each do |sub|
238
+ next if Date.parse(sub.Zuora__EffectiveEndDate__c) < Date.today
239
+
240
+ sub_types = []
241
+ sub_types.push('sub_consumption_ai') if SubscriptionDefinitions.consumption_ai.include? sub.Name
242
+ sub_types.push('sub_consumption_cicd_minutes') if SubscriptionDefinitions.consumption_cicd_minutes.include? sub.Name
243
+ sub_types.push('sub_consumption_eap') if SubscriptionDefinitions.consumption_eap.include? sub.Name
244
+ sub_types.push('sub_consumption_storage') if SubscriptionDefinitions.consumption_storage.include? sub.Name
245
+ sub_types.push('sub_proserv') if SubscriptionDefinitions.proserv.include? sub.Name
246
+ sub_types.push('sub_dotcom_premium') if SubscriptionDefinitions.dotcom_premium.include? sub.Name
247
+ sub_types.push('sub_dotcom_ultimate') if SubscriptionDefinitions.dotcom_ultimate.include? sub.Name
248
+ sub_types.push('sub_sm_starter') if SubscriptionDefinitions.sm_starter.include? sub.Name
249
+ sub_types.push('sub_sm_premium') if SubscriptionDefinitions.sm_premium.include? sub.Name
250
+ sub_types.push('sub_sm_ultimate') if SubscriptionDefinitions.sm_ultimate.include? sub.Name
251
+ sub_types.push('sub_usgov_12x5') if SubscriptionDefinitions.usgov_12x5.include? sub.Name
252
+ sub_types.push('sub_usgov_24x7') if SubscriptionDefinitions.usgov_24x7.include? sub.Name
253
+ sub_types.push('sub_gitlab_dedicated') if SubscriptionDefinitions.gitlab_dedicated.include? sub.Name
254
+ sub_types.push('sub_edu') if SubscriptionDefinitions.edu.include? sub.Name
255
+ sub_types.push('sub_oss') if SubscriptionDefinitions.oss.include? sub.Name
256
+ sub_types.push('sub_community_other') if SubscriptionDefinitions.community_other.include? sub.Name
257
+ sub_types.push('sub_ss_ase') if SubscriptionDefinitions.ss_ase.include? sub.Name
258
+ sub_types.push('sub_usgov_24x7') if SubscriptionDefinitions.fedramp.include? sub.Name
259
+ sub_types.push('sub_gitlab_dedicated') if SubscriptionDefinitions.fedramp.include? sub.Name
260
+ sub_types.push('sub_other') if sub_types.count.zero?
261
+ subs += sub_types
262
+ end
263
+ subs.compact.uniq
264
+ end
265
+
266
+ ##
267
+ # Returns an accounts latest expiration
268
+ #
269
+ # @author Jason Colyer
270
+ # @since 1.0.26
271
+ def self.account_expiration(account)
272
+ return '1970-01-01' if account.Zuora__R00N40000001lGjTEAU__r.nil?
273
+
274
+ account.Zuora__R00N40000001lGjTEAU__r.map(&:Zuora__EffectiveEndDate__c).max
275
+ end
276
+
277
+ ##
278
+ # Returns an accounts type
279
+ #
280
+ # @author Jason Colyer
281
+ # @since 1.0.26
282
+ def self.account_type(account, expiration)
283
+ return 'alliance_partner' if %w[0014M00001sDiGEQA0].include?(account.Account_ID_18__c)
284
+ return 'open_partner' if account.Type == 'Partner' && account.Partner_Track__c == 'Open'
285
+ return 'select_partner' if account.Type == 'Partner' && account.Partner_Track__c == 'Select'
286
+ return 'former_customer' if Date.parse(expiration) < Date.today
287
+
288
+ 'customer'
289
+ end
290
+
291
+ ##
292
+ # Returns an accounts ARR
293
+ #
294
+ # @author Jason Colyer
295
+ # @since 1.0.26
296
+ def self.account_arr(account)
297
+ total = 0
298
+ return total if account.Zuora__R00N40000001lGjTEAU__r.nil?
299
+
300
+ account.Zuora__R00N40000001lGjTEAU__r.each do |subscription|
301
+ next if Date.parse(subscription.Zuora__EffectiveEndDate__c) < Date.today
302
+
303
+ total += subscription.Zuora__TotalContractValue__c.to_i
304
+ end
305
+ total
306
+ end
307
+
308
+ ##
309
+ # Returns an accounts market segment
310
+ #
311
+ # @author Jason Colyer
312
+ # @since 1.0.26
313
+ def self.account_market_segment(account)
314
+ account.Ultimate_Parent_Sales_Segment_Employees__c.downcase
315
+ rescue NoMethodError
316
+ 'unknown'
317
+ end
318
+
319
+ ##
320
+ # Returns an accounts seat count
321
+ #
322
+ # @author Jason Colyer
323
+ # @since 1.0.26
324
+ def self.account_seats(account)
325
+ total = 0
326
+ return total if account.Zuora__R00N40000001lGjTEAU__r.nil?
327
+
328
+ account.Zuora__R00N40000001lGjTEAU__r.each do |subscription|
329
+ next if Date.parse(subscription.Zuora__EffectiveEndDate__c) < Date.today
330
+
331
+ total += subscription.Zuora__Quantity__c.to_i
332
+ end
333
+ total
334
+ end
335
+
336
+ ##
337
+ # Returns an accounts region
338
+ #
339
+ # @author Jason Colyer
340
+ # @since 1.0.26
341
+ def self.account_region(account)
342
+ return nil if account.Account_Demographics_Geo__c.nil?
343
+ return nil unless %w[amer apac emea latam ncsa noram].include? account.Account_Demographics_Geo__c.to_s.downcase
344
+
345
+ "org_region_#{account.Account_Demographics_Geo__c.to_s.downcase}"
346
+ end
347
+
348
+ ##
349
+ # Returns an accounts health score
350
+ #
351
+ # @author Jason Colyer
352
+ # @since 1.0.26
353
+ def self.account_health_score(account)
354
+ account.GS_Health_Score_Color__c.downcase
355
+ rescue NoMethodError
356
+ nil
357
+ end
358
+
359
+ ##
360
+ # Returns if an account is a partner customer or not
361
+ #
362
+ # @author Jason Colyer
363
+ # @since 1.0.26
364
+ def self.account_is_partner_customer?(account, type)
365
+ return false if account.Latest_Sold_To_Contact__r.nil?
366
+ return false if type != 'customer'
367
+ return true if account.Latest_Sold_To_Contact__r.Email == 'ecopo@us.ibm.com'
368
+
369
+ false
370
+ end
371
+
372
+ ##
373
+ # Returns an accounts highest support level for the Global support sync
374
+ #
375
+ # @author Jason Colyer
376
+ # @since 1.0.26
377
+ def self.global_highest_support_level(subscriptions)
378
+ return 'ultimate' if subscriptions.include? 'sub_sm_ultimate'
379
+ return 'gold' if subscriptions.include? 'sub_dotcom_ultimate'
380
+ return 'ultimate' if subscriptions.include? 'sub_gitlab_dedicated'
381
+ return 'premium' if subscriptions.include? 'sub_sm_premium'
382
+ return 'silver' if subscriptions.include? 'sub_dotcom_premium'
383
+ return 'starter' if subscriptions.include? 'sub_sm_starter'
384
+ return 'consumption_only' if subscriptions.include? 'sub_consumption_ai'
385
+ return 'consumption_only' if subscriptions.include? 'sub_consumption_cicd_minutes'
386
+ return 'consumption_only' if subscriptions.include? 'sub_consumption_eap'
387
+ return 'consumption_only' if subscriptions.include? 'sub_consumption_storage'
388
+ return 'custom' if subscriptions.include? 'sub_usgov_12x5'
389
+ return 'custom' if subscriptions.include? 'sub_usgov_24x7'
390
+ return 'custom' if subscriptions.include? 'sub_ss_ase'
391
+ return 'community' if subscriptions.include? 'sub_edu'
392
+ return 'community' if subscriptions.include? 'sub_oss'
393
+ return 'community' if subscriptions.include? 'sub_community_other'
394
+ return 'other' if subscriptions.include? 'sub_proserv'
395
+ return 'sub_other' if subscriptions.include? 'sub_proserv'
396
+
397
+ 'expired'
398
+ end
399
+
400
+ ##
401
+ # Returns an accounts highest support level for the US Government support sync
402
+ #
403
+ # @author Jason Colyer
404
+ # @since 1.0.26
405
+ def self.usgov_highest_support_level(subscriptions)
406
+ return 'ultimate' if subscriptions.include? 'sub_sm_ultimate'
407
+ return 'ultimate' if subscriptions.include? 'sub_gitlab_dedicated'
408
+ return 'premium' if subscriptions.include? 'sub_sm_premium'
409
+ return 'starter' if subscriptions.include? 'sub_sm_starter'
410
+ return 'custom' if subscriptions.include? 'sub_usgov_12x5'
411
+ return 'custom' if subscriptions.include? 'sub_usgov_24x7'
412
+
413
+ 'expired'
414
+ end
415
+
416
+ ##
417
+ # Returns an accounts sold to
418
+ #
419
+ # @author Jason Colyer
420
+ # @since 1.0.26
421
+ def self.account_sold_to(account)
422
+ return nil if account.Zuora__R00N40000001kyLcEAI__r.nil?
423
+ return nil if account.Zuora__R00N40000001kyLcEAI__r.first.Zuora__SoldToWorkEmail__c == 'ecopo@us.ibm.com'
424
+
425
+ {
426
+ "salesforce_id" => account.Account_ID_18__c,
427
+ "email" => account.Zuora__R00N40000001kyLcEAI__r.first.Zuora__SoldToWorkEmail__c,
428
+ "name" => account.Zuora__R00N40000001kyLcEAI__r.first.Name
429
+ }
430
+ end
431
+
77
432
  ##
78
433
  # Provides the String needed to make a specific type of SOQL query
79
434
  #
@@ -104,6 +459,115 @@ module Readiness
104
459
  Account_ID_18__c = '#{aid}'
105
460
  STRING
106
461
  end
462
+
463
+ ##
464
+ # Provides the String needed to make a specific type of SOQL query
465
+ #
466
+ # @author Jason Colyer
467
+ # @since 1.0.26
468
+ # @param aid [String] The ID of the Account to check
469
+ # @return [String]
470
+ def self.global_sync_query_string
471
+ <<~QUERY
472
+ SELECT
473
+ Account_ID_18__c,
474
+ Name,
475
+ Type,
476
+ Ultimate_Parent_Sales_Segment_Employees__c,
477
+ Account_Owner_Calc__c,
478
+ Technical_Account_Manager_Name__c,
479
+ GS_Health_Score_Color__c,
480
+ Restricted_Account__c,
481
+ Solutions_Architect_Lookup__r.Name,
482
+ Account_Demographics_Geo__c,
483
+ Latest_Sold_To_Contact__r.Email,
484
+ Latest_Sold_To_Contact__r.Name,
485
+ Partner_Track__c,
486
+ Partners_Partner_Type__c,
487
+ Support_Hold__c,
488
+ (
489
+ SELECT
490
+ Id,
491
+ Name,
492
+ Zuora__ProductName__c,
493
+ Zuora__EffectiveEndDate__c,
494
+ Zuora__Quantity__c,
495
+ Zuora__TotalContractValue__c,
496
+ Subscription_Status__c
497
+ FROM Zuora__R00N40000001lGjTEAU__r
498
+ WHERE
499
+ Zuora__EffectiveEndDate__c != NULL
500
+ ),
501
+ (
502
+ SELECT
503
+ Name,
504
+ Zuora__SoldToWorkEmail__c
505
+ FROM Zuora__R00N40000001kyLcEAI__r
506
+ WHERE
507
+ IsDeleted = false
508
+ ORDER BY CreatedDate ASC
509
+ LIMIT 1
510
+ )
511
+ FROM Account
512
+ WHERE
513
+ Type != 'Prospect' AND
514
+ (
515
+ Type IN ('Customer', 'Former Customer') OR
516
+ (
517
+ Type = 'Partner' AND
518
+ Partners_Partner_Status__c IN ('Authorized', 'Former') AND
519
+ Partners_Partner_Type__c IN ('Alliance', 'Channel') AND
520
+ Partner_Track__c IN ('Open', 'Select', 'Technology')
521
+ )
522
+ )
523
+ QUERY
524
+ end
525
+
526
+ ##
527
+ # Provides the String needed to make a specific type of SOQL query
528
+ #
529
+ # @author Jason Colyer
530
+ # @since 1.0.26
531
+ # @param aid [String] The ID of the Account to check
532
+ # @return [String]
533
+ def self.usgov_sync_query_string
534
+ <<~QUERY
535
+ SELECT
536
+ Account_ID_18__c,
537
+ Name,
538
+ Ultimate_Parent_Sales_Segment_Employees__c,
539
+ Account_Owner_Calc__c,
540
+ Technical_Account_Manager_Name__c,
541
+ GS_Health_Score_Color__c,
542
+ Restricted_Account__c,
543
+ Solutions_Architect_Lookup__r.Name,
544
+ Support_Hold__c,
545
+ (
546
+ SELECT
547
+ Id,
548
+ Name,
549
+ Zuora__ProductName__c,
550
+ Zuora__EffectiveEndDate__c,
551
+ Zuora__Quantity__c,
552
+ Zuora__TotalContractValue__c,
553
+ Subscription_Status__c
554
+ FROM Zuora__R00N40000001lGjTEAU__r
555
+ )
556
+ FROM Account
557
+ WHERE
558
+ Type IN ('Customer', 'Former Customer') AND
559
+ (
560
+ (
561
+ Account_Demographics_Territory__c LIKE 'PUBSEC%' AND
562
+ Account_Demographics_Territory__c != 'PUBSEC_' AND
563
+ (
564
+ NOT Account_Demographics_Territory__c LIKE '%SLED%'
565
+ )
566
+ ) OR
567
+ Support_Instance__c = 'federal-support'
568
+ )
569
+ QUERY
570
+ end
107
571
  end
108
572
  end
109
573
  end
@@ -0,0 +1,92 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Defines the module Readiness.
4
+ module Readiness
5
+ # Defines the module Salesforce
6
+ module Salesforce
7
+ ##
8
+ # Defines the class Contacts within the module {Readiness::Salesforce}.
9
+ #
10
+ # @author Jason Colyer
11
+ # @since 1.0.26
12
+ class Contacts < Readiness::Client
13
+ ##
14
+ # Return an Array of contacts from Salesforce for US Government support
15
+ #
16
+ # @author Jason Colyer
17
+ # @since 1.0.26
18
+ # @param client [Object] An instance of {Readiness::Salesforce::Client}
19
+ # @return [Array]
20
+ # @example
21
+ # config = Readiness::Salesforce::Configuration.new
22
+ # config.api_version = '58.0'
23
+ # config.client_id = ENV.fetch('SFDC_CLIENTID')
24
+ # config.client_secret = ENV.fetch('SFDC_CLIENTSECRET')
25
+ # config.password = ENV.fetch('SFDC_PASSWORD')
26
+ # config.security_token = ENV.fetch('SFDC_SECURITYTOKEN')
27
+ # config.username = ENV.fetch('SFDC_USERNAME')
28
+ # client = Readiness::Salesforce::Client.new(config)
29
+ # contacts = Readiness::Salesforce::Contacts.usgov_contacts(client)
30
+ # pp contacts.count
31
+ # # => 1769
32
+ def self.usgov_contacts(client)
33
+ query = Queries.new(usgov_sync_query_string)
34
+ results = Queries.run!(client, query)
35
+ contacts = results.map { |r| usgov_sync_object(r) }.compact.uniq
36
+ grouped = contacts.group_by { |a| a['email'] }.values
37
+ duplicates = grouped.select { |a| a.size > 1 }.flatten
38
+ (contacts - duplicates).compact.uniq
39
+ end
40
+
41
+ ##
42
+ # Return a Hash used for the contact sync for US Government support
43
+ #
44
+ # @author Jason Colyer
45
+ # @since 1.0.26
46
+ def self.usgov_sync_object(contact)
47
+ {
48
+ "name" => contact.Name,
49
+ "email" => contact.Email.downcase,
50
+ "org" => "#{Digest::SHA1.hexdigest(contact.Account.Account_ID_18__c)[0..7]} #{contact.Account.Name}",
51
+ "salesforce_id" => contact.Account.Account_ID_18__c,
52
+ "not_in_sfdc" => false
53
+ }
54
+ end
55
+
56
+ ##
57
+ # Return a String used for the contact sync for US Government support
58
+ #
59
+ # @author Jason Colyer
60
+ # @since 1.0.26
61
+ def self.usgov_sync_query_string
62
+ <<~QUERY
63
+ SELECT
64
+ Name,
65
+ Email,
66
+ Account.Account_ID_18__c,
67
+ Account.Name,
68
+ Role__c
69
+ FROM Contact
70
+ WHERE
71
+ Inactive_Contact__c = false AND
72
+ Name != '' AND
73
+ Email != '' AND
74
+ Role__c INCLUDES ('Gitlab Admin') AND
75
+ (
76
+ NOT Email LIKE '%gitlab.com'
77
+ ) AND
78
+ (
79
+ (
80
+ Account.Account_Demographics_Territory__c LIKE 'PUBSEC%' AND
81
+ Account.Account_Demographics_Territory__c != 'PUBSEC_' AND
82
+ (
83
+ NOT Account.Account_Demographics_Territory__c LIKE '%SLED%'
84
+ )
85
+ ) OR
86
+ Account.Support_Instance__c = 'federal-support'
87
+ )
88
+ QUERY
89
+ end
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,608 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Defines the module Readiness.
4
+ module Readiness
5
+ # Defines the module Salesforce
6
+ module Salesforce
7
+ ##
8
+ # Defines the class SubscriptionDefinitions within the module {Readiness::Salesforce}.
9
+ #
10
+ # @author Jason Colyer
11
+ # @since 1.0.26
12
+ class SubscriptionDefinitions < Readiness::Client
13
+ ##
14
+ # Defines Consumption => AI subscriptions
15
+ #
16
+ # @author Jason Colyer
17
+ # @since 1.0.26
18
+ # @return [Array]
19
+ def self.consumption_ai
20
+ [
21
+ 'Dedicated - GitLab Duo Enterprise - 1 Year',
22
+ 'Dedicated - GitLab Duo Enterprise - 2 Year',
23
+ 'Dedicated - GitLab Duo Enterprise - 3 Year',
24
+ 'Dedicated - GitLab Duo Enterprise - 4 Year',
25
+ 'Dedicated - GitLab Duo Enterprise - 5 Year',
26
+ 'Dedicated - GitLab Duo Enterprise - Monthly',
27
+ 'Dedicated - GitLab Duo Pro - 1 Year',
28
+ 'Dedicated - GitLab Duo Pro - 2 Year',
29
+ 'Dedicated - GitLab Duo Pro - 3 Year',
30
+ 'Dedicated - GitLab Duo Pro - 4 Year',
31
+ 'Dedicated - GitLab Duo Pro - 5 Year',
32
+ 'Dedicated - GitLab Duo Pro - Monthly',
33
+ 'SaaS - GitLab Duo Enterprise - 1 Year',
34
+ 'SaaS - GitLab Duo Enterprise - 2 Year',
35
+ 'SaaS - GitLab Duo Enterprise - 3 Year',
36
+ 'SaaS - GitLab Duo Enterprise - 4 Year',
37
+ 'SaaS - GitLab Duo Enterprise - 5 Year',
38
+ 'SaaS - GitLab Duo Enterprise - Monthly',
39
+ 'SaaS - GitLab Duo Pro - 1 Year',
40
+ 'SaaS - GitLab Duo Pro - 2 Year',
41
+ 'SaaS - GitLab Duo Pro - 3 Year',
42
+ 'SaaS - GitLab Duo Pro - 4 Year',
43
+ 'SaaS - GitLab Duo Pro - 5 Year',
44
+ 'SaaS - GitLab Duo Pro - Monthly',
45
+ 'Self-Managed - GitLab Duo Enterprise - 1 Year',
46
+ 'Self-Managed - GitLab Duo Enterprise - 2 Year',
47
+ 'Self-Managed - GitLab Duo Enterprise - 3 Year',
48
+ 'Self-Managed - GitLab Duo Enterprise - 4 Year',
49
+ 'Self-Managed - GitLab Duo Enterprise - 5 Year',
50
+ 'Self-Managed - GitLab Duo Enterprise - Monthly',
51
+ 'Self-Managed - GitLab Duo Pro - 1 Year',
52
+ 'Self-Managed - GitLab Duo Pro - 2 Year',
53
+ 'Self-Managed - GitLab Duo Pro - 3 Year',
54
+ 'Self-Managed - GitLab Duo Pro - 4 Year',
55
+ 'Self-Managed - GitLab Duo Pro - 5 Year',
56
+ 'Self-Managed - GitLab Duo Pro - Monthly'
57
+ ]
58
+ end
59
+
60
+ ##
61
+ # Defines Consumption => CI/CD Minutes subscriptions
62
+ #
63
+ # @author Jason Colyer
64
+ # @since 1.0.26
65
+ # @return [Array]
66
+ def self.consumption_cicd_minutes
67
+ [
68
+ '1,000 CI Minutes',
69
+ '1,000 Compute Minutes',
70
+ 'Annual CI Minutes Pack (DO NOT USE)'
71
+ ]
72
+ end
73
+
74
+ ##
75
+ # Defines Consumption => EAP subscriptions
76
+ #
77
+ # @author Jason Colyer
78
+ # @since 1.0.26
79
+ # @return [Array]
80
+ def self.consumption_eap
81
+ [
82
+ 'Dedicated - Enterprise Agile Planning - 1 Year',
83
+ 'Dedicated - Enterprise Agile Planning - 2 Year',
84
+ 'Dedicated - Enterprise Agile Planning - 3 Year',
85
+ 'Dedicated - Enterprise Agile Planning - 4 Year',
86
+ 'Dedicated - Enterprise Agile Planning - 5 Year',
87
+ 'Dedicated - Enterprise Agile Planning - Monthly',
88
+ 'SaaS - Enterprise Agile Planning - 1 Year',
89
+ 'SaaS - Enterprise Agile Planning - 2 Year',
90
+ 'SaaS - Enterprise Agile Planning - 3 Year',
91
+ 'SaaS - Enterprise Agile Planning - 4 Year',
92
+ 'SaaS - Enterprise Agile Planning - 5 Year',
93
+ 'SaaS - Enterprise Agile Planning - Monthly',
94
+ 'Self-Managed - Enterprise Agile Planning - 1 Year',
95
+ 'Self-Managed - Enterprise Agile Planning - 2 Year',
96
+ 'Self-Managed - Enterprise Agile Planning - 3 Year',
97
+ 'Self-Managed - Enterprise Agile Planning - 4 Year',
98
+ 'Self-Managed - Enterprise Agile Planning - 5 Year',
99
+ 'Self-Managed - Enterprise Agile Planning - Monthly'
100
+ ]
101
+ end
102
+
103
+ ##
104
+ # Defines Consumption => Storage subscriptions
105
+ #
106
+ # @author Jason Colyer
107
+ # @since 1.0.26
108
+ # @return [Array]
109
+ def self.consumption_storage
110
+ [
111
+ 'Dedicated - Storage 10GB - 1 Year',
112
+ 'Dedicated - Storage 10GB - 2 Year',
113
+ 'Dedicated - Storage 10GB - 3 Year',
114
+ 'Dedicated - Storage 10GB - Monthly',
115
+ 'GitLab Dedicated for US Public Sector - Storage 10GB - 1 Year',
116
+ 'GitLab Dedicated for US Public Sector - Storage 10GB - 2 Year',
117
+ 'GitLab Dedicated for US Public Sector - Storage 10GB - 3 Year',
118
+ 'GitLab Dedicated for US Public Sector - Storage 10GB - Monthly',
119
+ 'Gitlab Storage 10GB - 1 Year'
120
+ ]
121
+ end
122
+
123
+ ##
124
+ # Defines ProServ subscriptions
125
+ #
126
+ # @author Jason Colyer
127
+ # @since 1.0.26
128
+ # @return [Array]
129
+ def self.proserv
130
+ [
131
+ '#movingtogitlab',
132
+ 'Admin Training',
133
+ 'CI/CD Modernization Workshop',
134
+ 'Consulting Block - 1 Year',
135
+ 'Consulting Block (48 Hours)',
136
+ 'CSM Services',
137
+ 'Custom PS Education Services',
138
+ 'Dedicated - Administration Fee [2XLarge] - 1 Year',
139
+ 'Dedicated - Administration Fee [2XLarge] - 2 Year',
140
+ 'Dedicated - Administration Fee [2XLarge] - 3 Year',
141
+ 'Dedicated - Administration Fee [2XLarge] - Monthly',
142
+ 'Dedicated - Administration Fee [3XLarge] - 1 Year',
143
+ 'Dedicated - Administration Fee [3XLarge] - 2 Year',
144
+ 'Dedicated - Administration Fee [3XLarge] - 3 Year',
145
+ 'Dedicated - Administration Fee [3XLarge] - Monthly',
146
+ 'Dedicated - Administration Fee [Large] - 1 Year',
147
+ 'Dedicated - Administration Fee [Large] - 2 Year',
148
+ 'Dedicated - Administration Fee [Large] - 2 Year',
149
+ 'Dedicated - Administration Fee [Large] - 3 Year',
150
+ 'Dedicated - Administration Fee [Large] - Monthly',
151
+ 'Dedicated - Administration Fee [Medium] - 1 Year',
152
+ 'Dedicated - Administration Fee [Medium] - 2 Year',
153
+ 'Dedicated - Administration Fee [Medium] - 3 Year',
154
+ 'Dedicated - Administration Fee [Medium] - Monthly',
155
+ 'Dedicated - Administration Fee [Small] - 1 Year',
156
+ 'Dedicated - Administration Fee [Small] - 2 Year',
157
+ 'Dedicated - Administration Fee [Small] - 3 Year',
158
+ 'Dedicated - Administration Fee [Small] - Monthly',
159
+ 'Dedicated - Administration Fee [XLarge] - 1 Year',
160
+ 'Dedicated - Administration Fee [XLarge] - 2 Year',
161
+ 'Dedicated - Administration Fee [XLarge] - 3 Year',
162
+ 'Dedicated - Administration Fee [XLarge] - Monthly',
163
+ 'Dedicated Implementation Services',
164
+ 'EdCast Settlement Revenue',
165
+ 'GitLab Dedicated for US Public Sector - Administration Fee [XLarge] - 1 Year',
166
+ 'GitLab Dedicated for US Public Sector - Administration Fee [XLarge] - 2 Year',
167
+ 'GitLab Dedicated for US Public Sector - Administration Fee [XLarge] - 3 Year',
168
+ 'GitLab Dedicated for US Public Sector - Administration Fee [XLarge] - Monthly',
169
+ 'GitLab Dedicated for US Public Sector - Administration Fee [2XLarge] - 1 Year',
170
+ 'GitLab Dedicated for US Public Sector - Administration Fee [2XLarge] - 2 Year',
171
+ 'GitLab Dedicated for US Public Sector - Administration Fee [2XLarge] - 3 Year',
172
+ 'GitLab Dedicated for US Public Sector - Administration Fee [2XLarge] - Monthly',
173
+ 'GitLab Dedicated for US Public Sector - Administration Fee [3XLarge] - 1 Year',
174
+ 'GitLab Dedicated for US Public Sector - Administration Fee [3XLarge] - 2 Year',
175
+ 'GitLab Dedicated for US Public Sector - Administration Fee [3XLarge] - 3 Year',
176
+ 'GitLab Dedicated for US Public Sector - Administration Fee [3XLarge] - Monthly',
177
+ 'GitLab Dedicated for US Public Sector - Administration Fee [Large] - 1 Year',
178
+ 'GitLab Dedicated for US Public Sector - Administration Fee [Large] - 2 Year',
179
+ 'GitLab Dedicated for US Public Sector - Administration Fee [Large] - 3 Year',
180
+ 'GitLab Dedicated for US Public Sector - Administration Fee [Large] - Monthly',
181
+ 'GitLab Dedicated for US Public Sector - Administration Fee [Medium] - 1 Year',
182
+ 'GitLab Dedicated for US Public Sector - Administration Fee [Medium] - 2 Year',
183
+ 'GitLab Dedicated for US Public Sector - Administration Fee [Medium] - 3 Year',
184
+ 'GitLab Dedicated for US Public Sector - Administration Fee [Medium] - Monthly',
185
+ 'GitLab Dedicated for US Public Sector - Administration Fee [Small] - 1 Year',
186
+ 'GitLab Dedicated for US Public Sector - Administration Fee [Small] - 2 Year',
187
+ 'GitLab Dedicated for US Public Sector - Administration Fee [Small] - 3 Year',
188
+ 'GitLab Dedicated for US Public Sector - Administration Fee [Small] - Monthly',
189
+ 'GitLab Agile Portfolio Management Training - Onsite',
190
+ 'GitLab Agile Portfolio Management Training - Remote',
191
+ 'GitLab Certification Exam',
192
+ 'GitLab CI/CD Training - Onsite',
193
+ 'GitLab CI/CD Training - Remote',
194
+ 'GitLab DevSecOps Fundamentals Training - Remote',
195
+ 'GitLab for System Administrators Training - Onsite',
196
+ 'GitLab for System Administrators Training - Remote',
197
+ 'GitLab Geo',
198
+ 'GitLab Geo | 2 Year',
199
+ 'GitLab Geo | 2 Year',
200
+ 'GitLab Geo | 3 Year',
201
+ 'GitLab Health Check - Self-Managed',
202
+ 'GitLab Private 1-Day Training Classroom - Remote',
203
+ 'GitLab Public 1-Day Training Seat - Remote',
204
+ 'GitLab Security Essentials Training - Onsite',
205
+ 'GitLab Security Essentials Training - Remote',
206
+ 'GitLab Service Package',
207
+ 'GitLab Service Package B',
208
+ 'GitLab Service Package C',
209
+ 'GitLab Service Package D',
210
+ 'GitLab System Administration Training - Onsite',
211
+ 'GitLab System Administration Training - Remote',
212
+ 'GitLab with Git Fundamentals Training - Onsite',
213
+ 'GitLab with Git Fundamentals Training - Remote',
214
+ 'Hourly Consulting',
215
+ 'Implementation Quick Start',
216
+ 'Implementation Quick Start (High Availability)',
217
+ 'Implementation QuickStart - GitLab.com',
218
+ 'Implementation QuickStart - Self Managed (HA)',
219
+ 'Implementation Support',
220
+ 'InnerSourcing Training - At your site',
221
+ 'InnerSourcing Training - Remote for your team',
222
+ 'Jenkins Integration',
223
+ 'JIRA Integration',
224
+ 'LDAP Integration',
225
+ 'Migration Quickstart',
226
+ 'Migration+',
227
+ 'New Component',
228
+ 'OLD: ProServ Training Per-Seat Add-on',
229
+ 'Pivotal Cloud Foundry',
230
+ 'ProServ Training Per-Seat Add-on',
231
+ 'Quarter',
232
+ 'Quick Start with HA (less than 10,000 users)',
233
+ 'Quick Start without HA, less than 500 users',
234
+ 'Training LMS Settlement Revenue',
235
+ 'Training Workshop',
236
+ 'Training Workshop | OneTime',
237
+ 'Travel Expenses',
238
+ 'Ultimate QuickStart - DevSecOps Workshop'
239
+ ]
240
+ end
241
+
242
+ ##
243
+ # Defines GitLab.com => Premium subscriptions
244
+ #
245
+ # @author Jason Colyer
246
+ # @since 1.0.26
247
+ # @return [Array]
248
+ def self.dotcom_premium
249
+ [
250
+ 'SaaS - Premium - 1 Year',
251
+ 'SaaS - Premium - 2 Year',
252
+ 'SaaS - Premium - 3 Year',
253
+ 'SaaS - Premium - 4 Year',
254
+ 'SaaS - Premium - 5 Year',
255
+ 'SaaS - Premium - Monthly',
256
+ 'Silver Plan',
257
+ 'Silver Plan - 2 Year',
258
+ 'Silver Plan - 3 Year',
259
+ 'Silver Plan - 4 Year',
260
+ 'Silver Plan - 5 Year',
261
+ 'Silver Plan - Monthly'
262
+ ]
263
+ end
264
+
265
+ ##
266
+ # Defines GitLab.com => Ultimate subscriptions
267
+ #
268
+ # @author Jason Colyer
269
+ # @since 1.0.26
270
+ # @return [Array]
271
+ def self.dotcom_ultimate
272
+ [
273
+ '[EDU Enterprise-Large] SaaS - Ultimate - 1 Year',
274
+ '[EDU Enterprise-Medium] SaaS - Ultimate - 1 Year',
275
+ '[EDU Enterprise-Small] SaaS - Ultimate - 1 Year',
276
+ '[EDU Enterprise-XLarge] SaaS - Ultimate - 1 Year',
277
+ '[EDU Program] SaaS - Support - 1 Year',
278
+ '[OSS Program] SaaS - Support - 1 Year',
279
+ '[Startups Program] SaaS - Support - 1 Year',
280
+ 'Gold - 1 Year (Reporter Access)',
281
+ 'Gold - 1 year EDU-Enterprise-Large (SaaS)',
282
+ 'Gold - 1 year EDU-Enterprise-Large (Self-Hosted)',
283
+ 'Gold - 1 year EDU-Enterprise-Medium (SaaS)',
284
+ 'Gold - 1 year EDU-Enterprise-Medium (Self-Hosted)',
285
+ 'Gold - 1 year EDU-Enterprise-Small (SaaS)',
286
+ 'Gold - 1 year EDU-Enterprise-Small (Self-Hosted)',
287
+ 'Gold - 1 year EDU-Enterprise-XLarge (SaaS)',
288
+ 'Gold - 1 year EDU-Enterprise-XLarge (Self-Hosted)',
289
+ 'Gold - 2 Year (Reporter Access)',
290
+ 'Gold - 3 Year (Reporter Access)',
291
+ 'Gold - Monthly',
292
+ 'Gold Plan',
293
+ 'Gold Plan - 1 Year (Y Combinator) w/ Support',
294
+ 'Gold Plan - 2 Year',
295
+ 'Gold Plan - 3 Year',
296
+ 'Gold Plan - 4 Year',
297
+ 'Gold Plan - 5 Year',
298
+ 'SaaS - Ultimate - 1 Year',
299
+ 'SaaS - Ultimate - 2 Year',
300
+ 'SaaS - Ultimate - 3 Year',
301
+ 'SaaS - Ultimate - 4 Year',
302
+ 'SaaS - Ultimate - 5 Year',
303
+ 'SaaS - Ultimate - Monthly'
304
+ ]
305
+ end
306
+
307
+ ##
308
+ # Defines Self-Managed => Starter subscriptions
309
+ #
310
+ # @author Jason Colyer
311
+ # @since 1.0.26
312
+ # @return [Array]
313
+ def self.sm_starter
314
+ [
315
+ 'Education (Starter) - 1 Year',
316
+ 'Education (Starter) - 2 Year',
317
+ 'Education (Starter) - 3 Year',
318
+ 'Education (Starter) - 4 Year',
319
+ 'Education (Starter) - 5 Year',
320
+ 'Education (Starter) - Monthly',
321
+ 'GitLab EE Starter',
322
+ 'GitLab EE Starter | 2 Year',
323
+ 'Standard | 2 Years',
324
+ 'Standard | 3 Years',
325
+ 'Standard | 4 Years',
326
+ 'Standard | 5 Years',
327
+ 'Standard | Annual',
328
+ 'Starter - 1 Year',
329
+ 'Starter - 2 Year',
330
+ 'Starter - 3 Year',
331
+ 'Starter - 4 Year',
332
+ 'Starter - 5 Year',
333
+ 'Starter - Monthly',
334
+ 'Starter - Monthly - 1 Year',
335
+ 'Starter - Monthly - 2 Year',
336
+ 'Starter - Monthly - 3 Year',
337
+ 'Starter - Monthly - 4 Year',
338
+ 'Starter - Monthly - 5 Year'
339
+ ]
340
+ end
341
+
342
+ ##
343
+ # Defines Self-Managed => Premium subscriptions
344
+ #
345
+ # @author Jason Colyer
346
+ # @since 1.0.26
347
+ # @return [Array]
348
+ def self.sm_premium
349
+ [
350
+ 'Education (Premium) - 1 Year',
351
+ 'GitLab EE Premium',
352
+ 'GitLab EE Premium | 3 Years',
353
+ 'GitLab EE Premium | 5 Years',
354
+ 'GitLab Enterprise Premium',
355
+ 'Premium - 1 Year',
356
+ 'Premium - 1 Year - Eval',
357
+ 'Premium - 1 Year (Guest Access)',
358
+ 'Premium - 1 Year (Reporter Access',
359
+ 'Premium - 2 Year',
360
+ 'Premium - 3 Year',
361
+ 'Premium - 4 Year',
362
+ 'Premium - 5 Year',
363
+ 'Premium - Monthly',
364
+ 'Premium - Monthly - 1 Year',
365
+ 'Premium - Monthly - 2 Year',
366
+ 'Premium - Monthly - 3 Year',
367
+ 'Premium - Monthly - 4 Year',
368
+ 'Premium - Monthly - 5 Year',
369
+ 'Premium - monthly (Guest Access)',
370
+ 'Premium Support',
371
+ 'Premium Support - 3 Years',
372
+ 'Self-Managed - Premium - 1 Year',
373
+ 'Self-Managed - Premium - 2 Year',
374
+ 'Self-Managed - Premium - 3 Year',
375
+ 'Self-Managed - Premium - 4 Year',
376
+ 'Self-Managed - Premium - 5 Year',
377
+ 'Self-Managed - Premium - Monthly'
378
+ ]
379
+ end
380
+
381
+ ##
382
+ # Defines Self-Managed => Ultimate subscriptions
383
+ #
384
+ # @author Jason Colyer
385
+ # @since 1.0.26
386
+ # @return [Array]
387
+ def self.sm_ultimate
388
+ [
389
+ '[EDU Enterprise-Large] Self-Managed - Ultimate - 1 Year',
390
+ '[EDU Enterprise-Medium] Self-Managed - Ultimate - 1 Year',
391
+ '[EDU Enterprise-Small] Self-Managed - Ultimate - 1 Year',
392
+ '[EDU Enterprise-XLarge] Self-Managed - Ultimate - 1 Year',
393
+ '[EDU Program] Self-Managed - Support - 1 Year',
394
+ '[EDU Program] Self-Managed - Support - 3 Year',
395
+ '[OSS Program] Self-Managed - Support - 1 Year',
396
+ '[Startups Program] Self-Managed - Support - 1 Year',
397
+ 'Education (Ultimate) - 1 Year',
398
+ 'Education (Ultimate) - 2 Year',
399
+ 'Education (Ultimate) - 3 Year',
400
+ 'Education (Ultimate) - 3 Year',
401
+ 'EE License',
402
+ 'GitLab EE Ultimate',
403
+ 'GitLab EE Ultimate | 2 Year',
404
+ 'GitLab EE Ultimate | 3 Year',
405
+ 'GitLab EE Ultimate | 5 Year',
406
+ 'GitLab EE Ultimate | Monthly',
407
+ 'GitLab Enterprise Edition',
408
+ 'GitLab Enterprise Edition - Monthly',
409
+ 'GitLab Enterprise Edition | 2 Years',
410
+ 'GitLab Enterprise Edition | 3 Years',
411
+ 'GitLab Enterprise Edition | 4 Years',
412
+ 'GitLab Enterprise Edition | 5 Years',
413
+ 'Plus | 2 Years',
414
+ 'Plus | 3 Years',
415
+ 'Plus | 4 Years',
416
+ 'Plus | 5 Years',
417
+ 'Plus | Annual',
418
+ 'Plus | Annual - 2 Year',
419
+ 'Self-Managed - Ultimate - 1 Year',
420
+ 'Self-Managed - Ultimate - 2 Year',
421
+ 'Self-Managed - Ultimate - 3 Year',
422
+ 'Self-Managed - Ultimate - 4 Year',
423
+ 'Self-Managed - Ultimate - 5 Year',
424
+ 'Self-Managed - Ultimate - Monthly',
425
+ 'Ultimate - 1 Year',
426
+ 'Ultimate - 1 Year (EDU or OSS) w/ Support',
427
+ 'Ultimate - 1 Year (Guest Access)',
428
+ 'Ultimate - 1 Year (Reporter Access)',
429
+ 'Ultimate - 1 Year (Y Combinator) w/ Support',
430
+ 'Ultimate - 1 year EDU-Enterprise-Large (SaaS)',
431
+ 'Ultimate - 1 year EDU-Enterprise-Large (Self-Hosted)',
432
+ 'Ultimate - 1 year EDU-Enterprise-Medium (SaaS)',
433
+ 'Ultimate - 1 year EDU-Enterprise-Medium (Self-Hosted)',
434
+ 'Ultimate - 1 year EDU-Enterprise-Small (SaaS)',
435
+ 'Ultimate - 1 year EDU-Enterprise-Small (Self-Hosted)',
436
+ 'Ultimate - 1 year EDU-Enterprise-XLarge (SaaS)',
437
+ 'Ultimate - 1 year EDU-Enterprise-XLarge (Self-Hosted)',
438
+ 'Ultimate - 2 Year',
439
+ 'Ultimate - 2 Year (Reporter Access)',
440
+ 'Ultimate - 3 Year',
441
+ 'Ultimate - 3 Year (EDU or OSS) w/ Support',
442
+ 'Ultimate - 4 Year',
443
+ 'Ultimate - 5 Year',
444
+ 'Ultimate - Monthly',
445
+ 'Ultimate - Monthly - 1 Year',
446
+ 'Ultimate - Monthly - 2 Year',
447
+ 'Ultimate - Monthly - 3 Year',
448
+ 'Ultimate - Monthly - 4 Year',
449
+ 'Ultimate - Monthly - 5 Year',
450
+ 'Ultimate Pack - 1 Year (AWS)',
451
+ 'Ultimate Pack - 2 Year (AWS)',
452
+ 'Ultimate Pack - 3 Year (AWS)',
453
+ 'Ultimate Pack - 4 Year (AWS)',
454
+ 'Ultimate Pack - 5 User Pack (AWS Hourly)',
455
+ 'Ultimate Pack - 5 Year (AWS)'
456
+ ]
457
+ end
458
+
459
+ ##
460
+ # Defines US Government => 12x5 subscriptions
461
+ #
462
+ # @author Jason Colyer
463
+ # @since 1.0.26
464
+ # @return [Array]
465
+ def self.usgov_12x5
466
+ [
467
+ '12x5 US Citizen Support - 1 Year',
468
+ '12x5 US Citizen Support - 2 Year',
469
+ '12x5 US Citizen Support - 3 Year',
470
+ '12x5 US Citizen Support - 4 Year',
471
+ '12x5 US Citizen Support - 5 Year',
472
+ '12x5 US Citizen Support - Monthly'
473
+ ]
474
+ end
475
+
476
+ ##
477
+ # Defines US Government => 24x7 subscriptions
478
+ #
479
+ # @author Jason Colyer
480
+ # @since 1.0.26
481
+ # @return [Array]
482
+ def self.usgov_24x7
483
+ [
484
+ '24x7 US Citizen Support - 1 Year',
485
+ '24x7 US Citizen Support - 2 Year',
486
+ '24x7 US Citizen Support - 3 Year',
487
+ '24x7 US Citizen Support - 4 Year',
488
+ '24x7 US Citizen Support - 5 Year',
489
+ '24x7 US Citizen Support - Monthly'
490
+ ]
491
+ end
492
+
493
+ ##
494
+ # Defines GitLab Dedicated subscriptions
495
+ #
496
+ # @author Jason Colyer
497
+ # @since 1.0.26
498
+ # @return [Array]
499
+ def self.gitlab_dedicated
500
+ [
501
+ 'Dedicated - Ultimate - 1 Year',
502
+ 'Dedicated - Ultimate - 2 Year',
503
+ 'Dedicated - Ultimate - 3 Year',
504
+ 'Dedicated - Ultimate - 4 Year',
505
+ 'Dedicated - Ultimate - 5 Year',
506
+ 'Dedicated - Ultimate - Monthly'
507
+ ]
508
+ end
509
+
510
+ ##
511
+ # Defines FedRAMP subscriptions
512
+ #
513
+ # @author Jason Colyer
514
+ # @since 1.0.26
515
+ # @return [Array]
516
+ def self.fedramp
517
+ [
518
+ 'GitLab Dedicated for US Public Sector - Ultimate - 1 Year',
519
+ 'GitLab Dedicated for US Public Sector - Ultimate - 2 Year',
520
+ 'GitLab Dedicated for US Public Sector - Ultimate - 3 Year',
521
+ 'GitLab Dedicated for US Public Sector - Ultimate - Monthly'
522
+ ]
523
+ end
524
+
525
+ ##
526
+ # Defines Community => EDU subscriptions
527
+ #
528
+ # @author Jason Colyer
529
+ # @since 1.0.26
530
+ # @return [Array]
531
+ def self.edu
532
+ [
533
+ '[EDU Program] SaaS - Ultimate - 1 Year',
534
+ '[EDU Program] Self-Managed - Ultimate - 1 Year',
535
+ '[EDU Program] Self-Managed - Ultimate - 3 Year',
536
+ 'Gold Plan - 1 Year (EDU or OSS)',
537
+ 'Ultimate - 1 Year (EDU or OSS)',
538
+ 'Ultimate - 1 Year (Y Combinator)'
539
+ ]
540
+ end
541
+
542
+ ##
543
+ # Defines Community => OSS subscriptions
544
+ #
545
+ # @author Jason Colyer
546
+ # @since 1.0.26
547
+ # @return [Array]
548
+ def self.oss
549
+ [
550
+ '[OSS Program] SaaS - Ultimate - 1 Year',
551
+ '[OSS Program] SaaS - Ultimate - 1 Year',
552
+ '[OSS Program] Self-Managed - Support - 3 Year',
553
+ '[OSS Program] Self-Managed - Ultimate - 1 Year',
554
+ '[OSS Program] Self-Managed - Ultimate - 3 Year'
555
+ ]
556
+ end
557
+
558
+ ##
559
+ # Defines Community => Other subscriptions
560
+ #
561
+ # @author Jason Colyer
562
+ # @since 1.0.26
563
+ # @return [Array]
564
+ def self.community_other
565
+ [
566
+ '[Startups Program] SaaS - Ultimate - 1 Year',
567
+ '[Startups Program] Self-Managed - Ultimate - 1 Year',
568
+ 'Gold Plan - 1 Year (Y Combinator)'
569
+ ]
570
+ end
571
+
572
+ ##
573
+ # Defines Support Services => ASE subscriptions
574
+ #
575
+ # @author Jason Colyer
576
+ # @since 1.0.26
577
+ # @return [Array]
578
+ def self.ss_ase
579
+ [
580
+ 'Dedicated - Success Plan Services - 1 Year',
581
+ 'Dedicated - Success Plan Services - 2 Year',
582
+ 'Dedicated - Success Plan Services - 3 Year',
583
+ 'Dedicated - Success Plan Services - Monthly',
584
+ 'SaaS - Assigned Support Engineer - 1 Year',
585
+ 'SaaS - Assigned Support Engineer - 2 Year',
586
+ 'SaaS - Assigned Support Engineer - 3 Year',
587
+ 'SaaS - Assigned Support Engineer - 4 Year',
588
+ 'SaaS - Assigned Support Engineer - 5 Year',
589
+ 'SaaS - Assigned Support Engineer - Monthly',
590
+ 'SaaS - Success Plan Services - 1 Year',
591
+ 'SaaS - Success Plan Services - 3 Year',
592
+ 'SaaS - Success Plan Services - Monthly',
593
+ 'SaaS- Success Plan Services - 2 Year',
594
+ 'Self-Managed - Assigned Support Engineer - 1 Year',
595
+ 'Self-Managed - Assigned Support Engineer - 2 Year',
596
+ 'Self-Managed - Assigned Support Engineer - 3 Year',
597
+ 'Self-Managed - Assigned Support Engineer - 4 Year',
598
+ 'Self-Managed - Assigned Support Engineer - 5 Year',
599
+ 'Self-Managed - Assigned Support Engineer - Monthly',
600
+ 'Self-Managed - Success Plan Services - 1 Year',
601
+ 'Self-Managed - Success Plan Services - 2 Year',
602
+ 'Self-Managed - Success Plan Services - 3 Year',
603
+ 'Self-Managed - Success Plan Services - Monthly'
604
+ ]
605
+ end
606
+ end
607
+ end
608
+ end
@@ -9,8 +9,10 @@ module Readiness
9
9
  module Salesforce
10
10
  require "#{__dir__}/salesforce/accounts"
11
11
  require "#{__dir__}/salesforce/cases"
12
+ require "#{__dir__}/salesforce/contacts"
12
13
  require "#{__dir__}/salesforce/client"
13
14
  require "#{__dir__}/salesforce/configuration"
14
15
  require "#{__dir__}/salesforce/queries"
16
+ require "#{__dir__}/salesforce/subscription_definitions"
15
17
  end
16
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_support_readiness
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.25
4
+ version: 1.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Colyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-18 00:00:00.000000000 Z
11
+ date: 2024-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -289,7 +289,9 @@ files:
289
289
  - lib/support_readiness/salesforce/cases.rb
290
290
  - lib/support_readiness/salesforce/client.rb
291
291
  - lib/support_readiness/salesforce/configuration.rb
292
+ - lib/support_readiness/salesforce/contacts.rb
292
293
  - lib/support_readiness/salesforce/queries.rb
294
+ - lib/support_readiness/salesforce/subscription_definitions.rb
293
295
  - lib/support_readiness/slack.rb
294
296
  - lib/support_readiness/slack/client.rb
295
297
  - lib/support_readiness/slack/configuration.rb