1 /**
2 * @oas [post] /admin/regions/{id}
3 * operationId: PostRegionsId
4 * summary: Update a Region
5 * description: Update a region's details.
6 * x-authenticated: true
7 * parameters:
8 * - name: id
9 * in: path
10 * description: The region's ID.
11 * required: true
12 * schema:
13 * type: string
14 * - name: fields
15 * in: query
16 * description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
17 * fields. without prefix it will replace the entire default fields.
18 * required: false
19 * schema:
20 * type: string
21 * title: fields
22 * description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
23 * fields. without prefix it will replace the entire default fields.
24 * externalDocs:
25 * url: "#select-fields-and-relations"
26 * security:
27 * - api_token: []
28 * - cookie_auth: []
29 * - jwt_token: []
30 * requestBody:
31 * content:
32 * application/json:
33 * schema:
34 * $ref: "#/components/schemas/AdminUpdateRegion"
35 * x-codeSamples:
36 * - lang: JavaScript
37 * label: JS SDK
38 * source: |-
39 * import Medusa from "@medusajs/js-sdk"
40 *
41 * export const sdk = new Medusa({
42 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
43 * debug: import.meta.env.DEV,
44 * auth: {
45 * type: "session",
46 * },
47 * })
48 *
49 * sdk.admin.region.update("region_123", {
50 * name: "United States",
51 * })
52 * .then(({ region }) => {
53 * console.log(region)
54 * })
55 * - lang: Shell
56 * label: cURL
57 * source: |-
58 * curl -X POST '{backend_url}/admin/regions/{id}' \
59 * -H 'Authorization: Bearer {jwt_token}' \
60 * -H 'Content-Type: application/json' \
61 * --data-raw '{
62 * "metadata": {}
63 * }'
64 * tags:
65 * - Regions
66 * responses:
67 * "200":
68 * description: OK
69 * content:
70 * application/json:
71 * schema:
72 * $ref: "#/components/schemas/AdminRegionResponse"
73 * "400":
74 * $ref: "#/components/responses/400_error"
75 * "401":
76 * $ref: "#/components/responses/unauthorized"
77 * "404":
78 * $ref: "#/components/responses/not_found_error"
79 * "409":
80 * $ref: "#/components/responses/invalid_state_error"
81 * "422":
82 * $ref: "#/components/responses/invalid_request_error"
83 * "500":
84 * $ref: "#/components/responses/500_error"
85 * x-workflow: updateRegionsWorkflow
86 * x-events:
87 * - name: region.updated
88 * payload: |-
89 * ```ts
90 * {
91 * id, // The ID of the region
92 * }
93 * ```
94 * description: Emitted when regions are updated.
95 * deprecated: false
96 *
97 */
98