-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpartner-new.yaml
805 lines (803 loc) · 20 KB
/
partner-new.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
openapi: 3.0.0
info:
description: Partner domain APIs v1
title: Partner v1 entities
version: 'v1beta'
contact:
name: "Partner Core Domain Team"
email: "tbd@expedia.com"
url: "https://go/partner-domain"
x-eg-lifecycle: "PLANNED"
x-eg-tags: ["partner"]
servers:
- url: https://tools.us-west-2.test.customer-experience.expediagroup.com/partner
description: Test
paths:
/v1/partners:
get:
tags:
- Partner
summary: Search partners
description: Search partners by name
operationId: searchPartners
parameters:
- name: name
in: query
required: false
example: The Expedia Test Partner One
schema:
type: string
- name: exact_match
in: query
required: false
example: true
schema:
type: boolean
default: false
- name: status
in: query
required: false
example: ACTIVE
schema:
type: array
items:
type: string
enum:
- ACTIVE
- INACTIVE
- DELETED
default: []
- name: page_size
in: query
required: false
schema:
type: integer
format: int32
default: 100
- name: page_token
in: query
required: false
example: 1
schema:
type: string
default: ""
responses:
"200":
description: Partner results
content:
application/json:
schema:
$ref: '#/components/schemas/PartnerResults'
security:
- eg_auth:
- partner.partner.read
post:
tags:
- Partner
summary: Create new partner
description: Account will also be created for root partner (parent_partner_id=null)
operationId: createPartner
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Partner'
required: true
responses:
"201":
description: Partner is created
content:
application/json:
schema:
$ref: '#/components/schemas/PartnerHierarchy'
"404":
description: Parent partner is not found
security:
- eg_auth:
- partner.partner.create
/v1/partners/{partner_id}:
get:
tags:
- Partner
summary: Get partner
description: Get partner by ID and status
operationId: findPartner
parameters:
- name: partner_id
in: path
required: true
example: b00841d8-6034-4526-97dc-ddbe1d97a953
schema:
type: string
- name: status
in: query
required: false
example: ACTIVE
schema:
type: array
items:
type: string
enum:
- ACTIVE
- INACTIVE
- DELETED
default: []
responses:
"200":
description: Partner is found
content:
application/json:
schema:
$ref: '#/components/schemas/Partner'
"404":
description: Partner is not found
security:
- eg_auth:
- partner.partner.read
delete:
tags:
- Partner
summary: Delete partner
description: "Change status of the partner, its children and accounts to DELETED"
operationId: deletePartner
parameters:
- name: partner_id
in: path
required: true
example: 864b0854-3864-4f8c-848b-859c5ddcf1e0
schema:
type: string
responses:
"200":
description: Partner is deleted
"404":
description: Partner is not found
security:
- eg_auth:
- partner.partner.delete
patch:
tags:
- Partner
summary: Update partner
description: Update partner by ID
operationId: updatePartner
parameters:
- name: partner_id
in: path
required: true
example: b00841d8-6034-4526-97dc-ddbe1d97a953
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Partner'
required: true
responses:
"200":
description: Partner is updated
content:
application/json:
schema:
$ref: '#/components/schemas/Partner'
"404":
description: Partner is not found
security:
- eg_auth:
- partner.partner.update
/v1/partners/{partner_id}/hierarchy:
get:
tags:
- Partner
summary: Get partner hierarchy and accounts
description: Get partner hierarchy and accounts by ID
operationId: findPartnerHierarchy
parameters:
- name: partner_id
in: path
required: true
example: b00841d8-6034-4526-97dc-ddbe1d97a953
schema:
type: string
- name: children
in: query
required: false
example: true
schema:
type: boolean
default: false
- name: status
in: query
required: false
example: ACTIVE
schema:
type: array
items:
type: string
enum:
- ACTIVE
- INACTIVE
- DELETED
default: []
- name: max_depth
in: query
required: false
example: 10
schema:
type: integer
format: int32
default: 10
responses:
"200":
description: Partner is found
content:
application/json:
schema:
$ref: '#/components/schemas/PartnerHierarchy'
"404":
description: Partner is not found
security:
- eg_auth:
- partner.partner.read
- partner.partner-account.read
/v1/accounts:
get:
tags:
- Account
summary: Search accounts by number
operationId: findByAccountNumber
parameters:
- name: number
in: query
required: true
example: 4380627797
schema:
type: string
- name: status
in: query
required: false
example: ACTIVE
schema:
type: array
items:
type: string
enum:
- ACTIVE
- INACTIVE
- DELETED
default: []
responses:
default:
description: default response
content:
'*/*':
schema:
type: array
items:
$ref: '#/components/schemas/Account'
security:
- eg_auth: []
post:
tags:
- Account
summary: Create new account
operationId: create_1
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
required: true
responses:
"201":
description: Account is created
content:
'*/*':
schema:
$ref: '#/components/schemas/Account'
"404":
description: Partner is not found
security:
- eg_auth: []
/v1/accounts/{account_id}:
get:
tags:
- Account
summary: Get account by id
operationId: findByAccountId
parameters:
- name: account_id
in: path
required: true
example: 44ba7566-38f3-4488-b439-1e5a16ea1a63
schema:
type: string
- name: status
in: query
required: false
example: ACTIVE
schema:
type: array
items:
type: string
enum:
- ACTIVE
- INACTIVE
- DELETED
default: []
responses:
"404":
description: Account is not found
"200":
description: Account is found
content:
'*/*':
schema:
$ref: '#/components/schemas/Account'
security:
- eg_auth: []
delete:
tags:
- Account
summary: Delete account
description: Change status of the account to DELETED
operationId: delete
parameters:
- name: account_id
in: path
required: true
example: 7fbeccc4-83f9-463d-a2ff-99af0bf9d747
schema:
type: string
responses:
"200":
description: Account is deleted
"404":
description: Account is not found
security:
- eg_auth: []
/v1/partners/{partner_id}/accounts:
get:
tags:
- Account
operationId: findByPartnerId_1
parameters:
- name: partner_id
in: path
required: true
example: b00841d8-6034-4526-97dc-ddbe1d97a953
schema:
type: string
- name: status
in: query
required: false
example: ACTIVE
schema:
type: array
items:
type: string
enum:
- ACTIVE
- INACTIVE
- DELETED
default: []
responses:
"200":
description: OK
content:
'*/*':
schema:
type: array
items:
$ref: '#/components/schemas/Account'
security:
- eg_auth: []
/v1/users/accounts:
get:
tags:
- User
summary: Get user accounts
description: Get user accounts
operationId: getUserAccounts
responses:
"200":
description: User account results
content:
'*/*':
schema:
type: array
items:
$ref: '#/components/schemas/UserAccountInfo'
security:
- eg_auth:
- control-plane.partner-account.read
put:
tags:
- User
summary: Grant user role to account
description: Grant user role to account
operationId: addUserAccount
deprecated: false
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UserAccount'
required: true
responses:
"200":
description: Relation is added
content:
'*/*':
schema:
$ref: '#/components/schemas/UserAccount'
security:
- eg_auth:
- control-plane.partner-account.update
components:
schemas:
Address:
required:
- city
- country
- line1
- state
type: object
properties:
line1:
maxLength: 500
minLength: 0
type: string
example: line1
line2:
maxLength: 500
minLength: 0
type: string
example: line2
line3:
maxLength: 500
minLength: 0
type: string
example: line3
city:
maxLength: 100
minLength: 0
type: string
example: Atlanta
state:
maxLength: 100
minLength: 0
type: string
example: AT
country:
maxLength: 100
minLength: 0
type: string
example: USA
postal_code:
maxLength: 100
minLength: 0
type: string
example: 232343
Contact:
type: object
properties:
name:
maxLength: 500
minLength: 0
type: string
example: Name
email:
maxLength: 500
minLength: 0
type: string
example: email@example.com
addresses:
maxItems: 100
minItems: 0
type: array
items:
$ref: '#/components/schemas/Address'
phones:
maxItems: 100
minItems: 0
type: array
items:
$ref: '#/components/schemas/Phone'
Partner:
required:
- name
type: object
properties:
partner_id:
type: string
readOnly: true
example: 0a1ea7ec-d847-441e-8db6-b60b524f2999
name:
maxLength: 500
minLength: 0
type: string
example: The Expedia Partner
type:
type: string
example: ORGANIZATION
enum:
- ORGANIZATION
- INDIVIDUAL
status:
type: string
example: ACTIVE
enum:
- ACTIVE
- INACTIVE
- DELETED
parent_partner_id:
type: string
example: 50030eeb-dfb1-49e7-8b8d-a6b8421697d1
interests:
maxItems: 100
minItems: 0
type: array
example: SUPPLY
items:
type: string
example: SUPPLY
enum:
- SUPPLY
- TRAVEL_STORE
contacts:
maxItems: 10
minItems: 0
type: array
items:
$ref: '#/components/schemas/Contact'
email:
maxLength: 500
minLength: 0
type: string
example: email@example.com
website:
maxLength: 500
minLength: 0
type: string
addresses:
maxItems: 10
minItems: 0
type: array
items:
$ref: '#/components/schemas/Address'
phones:
maxItems: 10
minItems: 0
type: array
items:
$ref: '#/components/schemas/Phone'
updated_date:
type: string
format: string
pattern: "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
example: "2021-07-23T05:02:42.619Z"
readOnly: true
updated_user:
type: string
readOnly: true
Phone:
required:
- number
type: object
properties:
number:
maxLength: 100
minLength: 0
type: string
example: (001) 222-333-444
type:
type: string
example: WORK
enum:
- WORK
- HOME
- MOBILE
Account:
required:
- name
type: object
properties:
account_id:
type: string
readOnly: true
example: 28541c06-06c0-4dc1-b048-56f31b349666
name:
maxLength: 500
minLength: 0
type: string
number:
type: string
readOnly: true
example: 4380627797
status:
type: string
example: ACTIVE
enum:
- ACTIVE
- INACTIVE
- DELETED
partner_id:
type: string
example: b00841d8-6034-4526-97dc-ddbe1d97a953
type:
type: string
example: ignore
enum:
- ROOT
- USER
updated_date:
type: string
format: string
pattern: "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
example: "2021-07-23T05:02:42.619Z"
readOnly: true
updated_user:
type: string
readOnly: true
PartnerHierarchy:
required:
- accounts
- hierarchy
type: object
properties:
partner_id:
type: string
readOnly: true
example: 0a1ea7ec-d847-441e-8db6-b60b524f23a7
name:
maxLength: 500
minLength: 0
type: string
type:
type: string
enum:
- ORGANIZATION
- INDIVIDUAL
status:
type: string
example: ACTIVE
enum:
- ACTIVE
- INACTIVE
- DELETED
parent_partner_id:
type: string
example: 50030eeb-dfb1-49e7-8b8d-a6b8421697d1
interests:
maxItems: 100
minItems: 0
type: array
example: SUPPLY
items:
type: string
example: SUPPLY
enum:
- SUPPLY
- TRAVEL_STORE
contacts:
maxItems: 10
minItems: 0
type: array
items:
$ref: '#/components/schemas/Contact'
email:
maxLength: 500
minLength: 0
type: string
example: email@example.com
website:
maxLength: 500
minLength: 0
type: string
addresses:
maxItems: 10
minItems: 0
type: array
items:
$ref: '#/components/schemas/Address'
phones:
maxItems: 10
minItems: 0
type: array
items:
$ref: '#/components/schemas/Phone'
updated_date:
type: string
format: date-time
readOnly: true
updated_user:
type: string
readOnly: true
accounts:
type: array
items:
$ref: '#/components/schemas/Account'
hierarchy:
type: array
items:
$ref: '#/components/schemas/PartnerHierarchy'
UserAccount:
required:
- account_id
- role_id
- user_id
type: object
properties:
user_id:
type: string
example: user
role_id:
type: string
example: administrator
account_id:
type: string
example: 44ba7566-38f3-4488-b439-1e5a16ea1a63
UserAccountInfo:
required:
- account_id
- account_name
- partner_id
- partner_name
- role_id
- user_id
type: object
properties:
user_id:
type: string
example: user
role_id:
type: string
example: administrator
account_id:
type: string
example: 28541c06-06c0-4dc1-b048-56f31b349687
account_name:
type: string
example: Partner1
partner_id:
type: string
example: 0a1ea7ec-d847-441e-8db6-b60b524f23a9
partner_name:
type: string
example: Partner1
PartnerResults:
required:
- next_page_token
- page_size
- results
type: object
properties:
results:
type: array
items:
$ref: '#/components/schemas/Partner'
page_size:
type: integer
format: int32
example: 10
next_page_token:
type: string
securitySchemes:
eg_auth:
type: oauth2
flows:
clientCredentials:
tokenUrl: /oauth/token?grant_type=client_credentials
scopes:
partner.clients.create: Create a client of the Partner domain
partner.clients-onboarding-workflow.create: Create an onboarding workflow
partner.clients-creation-requirements.create: Define the partner creation data requirements
partner.clients-notification-preferences.create: Define the partner creation data requirements
partner.clients-config-schema.create: Define the partner configuration schema
partner.partners.create: Create a partner
partner.partners.read: Read all partners
partner.partners-accounts.create: Create a partner account to organize access controls and configurations at a more granular level
partner.partners-accounts.read: Read partner accounts for a partner
partner.partners-account-capabilities.read: Get all capabilities that the partner account has signed up for