{
  "openapi": "3.0.0",
  "info": {
    "description": "## Introduction\n\nWith the IBM Cloud® Context-based restrictions Management API, you can create, update, view, and delete context-based restriction rules and contexts, and view account settings. You can define ingress rules for IBM Cloud® resources based on the context of access requests by using context-based restrictions.\n\nContexts and rules are the main components that make up context-based restrictions.\n\nRules are used in access decisions when you call service APIs. Contexts can be made up of one or more endpoint types, which are the connection over which an access request is received, and network zones, which are an allowlist of IP addresses and VPCs. For more information about how restrictions work, see [What are context-based restrictions?](https://cloud.ibm.com/docs/account?topic=account-context-restrictions-whatis).\n\nThe following shows an example of a context-based restrictions rule:\n\nResource     | Contexts\n------------ | -------------\nAll COS buckets in instance XYZ | 1. Zone: A.  \\n  \\n 2. Zone: B or C, Type: \"private\"\n\nA context allows access only if all its conditions are satisfied. That is, the request must originate from at least one of the specified network zones if any, and be received over a connection that matches one of the specified endpoint types, if any.\n\nIf no rules are applicable to the request, access is not restricted based on context, and is determined exclusively by Identity and Access Management (IAM) access policies.\n\nInstalling the Java SDK\n\nMaven\n\n```xml\n<dependency>\n\t<groupId>com.ibm.cloud</groupId>\n\t<artifactId>context-based-restrictions</artifactId>\n\t<version>{version}</version>\n</dependency>\n```\n\nGradle\n\n```bash\ncompile 'com.ibm.cloud:context-based-restrictions:{version}'\n```\n\nReplace `{version}` in these examples with the release version.\n\nView on GitHub\n\n[https://github.com/IBM/platform-services-java-sdk](https://github.com/IBM/platform-services-java-sdk)\n\nInstalling the Node SDK\n\n```bash\nnpm install @ibm-cloud/platform-services\n```\n\nView on GitHub\n\n[https://github.com/IBM/platform-services-node-sdk](https://github.com/IBM/platform-services-node-sdk)\n\nInstalling the Python SDK\n\n```bash\npip install --upgrade \"ibm-platform-services\"\n```\n\nView on GitHub\n\n[https://github.com/IBM/platform-services-python-sdk](https://github.com/IBM/platform-services-python-sdk)\n\nInstalling the Go SDK\n\nGo modules (recommended): Add the following import to your code and then run `go build` or `go mod tidy`\n\n```go\nimport (\n\t\"github.com/IBM/platform-services-go-sdk/contextbasedrestrictionsv1\"\n)\n```\n\nGo get\n\n```bash\ngo get -u github.com/IBM/platform-services-go-sdk/contextbasedrestrictionsv1\n```\n\nView on GitHub\n\n[https://github.com/IBM/platform-services-go-sdk](https://github.com/IBM/platform-services-go-sdk)\n\n### Network Zones\n\nA network zone is an allowlist of IP addresses, VPCs, and service references that represents the location from which an access request originates. Network zones can be shared among any number of context-based restrictions in the account. These zones contain a unique name, description, and an account ID.\n\nA set of one or more network locations in a network zone can be specified by using the following constructs:\n* IP addresses, which include individual addresses, ranges, or subnets. IPv4 and IPv6 are supported.\n* VPCs (to allow access from the VPC over the private network)\n* Service references, which allow access from other IBM Cloud® services.\n\n### Rules\n\nRules apply access restrictions to resources based on the originating context of the access request. For example, a network zone and an endpoint type can make up a context.\n\nIf multiple rules are applicable to a particular request, access is allowed only if all applicable rules allow access. This might be the case if rules are defined at different granularities. For example, a rule applicable to the Users service that allows access only from a private endpoint, and another rule applicable to the Users service only from a specific set of IP addresses.\n\n## Endpoint URLs\n\nThe Context-based restrictions Management API uses the following public global endpoint URL. When you call the API, add the path for each method to form the complete API endpoint for your requests.\n\n```bash\nhttps://cbr.cloud.ibm.com\n```\n\nVirtual Private Cloud (VPC) based access requires a virtual private endpoint (VPE) gateway. For more information , see [Creating an endpoint gateway](https://cloud.ibm.com/docs/vpc?topic=vpc-ordering-endpoint-gateway).\n* Private endpoint URL for VPC infrastructure: `https://private.cbr.cloud.ibm.com`. VPE gateway creation is supported in following datacenters:\n    * Dallas\n    * Washington\n    * Frankfurt\n\nIf you enabled service endpoints in your account, you can send API requests over the IBM Cloud private network at the following base endpoint URLs. For more information, see [Enabling VRF and service endpoints](https://cloud.ibm.com/docs/account?topic=account-vrf-service-endpoint).\n\n* Private endpoint URLs for classic infrastructure. Supported datacenters and urls:\n    * Dallas: `https://private.us-south.cbr.cloud.ibm.com`\n    * Washington DC: `https://private.us-east.cbr.cloud.ibm.com`\n\t* Frankfurt: `https://private.eu-de.cbr.cloud.ibm.com`\n\n## Authentication\n\nAuthorization to this API is enforced by using an IBM Cloud IAM access token. The token is used to determine the actions that a user or service ID has access to when they use the API.\n\nObtaining an IAM token for an authenticated user or service ID is described in the [IAM Identity Services API](https://cloud.ibm.com/apidocs/iam-identity-token-api) documentation.\n\n## Auditing\n\nYou can monitor API activity within your account by using the IBM Cloud Activity Tracker service. When an API method is called, an event is generated that you can then track and audit from within Activity Tracker. Methods that generate events include administrator operations on Context-based restriction rules and network zones only, such as `create`, `delete`, and `list`. For methods that generate these events, the specific event type is listed with each individual method.\n\n## Error handling\n\nThis API uses standard HTTP response codes to indicate whether a method completed successfully. A `200` response indicates success. A `400` type response indicates a failure, and a `500` type response indicates an internal system error.\n\n| HTTP Error Code | Description | Recovery |\n|-----------------|-------------|----------|\n| `200` | Success | The request was successful. |\n| `201` | Created | The resource was successfully created. |\n| `204` | No Content | The request was successful. No response body is provided. |\n| `400` | Bad Request | The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all required parameters in your request. |\n| `401` | Unauthorized | You are not authorized to make this request. |\n| `403` | Forbidden | The supplied authentication is not authorized to access the endpoint. |\n| `404` | Not Found | The requested resource can't be found. |\n| `409` | Conflict | The entity is already in the requested state. |\n| `500` | Service Unavailable | Context-based restrictions are currently unavailable. Your request can't be processed. Wait a few minutes and try again. |\n\n### Transaction-Id\nAn optional transaction ID can be passed to your request, which can be useful for tracking calls through multiple services by using one identifier. The header key must be set to `Transaction-Id` and the value is anything that you choose.\n\nIf no transaction ID is passed in, then a random ID is generated.\n\n## Related APIs\n\nWhen you work with the context-based restrictions management API, you might need to work with other IAM services. For example, the following APIs:\n\n* See [IAM Access Groups](https://cloud.ibm.com/apidocs/iam-access-groups) to create groups and manage memberships.\n* See [IAM Identity Service](https://cloud.ibm.com/apidocs/iam-identity-token-api) to learn about API key, service ID, and token creation.\n* See [IAM Policy Management](https://cloud.ibm.com/apidocs/iam-policy-management) to enable a subject to access a resource.",
    "version": "1.0.1",
    "title": "Context Based Restrictions",
    "x-codegen-config": {
      "improvedNameFormattingV2": true,
      "cli": {
        "apiPackage": "cli-cbr-plugin",
        "cliPluginName": "cbr",
        "singleServicePlugin": true
      },
      "go": {
        "apiPackage": "github.com/IBM/platform-services-go-sdk"
      },
      "java": {
        "apiPackage": "com.ibm.cloud.platform_services"
      },
      "python": {
        "apiPackage": "ibm_platform_services"
      }
    },
    "x-github": "https://github.ibm.com/cloud-api-docs/context-based-restrictions",
    "x-github-issues": "https://github.ibm.com/cloud-api-docs/context-based-restrictions/issues/new",
    "x-last-updated": "2022-12-08"
  },
  "tags": [
    {
      "name": "Zones",
      "description": "Operations on network zones"
    },
    {
      "name": "Rules",
      "description": "Operations on context-based restriction rules"
    },
    {
      "name": "Account settings",
      "description": "Operations on account settings"
    }
  ],
  "security": [
    {
      "IamToken": []
    }
  ],
  "servers": [
    {
      "url": "https://cbr.cloud.ibm.com",
      "description": "Production server"
    },
    {
      "url": "https://cbr.test.cloud.ibm.com",
      "description": "Test server"
    }
  ],
  "paths": {
    "/v1/zones": {
      "parameters": [
        {
          "$ref": "#/components/parameters/x_correlation_id_in_header"
        },
        {
          "$ref": "#/components/parameters/transaction_id_in_header"
        }
      ],
      "post": {
        "tags": [
          "Zones"
        ],
        "summary": "Create a network zone",
        "operationId": "create_zone",
        "description": "This operation creates a network zone for the specified account.",
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "context-based-restrictions.zone.create"
            }
          ]
        },
        "x-cli-command": "zone-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewZone"
              },
              "example": {
                "name": "an example of zone",
                "description": "this is an example of zone",
                "account_id": "12ab34cd56ef78ab90cd12ef34ab56cd",
                "addresses": [
                  {
                    "type": "ipAddress",
                    "value": "169.23.56.234"
                  },
                  {
                    "type": "ipAddress",
                    "value": "3ffe:1900:fe21:4545::"
                  },
                  {
                    "type": "ipRange",
                    "value": "169.23.22.0-169.23.22.255"
                  },
                  {
                    "type": "ipRange",
                    "value": "3ffe:1900:fe21:4545::-3ffe:1900:fe21:6767::"
                  },
                  {
                    "type": "subnet",
                    "value": "192.0.2.0/24"
                  },
                  {
                    "type": "vpc",
                    "value": "crn:v1:bluemix:public:is:us-south:a/12ab34cd56ef78ab90cd12ef34ab56cd::vpc:r134-d98a1702-b39a-449a-86d4-ef8dbacf281e"
                  },
                  {
                    "type": "serviceRef",
                    "ref": {
                      "account_id": "12ab34cd56ef78ab90cd12ef34ab56cd",
                      "service_name": "cloud-object-storage"
                    }
                  }
                ],
                "excluded": [
                  {
                    "type": "ipAddress",
                    "value": "169.23.22.127"
                  }
                ]
              }
            }
          },
          "description": "The network zone to create."
        },
        "responses": {
          "201": {
            "description": "Network zone created.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/etag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Zone"
                },
                "example": {
                  "id": "65810ac762004f22ac19f8f8edf70a34",
                  "crn": "crn:v1:bluemix:public:context-based-restrictions:global:a/12ab34cd56ef78ab90cd12ef34ab56cd::zone:65810ac762004f22ac19f8f8edf70a34",
                  "name": "an example of zone",
                  "description": "this is an example of zone",
                  "account_id": "12ab34cd56ef78ab90cd12ef34ab56cd",
                  "addresses": [
                    {
                      "type": "ipAddress",
                      "value": "169.23.56.234"
                    },
                    {
                      "type": "ipAddress",
                      "value": "3ffe:1900:fe21:4545::"
                    },
                    {
                      "type": "ipRange",
                      "value": "169.23.22.0-169.23.22.255"
                    },
                    {
                      "type": "ipRange",
                      "value": "3ffe:1900:fe21:4545::-3ffe:1900:fe21:6767::"
                    },
                    {
                      "type": "subnet",
                      "value": "192.0.2.0/24"
                    },
                    {
                      "type": "vpc",
                      "value": "crn:v1:bluemix:public:is:us-south:a/12ab34cd56ef78ab90cd12ef34ab56cd::vpc:r134-d98a1702-b39a-449a-86d4-ef8dbacf281e"
                    }
                  ],
                  "excluded": [
                    {
                      "type": "ipAddress",
                      "value": "169.23.22.127"
                    }
                  ],
                  "address_count": 6,
                  "excluded_count": 1,
                  "href": "https://cbr.cloud.ibm.com/v1/zones/65810ac762004f22ac19f8f8edf70a34",
                  "created_at": "2020-11-23T02:01:59Z",
                  "created_by_id": "IBMid-120000P1JM",
                  "last_modified_at": "2020-11-23T02:01:59Z",
                  "last_modified_by_id": "IBMid-120000P1JM"
                }
              }
            }
          },
          "400": {
            "description": "The network zone could not be created due to an invalid or missing input parameter or request body.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 400,
                  "errors": [
                    {
                      "code": "request_body_error",
                      "message": "The request body has an error.",
                      "cause": "property `account_id` is missing"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "You are not authorized to make this request. The token is either missing, invalid, or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 401,
                  "errors": [
                    {
                      "code": "invalid_auth_token",
                      "message": "The token failed to validate.",
                      "target": {
                        "name": "Authorization",
                        "type": "header"
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The supplied authentication is not authorized to perform the operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 403,
                  "errors": [
                    {
                      "code": "request_not_authorized",
                      "message": "The request could not be authorized."
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "The network zone could not be created due to an already existing zone with the same name.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 409,
                  "errors": [
                    {
                      "code": "zone_already_exists_in_store",
                      "message": "A zone with the same name already exists. Assign each zone a unique name.",
                      "target": {
                        "name": "name",
                        "type": "field",
                        "value": "an-already-existing-zone-name"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 429,
                  "errors": [
                    {
                      "code": "too_many_requests",
                      "message": "The client has sent too many requests in a given amount of time."
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "A backend service required to complete the operation is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 503,
                  "errors": [
                    {
                      "code": "store_unavailable_error",
                      "message": "The store is currently unavailable. Try again later."
                    }
                  ]
                }
              }
            }
          }
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X POST --location --header \"Authorization: Bearer {iam_token}\" \\\n",
                      "  --header \"Accept: application/json\" \\\n",
                      "  --header \"Content-Type: application/json\" \\\n",
                      "  --data '{ \"name\": \"an example of zone\", \"description\": \"this is an example of zone\", \"account_id\": \"12ab34cd56ef78ab90cd12ef34ab56cd\", \"addresses\": [ { \"type\": \"ipAddress\", \"value\": \"169.23.56.234\" }, { \"type\": \"ipAddress\", \"value\": \"3ffe:1900:fe21:4545::\" }, { \"type\": \"ipRange\", \"value\": \"169.23.22.0-169.23.22.255\" }, { \"type\": \"ipRange\", \"value\": \"3ffe:1900:fe21:4545::-3ffe:1900:fe21:6767::\" }, { \"type\": \"subnet\", \"value\": \"192.0.2.0/24\" }, { \"type\": \"vpc\", \"value\": \"crn:v1:bluemix:public:is:us-south:a/12ab34cd56ef78ab90cd12ef34ab56cd::vpc:r134-d98a1702-b39a-449a-86d4-ef8dbacf281e\" }, { \"type\": \"serviceRef\", \"ref\": { \"account_id\": \"12ab34cd56ef78ab90cd12ef34ab56cd\", \"service_name\": \"cloud-object-storage\" } } ], \"excluded\": [ { \"type\": \"ipAddress\", \"value\": \"169.23.22.127\" } ] }' \\\n",
                      "  \"https://cbr.cloud.ibm.com/v1/zones\""
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "ipAddressModel := &contextbasedrestrictionsv1.AddressIPAddress{\n",
                      "  Type:  core.StringPtr(\"ipAddress\"),\n",
                      "  Value: core.StringPtr(\"169.23.56.234\"),\n",
                      "}\n",
                      "ipAddressV6Model := &contextbasedrestrictionsv1.AddressIPAddress{\n",
                      "  Type:  core.StringPtr(\"ipAddress\"),\n",
                      "  Value: core.StringPtr(\"3ffe:1900:fe21:4545::\"),\n",
                      "}\n",
                      "ipRangeAddressModel := &contextbasedrestrictionsv1.AddressIPAddressRange{\n",
                      "  Type:  core.StringPtr(\"ipRange\"),\n",
                      "  Value: core.StringPtr(\"169.23.22.0-169.23.22.255\"),\n",
                      "}\n",
                      "ipRangeAddressV6Model := &contextbasedrestrictionsv1.AddressIPAddressRange{\n",
                      "  Type:  core.StringPtr(\"ipRange\"),\n",
                      "  Value: core.StringPtr(\"3ffe:1900:fe21:4545::-3ffe:1900:fe21:6767::\"),\n",
                      "}\n",
                      "subnetAddressModel := &contextbasedrestrictionsv1.AddressSubnet{\n",
                      "  Type:  core.StringPtr(\"subnet\"),\n",
                      "  Value: core.StringPtr(\"192.0.2.0/24\"),\n",
                      "}\n",
                      "vpcAddressModel := &contextbasedrestrictionsv1.AddressVPC{\n",
                      "  Type:  core.StringPtr(\"vpc\"),\n",
                      "  Value: core.StringPtr(vpcCRN),\n",
                      "}\n",
                      "serviceRefAddressModel := &contextbasedrestrictionsv1.AddressServiceRef{\n",
                      "  Type: core.StringPtr(\"serviceRef\"),\n",
                      "  Ref: &contextbasedrestrictionsv1.ServiceRefValue{\n",
                      "    AccountID:   core.StringPtr(accountID),\n",
                      "    ServiceName: core.StringPtr(\"cloud-object-storage\"),\n",
                      "  },\n",
                      "}\n",
                      "excludedIPAddressModel := &contextbasedrestrictionsv1.AddressIPAddress{\n",
                      "  Type:  core.StringPtr(\"ipAddress\"),\n",
                      "  Value: core.StringPtr(\"169.23.22.127\"),\n",
                      "}\n",
                      "\n",
                      "createZoneOptions := contextBasedRestrictionsService.NewCreateZoneOptions()\n",
                      "createZoneOptions.SetName(\"an example of zone\")\n",
                      "createZoneOptions.SetAccountID(accountID)\n",
                      "createZoneOptions.SetDescription(\"this is an example of zone\")\n",
                      "createZoneOptions.SetAddresses([]contextbasedrestrictionsv1.AddressIntf{ipAddressModel, ipAddressV6Model, ipRangeAddressModel, ipRangeAddressV6Model, subnetAddressModel, vpcAddressModel, serviceRefAddressModel})\n",
                      "createZoneOptions.SetExcluded([]contextbasedrestrictionsv1.AddressIntf{excludedIPAddressModel})\n",
                      "\n",
                      "zone, response, err := contextBasedRestrictionsService.CreateZone(createZoneOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(zone, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "AddressIPAddress ipAddressModel = new AddressIPAddress.Builder()\n",
                      "  .type(\"ipAddress\")\n",
                      "  .value(\"169.23.56.234\")\n",
                      "  .build();\n",
                      "AddressIPAddress ipAddressV6Model = new AddressIPAddress.Builder()\n",
                      "  .type(\"ipAddress\")\n",
                      "  .value(\"3ffe:1900:fe21:4545::\")\n",
                      "  .build();\n",
                      "AddressIPAddressRange ipRangeAddressModel = new AddressIPAddressRange.Builder()\n",
                      "  .type(\"ipRange\")\n",
                      "  .value(\"169.23.22.0-169.23.22.255\")\n",
                      "  .build();\n",
                      "AddressIPAddressRange ipRangeAddressV6Model = new AddressIPAddressRange.Builder()\n",
                      "  .type(\"ipRange\")\n",
                      "  .value(\"3ffe:1900:fe21:4545::-3ffe:1900:fe21:6767::\")\n",
                      "  .build();\n",
                      "AddressSubnet subnetAddressModel = new AddressSubnet.Builder()\n",
                      "  .type(\"subnet\")\n",
                      "  .value(\"192.0.2.0/24\")\n",
                      "  .build();\n",
                      "AddressVPC vpcAddressModel = new AddressVPC.Builder()\n",
                      "  .type(\"vpc\")\n",
                      "  .value(vpcCRN)\n",
                      "  .build();\n",
                      "ServiceRefValue serviceRefValueModel = new ServiceRefValue.Builder()\n",
                      "  .accountId(accountID)\n",
                      "  .serviceName(\"cloud-object-storage\")\n",
                      "  .build();\n",
                      "AddressServiceRef serviceRefAddressModel = new AddressServiceRef.Builder()\n",
                      "  .type(\"serviceRef\")\n",
                      "  .ref(serviceRefValueModel)\n",
                      "  .build();\n",
                      "AddressIPAddress excludedIPAddressModel = new AddressIPAddress.Builder()\n",
                      "  .type(\"ipAddress\")\n",
                      "  .value(\"169.23.22.127\")\n",
                      "  .build();\n",
                      "CreateZoneOptions createZoneOptions = new CreateZoneOptions.Builder()\n",
                      "  .name(\"an example of zone\")\n",
                      "  .accountId(accountID)\n",
                      "  .description(\"this is an example of zone\")\n",
                      "  .addresses(java.util.Arrays.asList(ipAddressModel, ipAddressV6Model, ipRangeAddressModel, ipRangeAddressV6Model, subnetAddressModel, vpcAddressModel, serviceRefAddressModel))\n",
                      "  .excluded(java.util.Arrays.asList(excludedIPAddressModel))\n",
                      "  .build();\n",
                      "\n",
                      "Response<Zone> response = contextBasedRestrictionsService.createZone(createZoneOptions).execute();\n",
                      "Zone zone = response.getResult();\n",
                      "\n",
                      "System.out.println(zone);"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "// Request models needed by this operation.\n",
                      "\n",
                      "// AddressIPAddress\n",
                      "const ipAddressModel = {\n",
                      "  type: 'ipAddress',\n",
                      "  value: '169.23.56.234',\n",
                      "};\n",
                      "const ipAddressV6Model = {\n",
                      "  type: 'ipAddress',\n",
                      "  value: '3ffe:1900:fe21:4545::',\n",
                      "};\n",
                      "// AddressIPAddressRange\n",
                      "const ipRangeAddressModel = {\n",
                      "  type: 'ipRange',\n",
                      "  value: '169.23.22.0-169.23.22.255',\n",
                      "};\n",
                      "const ipRangeAddressV6Model = {\n",
                      "  type: 'ipRange',\n",
                      "  value: '3ffe:1900:fe21:4545::-3ffe:1900:fe21:6767::',\n",
                      "};\n",
                      "// AddressSubnet\n",
                      "const subnetAddressModel = {\n",
                      "  type: 'subnet',\n",
                      "  value: '192.0.2.0/24',\n",
                      "};\n",
                      "// AddressVPC\n",
                      "const vpcAddressModel = {\n",
                      "  type: 'vpc',\n",
                      "  value: vpcCRN,\n",
                      "};\n",
                      "// AddressServiceRef\n",
                      "const serviceRefAddressModel = {\n",
                      "  type: 'serviceRef',\n",
                      "  ref: {\n",
                      "    account_id: accountId,\n",
                      "    service_name: 'cloud-object-storage',\n",
                      "  },\n",
                      "};\n",
                      "// AddressIPAddress\n",
                      "const excludedIPAddressModel = {\n",
                      "  type: 'ipAddress',\n",
                      "  value: '169.23.22.127',\n",
                      "};\n",
                      "\n",
                      "const params = {\n",
                      "  name: 'an example of zone',\n",
                      "  accountId,\n",
                      "  addresses: [ipAddressModel, ipAddressV6Model, ipRangeAddressModel, ipRangeAddressV6Model, subnetAddressModel, vpcAddressModel, serviceRefAddressModel],\n",
                      "  excluded: [excludedIPAddressModel],\n",
                      "  description: 'this is an example of zone',\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  const res = await contextBasedRestrictionsService.createZone(params);\n",
                      "  zoneId = res.result.id;\n",
                      "  zoneRev = res.headers.etag;\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "ip_address_model = {\n",
                      "  'type': 'ipAddress',\n",
                      "  'value': '169.23.56.234',\n",
                      "}\n",
                      "ip_address_v6_model = {\n",
                      "  'type': 'ipAddress',\n",
                      "  'value': '3ffe:1900:fe21:4545::',\n",
                      "}\n",
                      "ip_range_address_model = {\n",
                      "  'type': 'ipRange',\n",
                      "  'value': '169.23.22.0-169.23.22.255',\n",
                      "}\n",
                      "ip_range_address_v6_model = {\n",
                      "  'type': 'ipRange',\n",
                      "  'value': '3ffe:1900:fe21:4545::-3ffe:1900:fe21:6767::',\n",
                      "}\n",
                      "subnet_address_model = {\n",
                      "  'type': 'subnet',\n",
                      "  'value': '192.0.2.0/24',\n",
                      "}\n",
                      "vpc_address_model = {\n",
                      "  'type': 'vpc',\n",
                      "  'value': vpc_crn,\n",
                      "}\n",
                      "service_ref_address_model = {\n",
                      "  'type': 'serviceRef',\n",
                      "  'ref': {\n",
                      "    'account_id': account_id,\n",
                      "    'service_name': 'cloud-object-storage',\n",
                      "  },\n",
                      "}\n",
                      "excluded_ip_address_model = {\n",
                      "  'type': 'ipAddress',\n",
                      "  'value': '169.23.22.127',\n",
                      "}\n",
                      "\n",
                      "response = context_based_restrictions_service.create_zone(\n",
                      "  name='an example of zone',\n",
                      "  account_id=account_id,\n",
                      "  addresses=[\n",
                      "    ip_address_model,\n",
                      "    ip_address_v6_model,\n",
                      "    ip_range_address_model,\n",
                      "    ip_range_address_v6_model,\n",
                      "    subnet_address_model,\n",
                      "    vpc_address_model,\n",
                      "    service_ref_address_model,\n",
                      "  ],\n",
                      "  description='this is an example of zone',\n",
                      "  excluded=[excluded_ip_address_model],\n",
                      ")\n",
                      "zone = response.get_result()\n",
                      "\n",
                      "print(json.dumps(zone, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        }
      },
      "get": {
        "tags": [
          "Zones"
        ],
        "summary": "List network zones",
        "operationId": "list_zones",
        "description": "This operation lists network zones in the specified account.",
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "context-based-restrictions.zone.read"
            }
          ]
        },
        "x-cli-command": "zones",
        "parameters": [
          {
            "$ref": "#/components/parameters/required_account_id_in_query"
          },
          {
            "$ref": "#/components/parameters/zone_name_in_query"
          },
          {
            "$ref": "#/components/parameters/sort_in_query"
          }
        ],
        "responses": {
          "200": {
            "description": "The network zones were successfully retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ZoneList"
                },
                "example": {
                  "count": 1,
                  "zones": [
                    {
                      "id": "65810ac762004f22ac19f8f8edf70a34",
                      "crn": "crn:v1:bluemix:public:context-based-restrictions:global:a/12ab34cd56ef78ab90cd12ef34ab56cd::zone:65810ac762004f22ac19f8f8edf70a34",
                      "name": "an example of zone",
                      "description": "this is an example of zone",
                      "addresses_preview": [
                        {
                          "type": "ipAddress",
                          "value": "169.23.56.234"
                        },
                        {
                          "type": "ipAddress",
                          "value": "3ffe:1900:fe21:4545::"
                        },
                        {
                          "type": "ipRange",
                          "value": "169.23.22.0-169.23.22.255"
                        }
                      ],
                      "address_count": 6,
                      "excluded_count": 1,
                      "href": "https://cbr.cloud.ibm.com/v1/zones/65810ac762004f22ac19f8f8edf70a34",
                      "created_at": "2020-11-23T02:01:59Z",
                      "created_by_id": "IBMid-120000P1JM",
                      "last_modified_at": "2020-11-23T02:01:59Z",
                      "last_modified_by_id": "IBMid-120000P1JM"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The network zones could not be retrieved due to an invalid or missing input parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 400,
                  "errors": [
                    {
                      "code": "parameter_error",
                      "message": "The parameter \"account_id\" in query has an error.",
                      "target": {
                        "name": "account_id",
                        "type": "parameter",
                        "value": "an-invalid-account-id"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "You are not authorized to make this request. The token is either missing, invalid, or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 401,
                  "errors": [
                    {
                      "code": "invalid_auth_token",
                      "message": "The token failed to validate.",
                      "target": {
                        "name": "Authorization",
                        "type": "header"
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The supplied authentication is not authorized to perform the operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 403,
                  "errors": [
                    {
                      "code": "request_not_authorized",
                      "message": "The request could not be authorized."
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 429,
                  "errors": [
                    {
                      "code": "too_many_requests",
                      "message": "The client has sent too many requests in a given amount of time."
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "A backend service required to complete the operation is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 503,
                  "errors": [
                    {
                      "code": "store_unavailable_error",
                      "message": "The store is currently unavailable. Try again later."
                    }
                  ]
                }
              }
            }
          }
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X GET --location --header \"Authorization: Bearer {iam_token}\" \\\n",
                      "  --header \"Accept: application/json\" \\\n",
                      "  \"https://cbr.cloud.ibm.com/v1/zones?account_id={account_id}\""
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "listZonesOptions := contextBasedRestrictionsService.NewListZonesOptions(\n",
                      "  accountID,\n",
                      ")\n",
                      "\n",
                      "zoneList, response, err := contextBasedRestrictionsService.ListZones(listZonesOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(zoneList, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "ListZonesOptions listZonesOptions = new ListZonesOptions.Builder()\n",
                      "  .accountId(accountID)\n",
                      "  .build();\n",
                      "\n",
                      "Response<ZoneList> response = contextBasedRestrictionsService.listZones(listZonesOptions).execute();\n",
                      "ZoneList zoneList = response.getResult();\n",
                      "\n",
                      "System.out.println(zoneList);"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  accountId,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  const res = await contextBasedRestrictionsService.listZones(params);\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "response = context_based_restrictions_service.list_zones(\n",
                      "  account_id=account_id,\n",
                      ")\n",
                      "zone_list = response.get_result()\n",
                      "\n",
                      "print(json.dumps(zone_list, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        }
      }
    },
    "/v1/zones/{zone_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/x_correlation_id_in_header"
        },
        {
          "$ref": "#/components/parameters/transaction_id_in_header"
        },
        {
          "$ref": "#/components/parameters/zone_id_in_path"
        }
      ],
      "get": {
        "tags": [
          "Zones"
        ],
        "summary": "Get a network zone",
        "operationId": "get_zone",
        "description": "This operation retrieves the network zone identified by the specified zone ID.",
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "context-based-restrictions.zone.read"
            }
          ]
        },
        "x-cli-command": "zone",
        "x-cli-description": "Show details of a network zone",
        "responses": {
          "200": {
            "description": "The network zone was successfully retrieved.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/etag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Zone"
                },
                "example": {
                  "id": "65810ac762004f22ac19f8f8edf70a34",
                  "crn": "crn:v1:bluemix:public:context-based-restrictions:global:a/12ab34cd56ef78ab90cd12ef34ab56cd::zone:65810ac762004f22ac19f8f8edf70a34",
                  "name": "an example of zone",
                  "description": "this is an example of zone",
                  "account_id": "12ab34cd56ef78ab90cd12ef34ab56cd",
                  "addresses": [
                    {
                      "type": "ipAddress",
                      "value": "169.23.56.234"
                    },
                    {
                      "type": "ipAddress",
                      "value": "3ffe:1900:fe21:4545::"
                    },
                    {
                      "type": "ipRange",
                      "value": "169.23.22.0-169.23.22.255"
                    },
                    {
                      "type": "ipRange",
                      "value": "3ffe:1900:fe21:4545::-3ffe:1900:fe21:6767::"
                    },
                    {
                      "type": "vpc",
                      "value": "crn:v1:bluemix:public:is:us-south:a/12ab34cd56ef78ab90cd12ef34ab56cd::vpc:r134-d98a1702-b39a-449a-86d4-ef8dbacf281e"
                    }
                  ],
                  "excluded": [
                    {
                      "type": "ipAddress",
                      "value": "169.23.22.127"
                    }
                  ],
                  "address_count": 5,
                  "excluded_count": 1,
                  "href": "https://cbr.cloud.ibm.com/v1/zones/65810ac762004f22ac19f8f8edf70a34",
                  "created_at": "2020-11-23T02:01:59Z",
                  "created_by_id": "IBMid-120000P1JM",
                  "last_modified_at": "2020-11-23T02:01:59Z",
                  "last_modified_by_id": "IBMid-120000P1JM"
                }
              }
            }
          },
          "400": {
            "description": "The network zone could not be retrieved due to an invalid or missing input parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 400,
                  "errors": [
                    {
                      "code": "parameter_error",
                      "message": "The parameter \"zone_id\" in path has an error.",
                      "target": {
                        "name": "zone_id",
                        "type": "parameter",
                        "value": "an-invalid-zone-id"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "You are not authorized to make this request. The token is either missing, invalid, or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 401,
                  "errors": [
                    {
                      "code": "invalid_auth_token",
                      "message": "The token failed to validate.",
                      "target": {
                        "name": "Authorization",
                        "type": "header"
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The supplied authentication is not authorized to perform the operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 403,
                  "errors": [
                    {
                      "code": "request_not_authorized",
                      "message": "The request could not be authorized."
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "The network zone could not be found. Verify that the specified zone ID is valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 404,
                  "errors": [
                    {
                      "code": "zone_not_found_in_store",
                      "message": "The zone '65810ac762004f22ac19f8f8edf70a34' is not found.",
                      "target": {
                        "name": "zone_id",
                        "type": "parameter",
                        "value": "65810ac762004f22ac19f8f8edf70a34"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 429,
                  "errors": [
                    {
                      "code": "too_many_requests",
                      "message": "The client has sent too many requests in a given amount of time."
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "A backend service required to complete the operation is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 503,
                  "errors": [
                    {
                      "code": "store_unavailable_error",
                      "message": "The store is currently unavailable. Try again later."
                    }
                  ]
                }
              }
            }
          }
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X GET --location --header \"Authorization: Bearer {iam_token}\" \\\n",
                      "  --header \"Accept: application/json\" \\\n",
                      "  \"https://cbr.cloud.ibm.com/v1/zones/{zone_id}\""
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "getZoneOptions := contextBasedRestrictionsService.NewGetZoneOptions(\n",
                      "  zoneID,\n",
                      ")\n",
                      "\n",
                      "zone, response, err := contextBasedRestrictionsService.GetZone(getZoneOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(zone, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "GetZoneOptions getZoneOptions = new GetZoneOptions.Builder()\n",
                      "  .zoneId(zoneID)\n",
                      "  .build();\n",
                      "\n",
                      "Response<Zone> response = contextBasedRestrictionsService.getZone(getZoneOptions).execute();\n",
                      "Zone zone = response.getResult();\n",
                      "\n",
                      "System.out.println(zone);"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  zoneId,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  const res = await contextBasedRestrictionsService.getZone(params);\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "response = context_based_restrictions_service.get_zone(\n",
                      "  zone_id=zone_id,\n",
                      ")\n",
                      "zone = response.get_result()\n",
                      "\n",
                      "print(json.dumps(zone, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        }
      },
      "put": {
        "tags": [
          "Zones"
        ],
        "summary": "Replace a network zone",
        "operationId": "replace_zone",
        "description": "This operation replaces the network zone identified by the specified zone ID. Partial updates are not supported. The entire network zone object must be replaced.",
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "context-based-restrictions.zone.update"
            }
          ]
        },
        "x-cli-command": "zone-update",
        "x-cli-description": "Update a network zone",
        "parameters": [
          {
            "$ref": "#/components/parameters/if_match_in_header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewZone"
              },
              "example": {
                "name": "an example of zone",
                "description": "this is an example of zone",
                "account_id": "12ab34cd56ef78ab90cd12ef34ab56cd",
                "addresses": [
                  {
                    "type": "ipAddress",
                    "value": "169.23.56.234"
                  },
                  {
                    "type": "ipAddress",
                    "value": "3ffe:1900:fe21:4545::"
                  },
                  {
                    "type": "ipRange",
                    "value": "169.23.22.0-169.23.22.255"
                  },
                  {
                    "type": "ipRange",
                    "value": "3ffe:1900:fe21:4545::-3ffe:1900:fe21:6767::"
                  },
                  {
                    "type": "vpc",
                    "value": "crn:v1:bluemix:public:is:us-south:a/12ab34cd56ef78ab90cd12ef34ab56cd::vpc:r134-d98a1702-b39a-449a-86d4-ef8dbacf281e"
                  }
                ],
                "excluded": [
                  {
                    "type": "ipAddress",
                    "value": "169.23.22.128"
                  }
                ]
              }
            }
          },
          "description": "The network zone to replace."
        },
        "responses": {
          "200": {
            "description": "The network zone was successfully replaced.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/etag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Zone"
                },
                "example": {
                  "id": "65810ac762004f22ac19f8f8edf70a34",
                  "crn": "crn:v1:bluemix:public:context-based-restrictions:global:a/12ab34cd56ef78ab90cd12ef34ab56cd::zone:65810ac762004f22ac19f8f8edf70a34",
                  "name": "an example of zone",
                  "description": "this is an example of zone",
                  "account_id": "12ab34cd56ef78ab90cd12ef34ab56cd",
                  "addresses": [
                    {
                      "type": "ipAddress",
                      "value": "169.23.56.234"
                    },
                    {
                      "type": "ipAddress",
                      "value": "3ffe:1900:fe21:4545::"
                    },
                    {
                      "type": "ipRange",
                      "value": "169.23.22.0-169.23.22.255"
                    },
                    {
                      "type": "ipRange",
                      "value": "3ffe:1900:fe21:4545::-3ffe:1900:fe21:6767::"
                    },
                    {
                      "type": "vpc",
                      "value": "crn:v1:bluemix:public:is:us-south:a/12ab34cd56ef78ab90cd12ef34ab56cd::vpc:r134-d98a1702-b39a-449a-86d4-ef8dbacf281e"
                    }
                  ],
                  "excluded": [
                    {
                      "type": "ipAddress",
                      "value": "169.23.22.128"
                    }
                  ],
                  "address_count": 5,
                  "excluded_count": 1,
                  "href": "https://cbr.cloud.ibm.com/v1/zones/65810ac762004f22ac19f8f8edf70a34",
                  "created_at": "2020-11-23T02:01:59Z",
                  "created_by_id": "IBMid-120000P1JM",
                  "last_modified_at": "2020-11-23T02:05:00Z",
                  "last_modified_by_id": "IBMid-120000P1JM"
                }
              }
            }
          },
          "400": {
            "description": "The network zone could not be replaced due to an invalid or missing input parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 400,
                  "errors": [
                    {
                      "code": "invalid_ip_range_value_first_ip_greater_than_last_ip",
                      "message": "Invalid `ipRange` value: the first IP address is greater than last IP address.",
                      "target": {
                        "name": "value",
                        "type": "field",
                        "value": "169.25.27.0-169.25.26.255"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "You are not authorized to make this request. The token is either missing, invalid, or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 401,
                  "errors": [
                    {
                      "code": "invalid_auth_token",
                      "message": "The token failed to validate.",
                      "target": {
                        "name": "Authorization",
                        "type": "header"
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The supplied authentication is not authorized to perform the operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 403,
                  "errors": [
                    {
                      "code": "request_not_authorized",
                      "message": "The request could not be authorized."
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "The network zone could not be found. Verify that the specified zone ID is valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 404,
                  "errors": [
                    {
                      "code": "zone_not_found_in_store",
                      "message": "The zone '65810ac762004f22ac19f8f8edf70a34' is not found.",
                      "target": {
                        "name": "zone_id",
                        "type": "parameter",
                        "value": "65810ac762004f22ac19f8f8edf70a34"
                      }
                    }
                  ]
                }
              }
            }
          },
          "412": {
            "description": "The network zone revision is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 412,
                  "errors": [
                    {
                      "code": "invalid_zone_revision",
                      "message": "The zone revision is missing or invalid.",
                      "target": {
                        "name": "If-Match",
                        "type": "header",
                        "value": "an-invalid-revision"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 429,
                  "errors": [
                    {
                      "code": "too_many_requests",
                      "message": "The client has sent too many requests in a given amount of time."
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "A backend service required to complete the operation is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 503,
                  "errors": [
                    {
                      "code": "store_unavailable_error",
                      "message": "The store is currently unavailable. Try again later."
                    }
                  ]
                }
              }
            }
          }
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X PUT --location --header \"Authorization: Bearer {iam_token}\" \\\n",
                      "  --header \"Accept: application/json\" \\\n",
                      "  --header \"If-Match: {if_match}\" \\\n",
                      "  --header \"Content-Type: application/json\" \\\n",
                      "  --data '{ \"name\": \"an example of zone\", \"description\": \"this is an example of zone\", \"account_id\": \"12ab34cd56ef78ab90cd12ef34ab56cd\", \"addresses\": [ { \"type\": \"ipAddress\", \"value\": \"169.23.56.234\" }, { \"type\": \"ipAddress\", \"value\": \"3ffe:1900:fe21:4545::\" }, { \"type\": \"ipRange\", \"value\": \"169.23.22.0-169.23.22.255\" }, { \"type\": \"ipRange\", \"value\": \"3ffe:1900:fe21:4545::-3ffe:1900:fe21:6767::\" }, { \"type\": \"vpc\", \"value\": \"crn:v1:bluemix:public:is:us-south:a/12ab34cd56ef78ab90cd12ef34ab56cd::vpc:r134-d98a1702-b39a-449a-86d4-ef8dbacf281e\" } ], \"excluded\": [ { \"type\": \"ipAddress\", \"value\": \"169.23.22.128\" } ] }' \\\n",
                      "  \"https://cbr.cloud.ibm.com/v1/zones/{zone_id}\""
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "addressModel := &contextbasedrestrictionsv1.AddressIPAddress{\n",
                      "  Type:  core.StringPtr(\"ipAddress\"),\n",
                      "  Value: core.StringPtr(\"169.23.56.234\"),\n",
                      "}\n",
                      "\n",
                      "replaceZoneOptions := contextBasedRestrictionsService.NewReplaceZoneOptions(\n",
                      "  zoneID,\n",
                      "  zoneRev,\n",
                      ")\n",
                      "replaceZoneOptions.SetName(\"an example of updated zone\")\n",
                      "replaceZoneOptions.SetAccountID(accountID)\n",
                      "replaceZoneOptions.SetDescription(\"this is an example of updated zone\")\n",
                      "replaceZoneOptions.SetAddresses([]contextbasedrestrictionsv1.AddressIntf{addressModel})\n",
                      "\n",
                      "zone, response, err := contextBasedRestrictionsService.ReplaceZone(replaceZoneOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(zone, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "AddressIPAddress addressModel = new AddressIPAddress.Builder()\n",
                      "  .type(\"ipAddress\")\n",
                      "  .value(\"169.23.56.234\")\n",
                      "  .build();\n",
                      "ReplaceZoneOptions replaceZoneOptions = new ReplaceZoneOptions.Builder()\n",
                      "  .zoneId(zoneID)\n",
                      "  .ifMatch(zoneRev)\n",
                      "  .name(\"an example of zone\")\n",
                      "  .accountId(accountID)\n",
                      "  .description(\"this is an example of updated zone\")\n",
                      "  .addresses(java.util.Arrays.asList(addressModel))\n",
                      "  .build();\n",
                      "\n",
                      "Response<Zone> response = contextBasedRestrictionsService.replaceZone(replaceZoneOptions).execute();\n",
                      "Zone zone = response.getResult();\n",
                      "\n",
                      "System.out.println(zone);"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "// Request models needed by this operation.\n",
                      "\n",
                      "// AddressIPAddress\n",
                      "const addressModel = {\n",
                      "  type: 'ipAddress',\n",
                      "  value: '169.23.56.234',\n",
                      "};\n",
                      "\n",
                      "const params = {\n",
                      "  zoneId,\n",
                      "  ifMatch: zoneRev,\n",
                      "  name: 'an example of updated zone',\n",
                      "  accountId,\n",
                      "  addresses: [addressModel],\n",
                      "  description: 'this is an example of updated zone',\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  const res = await contextBasedRestrictionsService.replaceZone(params);\n",
                      "  zoneId = res.result.id;\n",
                      "  zoneRev = res.headers.etag;\n",
                      "\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "address_model = {\n",
                      "  'type': 'ipAddress',\n",
                      "  'value': '169.23.56.234',\n",
                      "}\n",
                      "\n",
                      "response = context_based_restrictions_service.replace_zone(\n",
                      "  zone_id=zone_id,\n",
                      "  if_match=zone_rev,\n",
                      "  name='an example of zone',\n",
                      "  account_id=account_id,\n",
                      "  addresses=[address_model],\n",
                      "  description='this is an example of zone',\n",
                      ")\n",
                      "zone = response.get_result()\n",
                      "\n",
                      "print(json.dumps(zone, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        }
      },
      "delete": {
        "tags": [
          "Zones"
        ],
        "summary": "Delete a network zone",
        "operationId": "delete_zone",
        "description": "This operation deletes the network zone identified by the specified zone ID.",
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "context-based-restrictions.zone.delete"
            }
          ]
        },
        "x-cli-command": "zone-delete",
        "responses": {
          "204": {
            "description": "The network zone was successfully deleted."
          },
          "400": {
            "description": "The network zone could not be deleted due to an invalid or missing input parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 400,
                  "errors": [
                    {
                      "code": "parameter_error",
                      "message": "The parameter \"zone_id\" in path has an error.",
                      "target": {
                        "name": "zone_id",
                        "type": "parameter",
                        "value": "an-invalid-zone-id"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "You are not authorized to make this request. The token is either missing, invalid, or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 401,
                  "errors": [
                    {
                      "code": "invalid_auth_token",
                      "message": "The token failed to validate.",
                      "target": {
                        "name": "Authorization",
                        "type": "header"
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The supplied authentication is not authorized to perform the operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 403,
                  "errors": [
                    {
                      "code": "request_not_authorized",
                      "message": "The request could not be authorized."
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "The network zone could not be found. Verify that the specified zone ID is valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 404,
                  "errors": [
                    {
                      "code": "zone_not_found_in_store",
                      "message": "The zone '65810ac762004f22ac19f8f8edf70a34' is not found.",
                      "target": {
                        "name": "zone_id",
                        "type": "parameter",
                        "value": "65810ac762004f22ac19f8f8edf70a34"
                      }
                    }
                  ]
                }
              }
            }
          },
          "412": {
            "description": "Precondition not satisfied. A network zone cannot be deleted if it is referenced by one or more rules.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 412,
                  "errors": [
                    {
                      "code": "zone_used_by_rule",
                      "message": "The zone '65810ac762004f22ac19f8f8edf70a34' is referenced by one or more rules and cannot be deleted."
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 429,
                  "errors": [
                    {
                      "code": "too_many_requests",
                      "message": "The client has sent too many requests in a given amount of time."
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "A backend service required to complete the operation is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 503,
                  "errors": [
                    {
                      "code": "store_unavailable_error",
                      "message": "The store is currently unavailable. Try again later."
                    }
                  ]
                }
              }
            }
          }
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X DELETE --location --header \"Authorization: Bearer {iam_token}\" \\\n",
                      "  \"https://cbr.cloud.ibm.com/v1/zones/{zone_id}\""
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "deleteZoneOptions := contextBasedRestrictionsService.NewDeleteZoneOptions(\n",
                      "  zoneID,\n",
                      ")\n",
                      "\n",
                      "response, err := contextBasedRestrictionsService.DeleteZone(deleteZoneOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "if response.StatusCode != 204 {\n",
                      "  fmt.Printf(\"\\nUnexpected response status code received from DeleteZone(): %d\\n\", response.StatusCode)\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "DeleteZoneOptions deleteZoneOptions = new DeleteZoneOptions.Builder()\n",
                      "  .zoneId(zoneID)\n",
                      "  .build();\n",
                      "\n",
                      "Response<Void> response = contextBasedRestrictionsService.deleteZone(deleteZoneOptions).execute();"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  zoneId,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  await contextBasedRestrictionsService.deleteZone(params);\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "response = context_based_restrictions_service.delete_zone(\n",
                      "  zone_id=zone_id,\n",
                      ")"
                    ]
                  }
                ]
              }
            ]
          }
        }
      }
    },
    "/v1/zones/serviceref_targets": {
      "parameters": [
        {
          "$ref": "#/components/parameters/x_correlation_id_in_header"
        },
        {
          "$ref": "#/components/parameters/transaction_id_in_header"
        }
      ],
      "get": {
        "tags": [
          "Zones"
        ],
        "summary": "List available service reference targets",
        "operationId": "list_available_serviceref_targets",
        "description": "This operation lists all available service reference targets.",
        "x-ibm-permissions": {
          "description": "This operation does not require you to be assigned an IAM access role.",
          "actions": [
            {
              "name": "N/A"
            }
          ]
        },
        "x-cli-command": "available-service-reference-targets",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "Specifies the types of services to retrieve",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "platform_service"
              ],
              "default": "all"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The service reference targets were successfully retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceRefTargetList"
                },
                "example": {
                  "count": 2,
                  "targets": [
                    {
                      "service_name": "iam-groups",
                      "service_type": "platform_service"
                    },
                    {
                      "service_name": "is",
                      "locations": [
                        {
                          "display_name": "Europe",
                          "kind": "geography",
                          "name": "eu"
                        },
                        {
                          "display_name": "Spain",
                          "kind": "country",
                          "name": "es"
                        },
                        {
                          "display_name": "Madrid",
                          "kind": "metro",
                          "name": "mad"
                        },
                        {
                          "display_name": "North America",
                          "kind": "geography",
                          "name": "na"
                        },
                        {
                          "display_name": "United States",
                          "kind": "country",
                          "name": "us"
                        },
                        {
                          "display_name": "Dallas",
                          "kind": "metro",
                          "name": "dal"
                        },
                        {
                          "display_name": "Washington DC",
                          "kind": "metro",
                          "name": "wdc"
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The service reference targets could not be retrieved due to an invalid or missing input parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 400,
                  "errors": [
                    {
                      "code": "parameter_error",
                      "message": "The parameter \"type\" in query has an error.",
                      "target": {
                        "name": "type",
                        "type": "parameter",
                        "value": "an-invalid-type"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "You are not authorized to make this request. The token is either missing, invalid, or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 401,
                  "errors": [
                    {
                      "code": "invalid_auth_token",
                      "message": "The token failed to validate.",
                      "target": {
                        "name": "Authorization",
                        "type": "header"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 429,
                  "errors": [
                    {
                      "code": "too_many_requests",
                      "message": "The client has sent too many requests in a given amount of time."
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "A backend service required to complete the operation is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 503,
                  "errors": [
                    {
                      "code": "store_unavailable_error",
                      "message": "The store is currently unavailable. Try again later."
                    }
                  ]
                }
              }
            }
          }
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X GET --location --header \"Authorization: Bearer {iam_token}\" \\\n",
                      "  --header \"Accept: application/json\" \\\n",
                      "  \"https://cbr.cloud.ibm.com/v1/zones/serviceref_targets\""
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "listAvailableServiceRefTargetsOptions := contextBasedRestrictionsService.NewListAvailableServicerefTargetsOptions()\n",
                      "\n",
                      "serviceRefTargetList, response, err := contextBasedRestrictionsService.ListAvailableServicerefTargets(listAvailableServiceRefTargetsOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(serviceRefTargetList, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "ListAvailableServicerefTargetsOptions listAvailableServicerefTargetsOptions = new ListAvailableServicerefTargetsOptions.Builder()\n",
                      "  .build();\n",
                      "\n",
                      "Response<ServiceRefTargetList> response = contextBasedRestrictionsService.listAvailableServicerefTargets(listAvailableServicerefTargetsOptions).execute();\n",
                      "ServiceRefTargetList serviceRefTargetList = response.getResult();\n",
                      "\n",
                      "System.out.println(serviceRefTargetList);"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "try {\n",
                      "  const res = await contextBasedRestrictionsService.listAvailableServicerefTargets({});\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "response = context_based_restrictions_service.list_available_serviceref_targets()\n",
                      "service_ref_target_list = response.get_result()\n",
                      "\n",
                      "print(json.dumps(service_ref_target_list, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        }
      }
    },
    "/v1/zones/serviceref_targets/{service_name}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/x_correlation_id_in_header"
        },
        {
          "$ref": "#/components/parameters/transaction_id_in_header"
        },
        {
          "$ref": "#/components/parameters/service_name_in_path"
        }
      ],
      "get": {
        "tags": [
          "Zones"
        ],
        "summary": "Get service reference target for a specified service name",
        "operationId": "get_serviceref_target",
        "description": "This operation gets the service reference target for a specified service name",
        "x-ibm-permissions": {
          "description": "This operation does not require you to be assigned an IAM access role.",
          "actions": [
            {
              "name": "N/A"
            }
          ]
        },
        "x-cli-command": "get-service-reference-target",
        "x-cli-description": "Show details of a service reference target",
        "responses": {
          "200": {
            "description": "The service reference target was successfully retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceRefTarget"
                },
                "example": {
                  "service_name": "is",
                  "locations": [
                    {
                      "display_name": "Europe",
                      "kind": "geography",
                      "name": "eu"
                    },
                    {
                      "display_name": "Spain",
                      "kind": "country",
                      "name": "es"
                    },
                    {
                      "display_name": "Madrid",
                      "kind": "metro",
                      "name": "mad"
                    },
                    {
                      "display_name": "North America",
                      "kind": "geography",
                      "name": "na"
                    },
                    {
                      "display_name": "United States",
                      "kind": "country",
                      "name": "us"
                    },
                    {
                      "display_name": "Dallas",
                      "kind": "metro",
                      "name": "dal"
                    },
                    {
                      "display_name": "Washington DC",
                      "kind": "metro",
                      "name": "wdc"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "You are not authorized to make this request. The token is either missing, invalid, or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 401,
                  "errors": [
                    {
                      "code": "invalid_auth_token",
                      "message": "The token failed to validate.",
                      "target": {
                        "name": "Authorization",
                        "type": "header"
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No service reference target found for specified service name.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 404,
                  "errors": [
                    {
                      "code": "service_ref_target_not_found",
                      "message": "The service reference target for service name test-service-name is not found.",
                      "target": {
                        "name": "service_name",
                        "type": "parameter",
                        "value": "test-service-name"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 429,
                  "errors": [
                    {
                      "code": "too_many_requests",
                      "message": "The client has sent too many requests in a given amount of time."
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "A backend service required to complete the operation is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 503,
                  "errors": [
                    {
                      "code": "store_unavailable_error",
                      "message": "The store is currently unavailable. Try again later."
                    }
                  ]
                }
              }
            }
          }
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X GET --location --header \"Authorization: Bearer {iam_token}\" \\\n",
                      "  --header \"Accept: application/json\" \\\n",
                      "  \"https://cbr.cloud.ibm.com/v1/zones/serviceref_targets/{service_name}\""
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "getServicerefTargetOptions := contextBasedRestrictionsService.NewGetServicerefTargetOptions(\n",
                      "  serviceName,\n",
                      ")\n",
                      "\n",
                      "serviceRefTarget, response, err := contextBasedRestrictionsService.GetServicerefTarget(getServicerefTargetOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(serviceRefTarget, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "GetServicerefTargetOptions getServicerefTargetOptions = new GetServicerefTargetOptions.Builder()\n",
                      "  .serviceName(serviceName)\n",
                      "  .build();\n",
                      "\n",
                      "Response<ServiceRefTarget> response = contextBasedRestrictionsService.getServicerefTarget(getServicerefTargetOptions).execute();\n",
                      "ServiceRefTarget serviceRefTarget = response.getResult();\n",
                      "\n",
                      "System.out.println(serviceRefTarget);"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  serviceName: exampleServiceName,\n",
                      "};\n",
                      "\n",
                      "let res;\n",
                      "try {\n",
                      "  res = await contextBasedRestrictionsService.getServicerefTarget(params);\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "response = context_based_restrictions_service.get_serviceref_target(\n",
                      "  service_name=service_name,\n",
                      ")\n",
                      "service_ref_target = response.get_result()\n",
                      "\n",
                      "print(json.dumps(service_ref_target, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        }
      }
    },
    "/v1/rules": {
      "parameters": [
        {
          "$ref": "#/components/parameters/x_correlation_id_in_header"
        },
        {
          "$ref": "#/components/parameters/transaction_id_in_header"
        }
      ],
      "post": {
        "tags": [
          "Rules"
        ],
        "summary": "Create a rule",
        "operationId": "create_rule",
        "description": "This operation creates a rule for the specified account.",
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "cbr.rule.create"
            }
          ]
        },
        "x-cli-command": "rule-create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewRule"
              },
              "example": {
                "description": "this is an example of rule",
                "resources": [
                  {
                    "attributes": [
                      {
                        "name": "accountId",
                        "value": "12ab34cd56ef78ab90cd12ef34ab56cd"
                      },
                      {
                        "name": "serviceName",
                        "value": "kms"
                      }
                    ]
                  }
                ],
                "contexts": [
                  {
                    "attributes": [
                      {
                        "name": "networkZoneId",
                        "value": "65810ac762004f22ac19f8f8edf70a34"
                      }
                    ]
                  }
                ],
                "enforcement_mode": "enabled"
              }
            }
          },
          "description": "The rule to create."
        },
        "responses": {
          "201": {
            "description": "Rule created.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/etag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                },
                "example": {
                  "id": "fb988c9387e84390ba98bce4744c0a9c",
                  "crn": "crn:v1:bluemix:public:context-based-restrictions:global:a/12ab34cd56ef78ab90cd12ef34ab56cd::rule:fb988c9387e84390ba98bce4744c0a9c",
                  "description": "this is an example of rule",
                  "resources": [
                    {
                      "attributes": [
                        {
                          "name": "accountId",
                          "value": "12ab34cd56ef78ab90cd12ef34ab56cd"
                        },
                        {
                          "name": "serviceName",
                          "value": "kms"
                        }
                      ]
                    }
                  ],
                  "contexts": [
                    {
                      "attributes": [
                        {
                          "name": "networkZoneId",
                          "value": "65810ac762004f22ac19f8f8edf70a34"
                        }
                      ]
                    }
                  ],
                  "operations": {
                    "api_types": [
                      {
                        "api_type_id": "crn:v1:bluemix:public:context-based-restrictions::::api-type:",
                        "description": "Protects all service APIs.",
                        "display_name": "All"
                      },
                      {
                        "api_type_id": "crn:v1:bluemix:public:context-based-restrictions::::platform-api-type:",
                        "description": "Protects all platform APIs.",
                        "display_name": "All"
                      }
                    ]
                  },
                  "enforcement_mode": "enabled",
                  "href": "https://cbr.cloud.ibm.com/v1/rules/fb988c9387e84390ba98bce4744c0a9c",
                  "created_at": "2020-11-24T16:35:17Z",
                  "created_by_id": "IBMid-120000P1JM",
                  "last_modified_at": "2020-11-24T16:35:17Z",
                  "last_modified_by_id": "IBMid-120000P1JM"
                }
              }
            }
          },
          "400": {
            "description": "The rule could not be created due to an invalid or missing input parameter or request body.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 400,
                  "errors": [
                    {
                      "code": "service_def_not_found",
                      "message": "The definition of service 'a-service-that-does-not-exist' is not found.",
                      "target": {
                        "name": "serviceName",
                        "type": "field",
                        "value": "a-service-that-does-not-exist"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "You are not authorized to make this request. The token is either missing, invalid, or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 401,
                  "errors": [
                    {
                      "code": "invalid_auth_token",
                      "message": "The token failed to validate.",
                      "target": {
                        "name": "Authorization",
                        "type": "header"
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The supplied authentication is not authorized to perform the operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 403,
                  "errors": [
                    {
                      "code": "request_not_authorized",
                      "message": "The request could not be authorized."
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 429,
                  "errors": [
                    {
                      "code": "too_many_requests",
                      "message": "The client has sent too many requests in a given amount of time."
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "A backend service required to complete the operation is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 503,
                  "errors": [
                    {
                      "code": "store_unavailable_error",
                      "message": "The store is currently unavailable. Try again later."
                    }
                  ]
                }
              }
            }
          }
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X POST --location --header \"Authorization: Bearer {iam_token}\" \\\n",
                      "  --header \"Accept: application/json\" \\\n",
                      "  --header \"Content-Type: application/json\" \\\n",
                      "  --data '{ \"description\": \"this is an example of rule\", \"resources\": [ { \"attributes\": [ { \"name\": \"accountId\", \"value\": \"12ab34cd56ef78ab90cd12ef34ab56cd\" }, { \"name\": \"serviceName\", \"value\": \"kms\" } ] } ], \"contexts\": [ { \"attributes\": [ { \"name\": \"networkZoneId\", \"value\": \"65810ac762004f22ac19f8f8edf70a34\" } ] } ], \"enforcement_mode\": \"enabled\" }' \\\n",
                      "  \"https://cbr.cloud.ibm.com/v1/rules\""
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "ruleContextAttributeModel := &contextbasedrestrictionsv1.RuleContextAttribute{\n",
                      "  Name:  core.StringPtr(\"networkZoneId\"),\n",
                      "  Value: core.StringPtr(zoneID),\n",
                      "}\n",
                      "\n",
                      "ruleContextModel := &contextbasedrestrictionsv1.RuleContext{\n",
                      "  Attributes: []contextbasedrestrictionsv1.RuleContextAttribute{*ruleContextAttributeModel},\n",
                      "}\n",
                      "\n",
                      "resourceModel := &contextbasedrestrictionsv1.Resource{\n",
                      "  Attributes: []contextbasedrestrictionsv1.ResourceAttribute{\n",
                      "    {\n",
                      "      Name:  core.StringPtr(\"accountId\"),\n",
                      "      Value: core.StringPtr(accountID),\n",
                      "    },\n",
                      "    {\n",
                      "      Name:  core.StringPtr(\"serviceName\"),\n",
                      "      Value: core.StringPtr(serviceName),\n",
                      "    },\n",
                      "  },\n",
                      "  Tags: []contextbasedrestrictionsv1.ResourceTagAttribute{\n",
                      "    {\n",
                      "      Name:  core.StringPtr(\"tagName\"),\n",
                      "      Value: core.StringPtr(\"tagValue\"),\n",
                      "    },\n",
                      "  },\n",
                      "}\n",
                      "\n",
                      "createRuleOptions := contextBasedRestrictionsService.NewCreateRuleOptions()\n",
                      "createRuleOptions.SetDescription(\"this is an example of rule\")\n",
                      "createRuleOptions.SetContexts([]contextbasedrestrictionsv1.RuleContext{*ruleContextModel})\n",
                      "createRuleOptions.SetResources([]contextbasedrestrictionsv1.Resource{*resourceModel})\n",
                      "createRuleOptions.SetEnforcementMode(contextbasedrestrictionsv1.CreateRuleOptionsEnforcementModeEnabledConst)\n",
                      "rule, response, err := contextBasedRestrictionsService.CreateRule(createRuleOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(rule, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "RuleContextAttribute ruleContextAttributeModel = new RuleContextAttribute.Builder()\n",
                      "  .name(\"networkZoneId\")\n",
                      "  .value(zoneID)\n",
                      "  .build();\n",
                      "RuleContext ruleContextModel = new RuleContext.Builder()\n",
                      "  .attributes(java.util.Arrays.asList(ruleContextAttributeModel))\n",
                      "  .build();\n",
                      "ResourceAttribute resourceAttributeModelAccountID = new ResourceAttribute.Builder()\n",
                      "  .name(\"accountId\")\n",
                      "  .value(accountID)\n",
                      "  .build();\n",
                      "ResourceAttribute resourceAttributeModelServiceName = new ResourceAttribute.Builder()\n",
                      "  .name(\"serviceName\")\n",
                      "  .value(serviceName)\n",
                      "  .build();\n",
                      "ResourceTagAttribute resourceTagAttributeModel = new ResourceTagAttribute.Builder()\n",
                      "  .name(\"tagName\")\n",
                      "  .value(\"tagValue\")\n",
                      "  .build();\n",
                      "Resource resourceModel = new Resource.Builder()\n",
                      "  .addAttributes(resourceAttributeModelAccountID)\n",
                      "  .addAttributes(resourceAttributeModelServiceName)\n",
                      "  .tags(java.util.Arrays.asList(resourceTagAttributeModel))\n",
                      "  .build();\n",
                      "CreateRuleOptions createRuleOptions = new CreateRuleOptions.Builder()\n",
                      "  .description(\"this is an example of rule\")\n",
                      "  .addContexts(ruleContextModel)\n",
                      "  .addResources(resourceModel)\n",
                      "  .enforcementMode(\"enabled\")\n",
                      "  .build();\n",
                      "\n",
                      "Response<Rule> response = contextBasedRestrictionsService.createRule(createRuleOptions).execute();\n",
                      "Rule rule = response.getResult();\n",
                      "\n",
                      "System.out.println(rule);\n",
                      "ruleID = rule.getId();\n",
                      "ruleRev = response.getHeaders().values(\"Etag\").get(0);"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "// Request models needed by this operation.\n",
                      "\n",
                      "// RuleContextAttribute\n",
                      "const ruleContextAttributeModel = {\n",
                      "  name: 'networkZoneId',\n",
                      "  value: zoneId,\n",
                      "};\n",
                      "\n",
                      "// RuleContext\n",
                      "const ruleContextModel = {\n",
                      "  attributes: [ruleContextAttributeModel],\n",
                      "};\n",
                      "\n",
                      "// ResourceAttribute\n",
                      "const resourceAttributeAccountIdModel = {\n",
                      "  name: 'accountId',\n",
                      "  value: accountId,\n",
                      "};\n",
                      "\n",
                      "// Resource Attribute\n",
                      "const resourceAttributeServiceNameModel = {\n",
                      "  name: 'serviceName',\n",
                      "  value: serviceName,\n",
                      "  operator: 'stringEquals',\n",
                      "};\n",
                      "\n",
                      "// Resource\n",
                      "const resourceModel = {\n",
                      "  attributes: [resourceAttributeAccountIdModel, resourceAttributeServiceNameModel],\n",
                      "};\n",
                      "\n",
                      "const params = {\n",
                      "  contexts: [ruleContextModel],\n",
                      "  resources: [resourceModel],\n",
                      "  description: 'this is an example of rule',\n",
                      "  enforcementMode: 'enabled',\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  const res = await contextBasedRestrictionsService.createRule(params);\n",
                      "  ruleId = res.result.id;\n",
                      "  ruleRev = res.headers.etag;\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "rule_context_attribute_model = {\n",
                      "  'name': 'networkZoneId',\n",
                      "  'value': zone_id,\n",
                      "}\n",
                      "\n",
                      "rule_context_model = {\n",
                      "  'attributes': [rule_context_attribute_model],\n",
                      "}\n",
                      "\n",
                      "resource_attribute_model = {\n",
                      "  'name': 'accountId',\n",
                      "  'value': account_id,\n",
                      "}\n",
                      "\n",
                      "resource_attribute_service_name_model = {\n",
                      "  'name': 'serviceName',\n",
                      "  'value': service_name,\n",
                      "}\n",
                      "\n",
                      "resource_model = {\n",
                      "  'attributes': [resource_attribute_model, resource_attribute_service_name_model],\n",
                      "}\n",
                      "\n",
                      "response = context_based_restrictions_service.create_rule(\n",
                      "  contexts=[rule_context_model],\n",
                      "  resources=[resource_model],\n",
                      "  description='this is an example of rule',\n",
                      "  enforcement_mode='enabled',\n",
                      ")\n",
                      "rule = response.get_result()\n",
                      "\n",
                      "print(json.dumps(rule, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        }
      },
      "get": {
        "tags": [
          "Rules"
        ],
        "summary": "List rules",
        "operationId": "list_rules",
        "description": "This operation lists rules in the specified account.",
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "cbr.rule.read"
            }
          ]
        },
        "x-cli-command": "rules",
        "parameters": [
          {
            "$ref": "#/components/parameters/required_account_id_in_query"
          },
          {
            "$ref": "#/components/parameters/region_in_query"
          },
          {
            "$ref": "#/components/parameters/resource_in_query"
          },
          {
            "$ref": "#/components/parameters/resource_type_in_query"
          },
          {
            "$ref": "#/components/parameters/service_instance_in_query"
          },
          {
            "$ref": "#/components/parameters/service_name_in_query"
          },
          {
            "$ref": "#/components/parameters/service_type_in_query"
          },
          {
            "$ref": "#/components/parameters/service_group_in_query"
          },
          {
            "$ref": "#/components/parameters/zone_id_in_query"
          },
          {
            "$ref": "#/components/parameters/sort_in_query"
          },
          {
            "$ref": "#/components/parameters/enforcement_mode_in_query"
          }
        ],
        "responses": {
          "200": {
            "description": "The rules were successfully retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleList"
                },
                "example": {
                  "count": 1,
                  "rules": [
                    {
                      "id": "fb988c9387e84390ba98bce4744c0a9c",
                      "crn": "crn:v1:bluemix:public:context-based-restrictions:global:a/12ab34cd56ef78ab90cd12ef34ab56cd::rule:fb988c9387e84390ba98bce4744c0a9c",
                      "description": "this is an example of rule",
                      "resources": [
                        {
                          "attributes": [
                            {
                              "name": "accountId",
                              "value": "12ab34cd56ef78ab90cd12ef34ab56cd"
                            },
                            {
                              "name": "serviceName",
                              "value": "kms"
                            }
                          ]
                        }
                      ],
                      "contexts": [
                        {
                          "attributes": [
                            {
                              "name": "networkZoneId",
                              "value": "65810ac762004f22ac19f8f8edf70a34"
                            }
                          ]
                        }
                      ],
                      "operations": {
                        "api_types": [
                          {
                            "api_type_id": "crn:v1:bluemix:public:context-based-restrictions::::api-type:",
                            "description": "Protects all service APIs.",
                            "display_name": "All"
                          },
                          {
                            "api_type_id": "crn:v1:bluemix:public:context-based-restrictions::::platform-api-type:",
                            "description": "Protects all platform APIs.",
                            "display_name": "All"
                          }
                        ]
                      },
                      "enforcement_mode": "enabled",
                      "href": "https://cbr.cloud.ibm.com/v1/rules/fb988c9387e84390ba98bce4744c0a9c",
                      "created_at": "2020-11-24T16:35:17Z",
                      "created_by_id": "IBMid-120000P1JM",
                      "last_modified_at": "2020-11-24T16:35:17Z",
                      "last_modified_by_id": "IBMid-120000P1JM"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The rules could not be retrieved due to an invalid or missing input parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 400,
                  "errors": [
                    {
                      "code": "parameter_error",
                      "message": "The parameter \"account_id\" in query has an error.",
                      "target": {
                        "name": "account_id",
                        "type": "parameter",
                        "value": "an-invalid-account-id"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "You are not authorized to make this request. The token is either missing, invalid, or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 401,
                  "errors": [
                    {
                      "code": "invalid_auth_token",
                      "message": "The token failed to validate.",
                      "target": {
                        "name": "Authorization",
                        "type": "header"
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The supplied authentication is not authorized to perform the operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 403,
                  "errors": [
                    {
                      "code": "request_not_authorized",
                      "message": "The request could not be authorized."
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 429,
                  "errors": [
                    {
                      "code": "too_many_requests",
                      "message": "The client has sent too many requests in a given amount of time."
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "A backend service required to complete the operation is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 503,
                  "errors": [
                    {
                      "code": "store_unavailable_error",
                      "message": "The store is currently unavailable. Try again later."
                    }
                  ]
                }
              }
            }
          }
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X GET --location --header \"Authorization: Bearer {iam_token}\" \\\n",
                      "  --header \"Accept: application/json\" \\\n",
                      "  \"https://cbr.cloud.ibm.com/v1/rules?account_id={account_id}\""
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "listRulesOptions := contextBasedRestrictionsService.NewListRulesOptions(\n",
                      "  accountID,\n",
                      ")\n",
                      "\n",
                      "ruleList, response, err := contextBasedRestrictionsService.ListRules(listRulesOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(ruleList, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "ListRulesOptions listRulesOptions = new ListRulesOptions.Builder()\n",
                      "  .accountId(accountID)\n",
                      "  .build();\n",
                      "\n",
                      "Response<RuleList> response = contextBasedRestrictionsService.listRules(listRulesOptions).execute();\n",
                      "RuleList ruleList = response.getResult();\n",
                      "\n",
                      "System.out.println(ruleList);"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  accountId,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  const res = await contextBasedRestrictionsService.listRules(params);\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "response = context_based_restrictions_service.list_rules(\n",
                      "  account_id=account_id,\n",
                      ")\n",
                      "rule_list = response.get_result()\n",
                      "\n",
                      "print(json.dumps(rule_list, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        }
      }
    },
    "/v1/rules/{rule_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/x_correlation_id_in_header"
        },
        {
          "$ref": "#/components/parameters/transaction_id_in_header"
        },
        {
          "$ref": "#/components/parameters/rule_id_in_path"
        }
      ],
      "get": {
        "tags": [
          "Rules"
        ],
        "summary": "Get a rule",
        "operationId": "get_rule",
        "description": "This operation retrieves the rule identified by the specified rule ID.",
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "cbr.rule.read"
            }
          ]
        },
        "x-cli-command": "rule",
        "x-cli-description": "Show details of a rule",
        "responses": {
          "200": {
            "description": "The rule was successfully retrieved.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/etag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                },
                "example": {
                  "id": "fb988c9387e84390ba98bce4744c0a9c",
                  "crn": "crn:v1:bluemix:public:context-based-restrictions:global:a/12ab34cd56ef78ab90cd12ef34ab56cd::rule:fb988c9387e84390ba98bce4744c0a9c",
                  "description": "this is an example of rule",
                  "resources": [
                    {
                      "attributes": [
                        {
                          "name": "accountId",
                          "value": "12ab34cd56ef78ab90cd12ef34ab56cd"
                        },
                        {
                          "name": "serviceName",
                          "value": "kms"
                        }
                      ]
                    }
                  ],
                  "contexts": [
                    {
                      "attributes": [
                        {
                          "name": "networkZoneId",
                          "value": "65810ac762004f22ac19f8f8edf70a34"
                        }
                      ]
                    }
                  ],
                  "operations": {
                    "api_types": [
                      {
                        "api_type_id": "crn:v1:bluemix:public:context-based-restrictions::::api-type:",
                        "description": "Protects all service APIs.",
                        "display_name": "All"
                      },
                      {
                        "api_type_id": "crn:v1:bluemix:public:context-based-restrictions::::platform-api-type:",
                        "description": "Protects all platform APIs.",
                        "display_name": "All"
                      }
                    ]
                  },
                  "enforcement_mode": "enabled",
                  "href": "https://cbr.cloud.ibm.com/v1/rules/fb988c9387e84390ba98bce4744c0a9c",
                  "created_at": "2020-11-24T16:35:17Z",
                  "created_by_id": "IBMid-120000P1JM",
                  "last_modified_at": "2020-11-24T16:35:17Z",
                  "last_modified_by_id": "IBMid-120000P1JM"
                }
              }
            }
          },
          "400": {
            "description": "The rule could not be retrieved due to an invalid or missing input parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 400,
                  "errors": [
                    {
                      "code": "parameter_error",
                      "message": "The parameter \"rule_id\" in path has an error.",
                      "target": {
                        "name": "rule_id",
                        "type": "parameter",
                        "value": "an-invalid-rule-id"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "You are not authorized to make this request. The token is either missing, invalid, or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 401,
                  "errors": [
                    {
                      "code": "invalid_auth_token",
                      "message": "The token failed to validate.",
                      "target": {
                        "name": "Authorization",
                        "type": "header"
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The supplied authentication is not authorized to perform the operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 403,
                  "errors": [
                    {
                      "code": "request_not_authorized",
                      "message": "The request could not be authorized."
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "The rule could not be found. Verify that the specified rule ID is valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 404,
                  "errors": [
                    {
                      "code": "rule_not_found_in_store",
                      "message": "The rule 'fb988c9387e84390ba98bce4744c0a9c' is not found.",
                      "target": {
                        "name": "rule_id",
                        "type": "parameter",
                        "value": "fb988c9387e84390ba98bce4744c0a9c"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 429,
                  "errors": [
                    {
                      "code": "too_many_requests",
                      "message": "The client has sent too many requests in a given amount of time."
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "A backend service required to complete the operation is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 503,
                  "errors": [
                    {
                      "code": "store_unavailable_error",
                      "message": "The store is currently unavailable. Try again later."
                    }
                  ]
                }
              }
            }
          }
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X GET --location --header \"Authorization: Bearer {iam_token}\" \\\n",
                      "  --header \"Accept: application/json\" \\\n",
                      "  \"https://cbr.cloud.ibm.com/v1/rules/{rule_id}\""
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "getRuleOptions := contextBasedRestrictionsService.NewGetRuleOptions(\n",
                      "  ruleID,\n",
                      ")\n",
                      "\n",
                      "rule, response, err := contextBasedRestrictionsService.GetRule(getRuleOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(rule, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "GetRuleOptions getRuleOptions = new GetRuleOptions.Builder()\n",
                      "    .ruleId(ruleID)\n",
                      "    .build();\n",
                      "\n",
                      "Response<Rule> response = contextBasedRestrictionsService.getRule(getRuleOptions).execute();\n",
                      "Rule rule = response.getResult();\n",
                      "\n",
                      "System.out.println(rule);"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  ruleId,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  const res = await contextBasedRestrictionsService.getRule(params);\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "response = context_based_restrictions_service.get_rule(\n",
                      "  rule_id=rule_id,\n",
                      ")\n",
                      "rule = response.get_result()\n",
                      "\n",
                      "print(json.dumps(rule, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        }
      },
      "put": {
        "tags": [
          "Rules"
        ],
        "summary": "Replace a rule",
        "operationId": "replace_rule",
        "description": "This operation replaces the rule identified by the specified rule ID. Partial updates are not supported. The entire rule object must be replaced.",
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "cbr.rule.update"
            }
          ]
        },
        "x-cli-command": "rule-update",
        "x-cli-description": "Update a rule",
        "parameters": [
          {
            "$ref": "#/components/parameters/if_match_in_header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewRule"
              },
              "example": {
                "description": "this is an example of rule",
                "resources": [
                  {
                    "attributes": [
                      {
                        "name": "accountId",
                        "value": "12ab34cd56ef78ab90cd12ef34ab56cd"
                      },
                      {
                        "name": "serviceName",
                        "value": "kms"
                      }
                    ]
                  }
                ],
                "contexts": [
                  {
                    "attributes": [
                      {
                        "name": "networkZoneId",
                        "value": "76921bd873115033bd2a0909fe081b45"
                      }
                    ]
                  }
                ],
                "enforcement_mode": "disabled"
              }
            }
          },
          "description": "The rule to replace."
        },
        "responses": {
          "200": {
            "description": "The rule was successfully replaced.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/etag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rule"
                },
                "example": {
                  "id": "fb988c9387e84390ba98bce4744c0a9c",
                  "crn": "crn:v1:bluemix:public:context-based-restrictions:global:a/12ab34cd56ef78ab90cd12ef34ab56cd::rule:fb988c9387e84390ba98bce4744c0a9c",
                  "description": "this is an example of rule",
                  "resources": [
                    {
                      "attributes": [
                        {
                          "name": "accountId",
                          "value": "12ab34cd56ef78ab90cd12ef34ab56cd"
                        },
                        {
                          "name": "serviceName",
                          "value": "kms"
                        }
                      ]
                    }
                  ],
                  "contexts": [
                    {
                      "attributes": [
                        {
                          "name": "networkZoneId",
                          "value": "76921bd873115033bd2a0909fe081b45"
                        }
                      ]
                    }
                  ],
                  "operations": {
                    "api_types": [
                      {
                        "api_type_id": "crn:v1:bluemix:public:context-based-restrictions::::api-type:",
                        "description": "Protects all service APIs.",
                        "display_name": "All"
                      },
                      {
                        "api_type_id": "crn:v1:bluemix:public:context-based-restrictions::::platform-api-type:",
                        "description": "Protects all platform APIs.",
                        "display_name": "All"
                      }
                    ]
                  },
                  "enforcement_mode": "disabled",
                  "href": "https://cbr.cloud.ibm.com/v1/rules/fb988c9387e84390ba98bce4744c0a9c",
                  "created_at": "2020-11-24T16:35:17Z",
                  "created_by_id": "IBMid-120000P1JM",
                  "last_modified_at": "2020-11-24T16:55:01Z",
                  "last_modified_by_id": "IBMid-120000P1JM"
                }
              }
            }
          },
          "400": {
            "description": "The rule could not be replaced due to an invalid or missing input parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 400,
                  "errors": [
                    {
                      "code": "service_not_context-based-restrictions_enabled",
                      "message": "The service 'a-service-that-is-not-cbr-enabled' is not supported for context-based-restrictions control.",
                      "target": {
                        "name": "serviceName",
                        "type": "field",
                        "value": "a-service-that-is-not-cbr-enabled"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "You are not authorized to make this request. The token is either missing, invalid, or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 401,
                  "errors": [
                    {
                      "code": "invalid_auth_token",
                      "message": "The token failed to validate.",
                      "target": {
                        "name": "Authorization",
                        "type": "header"
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The supplied authentication is not authorized to perform the operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 403,
                  "errors": [
                    {
                      "code": "request_not_authorized",
                      "message": "The request could not be authorized."
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "The rule could not be found. Verify that the specified rule ID is valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 404,
                  "errors": [
                    {
                      "code": "rule_not_found_in_store",
                      "message": "The rule 'fb988c9387e84390ba98bce4744c0a9c' is not found.",
                      "target": {
                        "name": "zone_id",
                        "type": "parameter",
                        "value": "fb988c9387e84390ba98bce4744c0a9c"
                      }
                    }
                  ]
                }
              }
            }
          },
          "412": {
            "description": "The rule revision is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 412,
                  "errors": [
                    {
                      "code": "invalid_rule_revision",
                      "message": "The rule revision is missing or invalid.",
                      "target": {
                        "name": "If-Match",
                        "type": "header",
                        "value": "an-invalid-revision"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 429,
                  "errors": [
                    {
                      "code": "too_many_requests",
                      "message": "The client has sent too many requests in a given amount of time."
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "A backend service required to complete the operation is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 503,
                  "errors": [
                    {
                      "code": "store_unavailable_error",
                      "message": "The store is currently unavailable. Try again later."
                    }
                  ]
                }
              }
            }
          }
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X PUT --location --header \"Authorization: Bearer {iam_token}\" \\\n",
                      "  --header \"Accept: application/json\" \\\n",
                      "  --header \"If-Match: {if_match}\" \\\n",
                      "  --header \"Content-Type: application/json\" \\\n",
                      "  --data '{ \"description\": \"this is an example of rule\", \"resources\": [ { \"attributes\": [ { \"name\": \"accountId\", \"value\": \"12ab34cd56ef78ab90cd12ef34ab56cd\" }, { \"name\": \"serviceName\", \"value\": \"kms\" } ] } ], \"contexts\": [ { \"attributes\": [ { \"name\": \"networkZoneId\", \"value\": \"76921bd873115033bd2a0909fe081b45\" } ] } ], \"enforcement_mode\": \"disabled\" }' \\\n",
                      "  \"https://cbr.cloud.ibm.com/v1/rules/{rule_id}\""
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "ruleContextAttributeModel := &contextbasedrestrictionsv1.RuleContextAttribute{\n",
                      "  Name:  core.StringPtr(\"networkZoneId\"),\n",
                      "  Value: core.StringPtr(zoneID),\n",
                      "}\n",
                      "\n",
                      "ruleContextModel := &contextbasedrestrictionsv1.RuleContext{\n",
                      "  Attributes: []contextbasedrestrictionsv1.RuleContextAttribute{*ruleContextAttributeModel},\n",
                      "}\n",
                      "\n",
                      "resourceModel := &contextbasedrestrictionsv1.Resource{\n",
                      "  Attributes: []contextbasedrestrictionsv1.ResourceAttribute{\n",
                      "    {\n",
                      "      Name:  core.StringPtr(\"accountId\"),\n",
                      "      Value: core.StringPtr(accountID),\n",
                      "    },\n",
                      "    {\n",
                      "      Name:  core.StringPtr(\"serviceName\"),\n",
                      "      Value: core.StringPtr(serviceName),\n",
                      "    },\n",
                      "  },\n",
                      "  Tags: []contextbasedrestrictionsv1.ResourceTagAttribute{\n",
                      "    {\n",
                      "      Name:  core.StringPtr(\"tagName\"),\n",
                      "      Value: core.StringPtr(\"updatedTagValue\"),\n",
                      "    },\n",
                      "  },\n",
                      "}\n",
                      "\n",
                      "replaceRuleOptions := contextBasedRestrictionsService.NewReplaceRuleOptions(\n",
                      "  ruleID,\n",
                      "  ruleRev,\n",
                      ")\n",
                      "replaceRuleOptions.SetDescription(\"this is an example of rule\")\n",
                      "replaceRuleOptions.SetContexts([]contextbasedrestrictionsv1.RuleContext{*ruleContextModel})\n",
                      "replaceRuleOptions.SetResources([]contextbasedrestrictionsv1.Resource{*resourceModel})\n",
                      "replaceRuleOptions.SetEnforcementMode(contextbasedrestrictionsv1.ReplaceRuleOptionsEnforcementModeDisabledConst)\n",
                      "\n",
                      "rule, response, err := contextBasedRestrictionsService.ReplaceRule(replaceRuleOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(rule, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "RuleContextAttribute ruleContextAttributeModel = new RuleContextAttribute.Builder()\n",
                      "  .name(\"networkZoneId\")\n",
                      "  .value(zoneID)\n",
                      "  .build();\n",
                      "RuleContext ruleContextModel = new RuleContext.Builder()\n",
                      "  .attributes(java.util.Arrays.asList(ruleContextAttributeModel))\n",
                      "  .build();\n",
                      "ResourceAttribute resourceAttributeModelAccountID = new ResourceAttribute.Builder()\n",
                      "  .name(\"accountId\")\n",
                      "  .value(accountID)\n",
                      "  .build();\n",
                      "ResourceAttribute resourceAttributeModelServiceName = new ResourceAttribute.Builder()\n",
                      "  .name(\"serviceName\")\n",
                      "  .value(serviceName)\n",
                      "  .build();\n",
                      "ResourceTagAttribute resourceTagAttributeModel = new ResourceTagAttribute.Builder()\n",
                      "  .name(\"tagName\")\n",
                      "  .value(\"updatedTagValue\")\n",
                      "  .build();\n",
                      "Resource resourceModel = new Resource.Builder()\n",
                      "  .addAttributes(resourceAttributeModelAccountID)\n",
                      "  .addAttributes(resourceAttributeModelServiceName)\n",
                      "  .addTags(resourceTagAttributeModel)\n",
                      "  .build();\n",
                      "ReplaceRuleOptions replaceRuleOptions = new ReplaceRuleOptions.Builder()\n",
                      "  .ruleId(ruleID)\n",
                      "  .ifMatch(ruleRev)\n",
                      "  .description(\"this is an example of updated rule\")\n",
                      "  .addContexts(ruleContextModel)\n",
                      "  .addResources(resourceModel)\n",
                      "  .enforcementMode(\"disabled\")\n",
                      "  .build();\n",
                      "\n",
                      "Response<Rule> response = contextBasedRestrictionsService.replaceRule(replaceRuleOptions).execute();\n",
                      "Rule rule = response.getResult();\n",
                      "\n",
                      "System.out.println(rule);"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "// Request models needed by this operation.\n",
                      "\n",
                      "// RuleContextAttribute\n",
                      "const ruleContextAttributeModel = {\n",
                      "  name: 'networkZoneId',\n",
                      "  value: zoneId,\n",
                      "};\n",
                      "\n",
                      "// RuleContext\n",
                      "const ruleContextModel = {\n",
                      "  attributes: [ruleContextAttributeModel],\n",
                      "};\n",
                      "\n",
                      "// ResourceAttribute\n",
                      "const resourceAttributeAccountIdModel = {\n",
                      "  name: 'accountId',\n",
                      "  value: accountId,\n",
                      "};\n",
                      "\n",
                      "// ResourceAttribute\n",
                      "const resourceAttributeServiceNameModel = {\n",
                      "  name: 'serviceName',\n",
                      "  value: serviceName,\n",
                      "};\n",
                      "\n",
                      "const resourceTagAttributeModel = {\n",
                      "  name: 'TagName',\n",
                      "  value: 'aTagValue',\n",
                      "};\n",
                      "\n",
                      "// Resource\n",
                      "const resourceModel = {\n",
                      "  attributes: [resourceAttributeAccountIdModel, resourceAttributeServiceNameModel],\n",
                      "  tags: [resourceTagAttributeModel],\n",
                      "};\n",
                      "\n",
                      "const params = {\n",
                      "  ruleId,\n",
                      "  ifMatch: ruleRev,\n",
                      "  contexts: [ruleContextModel],\n",
                      "  resources: [resourceModel],\n",
                      "  description: 'this is an example of updated rule',\n",
                      "  enforcementMode: 'disabled',\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  const res = await contextBasedRestrictionsService.replaceRule(params);\n",
                      "  ruleId = res.result.id;\n",
                      "  ruleRev = res.headers.etag;\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "rule_context_attribute_model = {\n",
                      "  'name': 'networkZoneId',\n",
                      "  'value': zone_id,\n",
                      "}\n",
                      "\n",
                      "rule_context_model = {\n",
                      "  'attributes': [rule_context_attribute_model],\n",
                      "}\n",
                      "\n",
                      "resource_attribute_model = {\n",
                      "  'name': 'accountId',\n",
                      "  'value': account_id,\n",
                      "}\n",
                      "\n",
                      "resource_attribute_service_name_model = {\n",
                      "  'name': 'serviceName',\n",
                      "  'value': service_name,\n",
                      "}\n",
                      "\n",
                      "resource_tag_attribute_model = {\n",
                      "  'name': 'tagName',\n",
                      "  'value': 'tagValue',\n",
                      "}\n",
                      "\n",
                      "resource_model = {\n",
                      "  'attributes': [resource_attribute_model, resource_attribute_service_name_model],\n",
                      "  'tags': [resource_tag_attribute_model],\n",
                      "}\n",
                      "\n",
                      "response = context_based_restrictions_service.replace_rule(\n",
                      "  rule_id=rule_id,\n",
                      "  if_match=rule_rev,\n",
                      "  contexts=[rule_context_model],\n",
                      "  resources=[resource_model],\n",
                      "  description='this is an example of updated rule',\n",
                      "  enforcement_mode='disabled',\n",
                      ")\n",
                      "rule = response.get_result()\n",
                      "\n",
                      "print(json.dumps(rule, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        }
      },
      "delete": {
        "tags": [
          "Rules"
        ],
        "summary": "Delete a rule",
        "operationId": "delete_rule",
        "description": "This operation deletes the rule identified by the specified rule ID.",
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "cbr.rule.delete"
            }
          ]
        },
        "x-cli-command": "rule-delete",
        "responses": {
          "204": {
            "description": "The rule was successfully deleted."
          },
          "400": {
            "description": "The rule could not be deleted due to an invalid or missing input parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 400,
                  "errors": [
                    {
                      "code": "parameter_error",
                      "message": "The parameter \"rule_id\" in path has an error.",
                      "target": {
                        "name": "rule_id",
                        "type": "parameter",
                        "value": "an-invalid-rule-id"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "You are not authorized to make this request. The token is either missing, invalid, or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 401,
                  "errors": [
                    {
                      "code": "invalid_auth_token",
                      "message": "The token failed to validate.",
                      "target": {
                        "name": "Authorization",
                        "type": "header"
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The supplied authentication is not authorized to perform the operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 403,
                  "errors": [
                    {
                      "code": "request_not_authorized",
                      "message": "The request could not be authorized."
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "The rule could not be found. Verify that the specified rule ID is valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 404,
                  "errors": [
                    {
                      "code": "rule_not_found_in_store",
                      "message": "The rule 'fb988c9387e84390ba98bce4744c0a9c' is not found.",
                      "target": {
                        "name": "zone_id",
                        "type": "parameter",
                        "value": "fb988c9387e84390ba98bce4744c0a9c"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 429,
                  "errors": [
                    {
                      "code": "too_many_requests",
                      "message": "The client has sent too many requests in a given amount of time."
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "A backend service required to complete the operation is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 503,
                  "errors": [
                    {
                      "code": "store_unavailable_error",
                      "message": "The store is currently unavailable. Try again later."
                    }
                  ]
                }
              }
            }
          }
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X DELETE --location --header \"Authorization: Bearer {iam_token}\" \\\n",
                      "  \"https://cbr.cloud.ibm.com/v1/rules/{rule_id}\""
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "deleteRuleOptions := contextBasedRestrictionsService.NewDeleteRuleOptions(\n",
                      "  ruleID,\n",
                      ")\n",
                      "\n",
                      "response, err := contextBasedRestrictionsService.DeleteRule(deleteRuleOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "if response.StatusCode != 204 {\n",
                      "  fmt.Printf(\"\\nUnexpected response status code received from DeleteRule(): %d\\n\", response.StatusCode)\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "DeleteRuleOptions deleteRuleOptions = new DeleteRuleOptions.Builder()\n",
                      "  .ruleId(ruleID)\n",
                      "  .build();\n",
                      "\n",
                      "Response<Void> response = contextBasedRestrictionsService.deleteRule(deleteRuleOptions).execute();"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  ruleId,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  await contextBasedRestrictionsService.deleteRule(params);\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "response = context_based_restrictions_service.delete_rule(\n",
                      "  rule_id=rule_id,\n",
                      ")"
                    ]
                  }
                ]
              }
            ]
          }
        }
      }
    },
    "/v1/account_settings/{account_id}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/x_correlation_id_in_header"
        },
        {
          "$ref": "#/components/parameters/transaction_id_in_header"
        },
        {
          "$ref": "#/components/parameters/account_id_in_path"
        }
      ],
      "get": {
        "tags": [
          "Account settings"
        ],
        "summary": "Get account settings",
        "operationId": "get_account_settings",
        "description": "This operation retrieves the settings for the specified account ID.",
        "x-ibm-permissions": {
          "actions": [
            {
              "name": "context-based-restrictions.account-settings.read"
            }
          ]
        },
        "x-cli-command": "account-settings",
        "x-cli-description": "Show details of account settings",
        "responses": {
          "200": {
            "description": "The account settings were successfully retrieved.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/etag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountSettings"
                },
                "example": {
                  "id": "cbrAccountSettings-12ab34cd56ef78ab90cd12ef34ab56cd",
                  "crn": "crn:v1:bluemix:public:context-based-restrictions:global:a/12ab34cd56ef78ab90cd12ef34ab56cd::account-settings:",
                  "zone_count_limit": 500,
                  "rule_count_limit": 4020,
                  "tags_rule_count_limit": 500,
                  "current_zone_count": 123,
                  "current_rule_count": 234,
                  "current_tags_rule_count": 45,
                  "href": "https://cbr.cloud.ibm.com/v1/account_settings/12ab34cd56ef78ab90cd12ef34ab56cd"
                }
              }
            }
          },
          "400": {
            "description": "The account settings could not be retrieved due to an invalid or missing input parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 400,
                  "errors": [
                    {
                      "code": "parameter_error",
                      "message": "The parameter \"account_id\" in path has an error.",
                      "target": {
                        "name": "account_id",
                        "type": "parameter",
                        "value": "an-invalid-account-id"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "You are not authorized to make this request. The token is either missing, invalid, or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 401,
                  "errors": [
                    {
                      "code": "invalid_auth_token",
                      "message": "The token failed to validate.",
                      "target": {
                        "name": "Authorization",
                        "type": "header"
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "The supplied authentication is not authorized to perform the operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 403,
                  "errors": [
                    {
                      "code": "request_not_authorized",
                      "message": "The request could not be authorized."
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 429,
                  "errors": [
                    {
                      "code": "too_many_requests",
                      "message": "The client has sent too many requests in a given amount of time."
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "A backend service required to complete the operation is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 503,
                  "errors": [
                    {
                      "code": "store_unavailable_error",
                      "message": "The store is currently unavailable. Try again later."
                    }
                  ]
                }
              }
            }
          }
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X GET --location --header \"Authorization: Bearer {iam_token}\" \\\n",
                      "  --header \"Accept: application/json\" \\\n",
                      "  \"https://cbr.cloud.ibm.com/v1/account_settings/{account_id}\""
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "getAccountSettingsOptions := contextBasedRestrictionsService.NewGetAccountSettingsOptions(\n",
                      "  accountID,\n",
                      ")\n",
                      "\n",
                      "accountSettings, response, err := contextBasedRestrictionsService.GetAccountSettings(getAccountSettingsOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(accountSettings, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "      GetAccountSettingsOptions getAccountSettingsOptions = new GetAccountSettingsOptions.Builder()\n",
                      "          .accountId(accountID)\n",
                      "          .build();\n",
                      "\n",
                      "      Response<AccountSettings> response = contextBasedRestrictionsService.getAccountSettings(getAccountSettingsOptions).execute();\n",
                      "      AccountSettings accountSettings = response.getResult();\n",
                      "\n",
                      "      System.out.println(accountSettings);\n",
                      "GetAccountSettingsOptions getAccountSettingsOptions = new GetAccountSettingsOptions.Builder()\n",
                      "  .accountId(accountId)\n",
                      "  .build();\n",
                      "\n",
                      "Response<AccountSettings> response = ibmCloudShellService.getAccountSettings(getAccountSettingsOptions).execute();\n",
                      "AccountSettings accountSettings = response.getResult();\n",
                      "\n",
                      "System.out.println(accountSettings);\n",
                      "\n",
                      "GetAccountSettingsOptions getAccountSettingsOptions = new GetAccountSettingsOptions.Builder()\n",
                      "  .accountId(testAccountId)\n",
                      "  .build();\n",
                      "\n",
                      "Response<AccountSettings> response = iamAccessGroupsService.getAccountSettings(getAccountSettingsOptions).execute();\n",
                      "AccountSettings accountSettings = response.getResult();\n",
                      "\n",
                      "System.out.println(accountSettings);"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  accountId: testAccountId,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  const res = await iamAccessGroupsService.getAccountSettings(params);\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}\n",
                      "\n",
                      "\n",
                      "const params = {\n",
                      "  accountId: accountId,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  const res = await ibmCloudShellService.getAccountSettings(params);\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err)\n",
                      "}\n",
                      "\n",
                      "\n",
                      "const params = {\n",
                      "  accountId,\n",
                      "};\n",
                      "\n",
                      "try {\n",
                      "  const res = await contextBasedRestrictionsService.getAccountSettings(params);\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "response = iam_access_groups_service.get_account_settings(\n",
                      "  account_id=test_account_id,\n",
                      ")\n",
                      "account_settings = response.get_result()\n",
                      "\n",
                      "print(json.dumps(account_settings, indent=2))\n",
                      "\n",
                      "\n",
                      "response = context_based_restrictions_service.get_account_settings(\n",
                      "  account_id=account_id,\n",
                      ")\n",
                      "account_settings = response.get_result()\n",
                      "\n",
                      "print(json.dumps(account_settings, indent=2))\n",
                      "\n",
                      "\n",
                      "account_settings = ibm_cloud_shell_service.get_account_settings(account_id=account_id).get_result()\n",
                      "\n",
                      "print(json.dumps(account_settings, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        }
      }
    },
    "/v1/operations": {
      "parameters": [
        {
          "$ref": "#/components/parameters/x_correlation_id_in_header"
        },
        {
          "$ref": "#/components/parameters/transaction_id_in_header"
        },
        {
          "$ref": "#/components/parameters/operations_service_name_in_query"
        },
        {
          "$ref": "#/components/parameters/operations_service_group_in_query"
        },
        {
          "$ref": "#/components/parameters/operations_resource_type_in_query"
        }
      ],
      "get": {
        "tags": [
          "Operations"
        ],
        "summary": "List available service operations",
        "operationId": "list_available_service_operations",
        "description": "This operation lists all available service operations.",
        "x-cli-command": "available-service-operations",
        "responses": {
          "200": {
            "description": "The service operations were successfully retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationsList"
                },
                "example": {
                  "api_types": [
                    {
                      "actions": [
                        {
                          "action_id": "codeengine.computeenvironment.create",
                          "description": "Allows you to create a Code Engine Compute Environment."
                        },
                        {
                          "action_id": "codeengine.computeenvironment.delete",
                          "description": "Allows you to delete compute environments."
                        },
                        {
                          "action_id": "codeengine.computeenvironment.projects.create",
                          "description": "Allows you to create projects in this compute environment."
                        },
                        {
                          "action_id": "codeengine.computeenvironment.projects.delete",
                          "description": "Allows you to delete projects in this compute environment."
                        },
                        {
                          "action_id": "codeengine.config.read",
                          "description": "Configuration Information Point API access"
                        },
                        {
                          "action_id": "codeengine.dashboard.view",
                          "description": "View Dashboard"
                        },
                        {
                          "action_id": "codeengine.tenant.entities.create",
                          "description": "Create project contents, such as applications, job definitions, and jobs"
                        },
                        {
                          "action_id": "codeengine.tenant.entities.delete",
                          "description": "Delete existing items from within a project"
                        },
                        {
                          "action_id": "codeengine.tenant.entities.read",
                          "description": "List and view existing items within a project"
                        },
                        {
                          "action_id": "codeengine.tenant.entities.update",
                          "description": "Modify existing items already contained by a project, such as applications, jobs, or job definitions.  This does not include the ability to create or delete these items."
                        },
                        {
                          "action_id": "codeengine.tenant.read",
                          "description": "View project details"
                        }
                      ],
                      "api_type_id": "crn:v1:bluemix:public:context-based-restrictions::::api-type:",
                      "description": "Protects all service APIs.",
                      "display_name": "All",
                      "enforcement_modes": [
                        "disabled",
                        "enabled",
                        "report"
                      ],
                      "type": "service"
                    },
                    {
                      "actions": [
                        {
                          "action_id": "global-search-tagging.tag.attach-access-tag",
                          "description": "The ability to attach access management tags to a resource"
                        },
                        {
                          "action_id": "global-search-tagging.tag.attach-user-tag",
                          "description": "The ability to attach a user tag to the resource"
                        },
                        {
                          "action_id": "global-search-tagging.tag.detach-access-tag",
                          "description": "The ability to detach access management tags from a resource"
                        },
                        {
                          "action_id": "global-search-tagging.tag.detach-user-tag",
                          "description": "The ability to detach a user tag from the resource"
                        },
                        {
                          "action_id": "resource-controller.alias.create",
                          "description": "The ability to create aliases."
                        },
                        {
                          "action_id": "resource-controller.alias.delete",
                          "description": "The ability to delete existing aliases."
                        },
                        {
                          "action_id": "resource-controller.alias.retrieve",
                          "description": "The ability to see aliases."
                        },
                        {
                          "action_id": "resource-controller.alias.update",
                          "description": "The ability to update or edit existing aliases."
                        },
                        {
                          "action_id": "resource-controller.binding.create",
                          "description": "The ability to create bindings."
                        },
                        {
                          "action_id": "resource-controller.binding.delete",
                          "description": "The ability to delete existing bindings."
                        },
                        {
                          "action_id": "resource-controller.binding.retrieve",
                          "description": "The ability to see bindings."
                        },
                        {
                          "action_id": "resource-controller.binding.update",
                          "description": "The ability to update or edit existing bindings."
                        },
                        {
                          "action_id": "resource-controller.credential.retrieve_all",
                          "description": "The ability to retrieve all credentials for instances."
                        },
                        {
                          "action_id": "resource-controller.instance.create",
                          "description": "The ability to create instances."
                        },
                        {
                          "action_id": "resource-controller.instance.delete",
                          "description": "The ability to delete existing instances."
                        },
                        {
                          "action_id": "resource-controller.instance.retrieve",
                          "description": "The ability to see instances."
                        },
                        {
                          "action_id": "resource-controller.instance.retrieve_history",
                          "description": "The ability to see the history for instances."
                        },
                        {
                          "action_id": "resource-controller.instance.update",
                          "description": "The ability to update or edit existing instances."
                        },
                        {
                          "action_id": "resource-controller.instance.update_plan",
                          "description": "The ability to update the plan or configuration of existing instances."
                        },
                        {
                          "action_id": "resource-controller.key.create",
                          "description": "The ability to create keys."
                        },
                        {
                          "action_id": "resource-controller.key.delete",
                          "description": "The ability to delete existing keys."
                        },
                        {
                          "action_id": "resource-controller.key.manager_create",
                          "description": "The ability to create keys by KeyManager."
                        },
                        {
                          "action_id": "resource-controller.key.manager_delete",
                          "description": "The ability to delete existing keys by KeyManager."
                        },
                        {
                          "action_id": "resource-controller.key.manager_retrieve",
                          "description": "The ability to retrieve keys by KeyManager."
                        },
                        {
                          "action_id": "resource-controller.key.manager_update",
                          "description": "The ability to update or edit existing keys by KeyManager."
                        },
                        {
                          "action_id": "resource-controller.key.retrieve",
                          "description": "The ability to retrieve keys."
                        },
                        {
                          "action_id": "resource-controller.key.update",
                          "description": "The ability to update or edit existing keys."
                        }
                      ],
                      "api_type_id": "crn:v1:bluemix:public:context-based-restrictions::::platform-api-type:",
                      "description": "Protects all platform APIs.",
                      "display_name": "All",
                      "enforcement_modes": [
                        "disabled",
                        "enabled",
                        "report"
                      ],
                      "type": "platform"
                    },
                    {
                      "actions": [
                        {
                          "action_id": "global-search-tagging.tag.attach-access-tag",
                          "description": "The ability to attach access management tags to a resource"
                        },
                        {
                          "action_id": "global-search-tagging.tag.attach-user-tag",
                          "description": "The ability to attach a user tag to the resource"
                        },
                        {
                          "action_id": "global-search-tagging.tag.detach-access-tag",
                          "description": "The ability to detach access management tags from a resource"
                        },
                        {
                          "action_id": "global-search-tagging.tag.detach-user-tag",
                          "description": "The ability to detach a user tag from the resource"
                        },
                        {
                          "action_id": "resource-controller.alias.create",
                          "description": "The ability to create aliases."
                        },
                        {
                          "action_id": "resource-controller.alias.delete",
                          "description": "The ability to delete existing aliases."
                        },
                        {
                          "action_id": "resource-controller.alias.retrieve",
                          "description": "The ability to see aliases."
                        },
                        {
                          "action_id": "resource-controller.alias.update",
                          "description": "The ability to update or edit existing aliases."
                        },
                        {
                          "action_id": "resource-controller.binding.create",
                          "description": "The ability to create bindings."
                        },
                        {
                          "action_id": "resource-controller.binding.delete",
                          "description": "The ability to delete existing bindings."
                        },
                        {
                          "action_id": "resource-controller.binding.retrieve",
                          "description": "The ability to see bindings."
                        },
                        {
                          "action_id": "resource-controller.binding.update",
                          "description": "The ability to update or edit existing bindings."
                        },
                        {
                          "action_id": "resource-controller.credential.retrieve_all",
                          "description": "The ability to retrieve all credentials for instances."
                        },
                        {
                          "action_id": "resource-controller.instance.create",
                          "description": "The ability to create instances."
                        },
                        {
                          "action_id": "resource-controller.instance.delete",
                          "description": "The ability to delete existing instances."
                        },
                        {
                          "action_id": "resource-controller.instance.retrieve",
                          "description": "The ability to see instances."
                        },
                        {
                          "action_id": "resource-controller.instance.retrieve_history",
                          "description": "The ability to see the history for instances."
                        },
                        {
                          "action_id": "resource-controller.instance.update",
                          "description": "The ability to update or edit existing instances."
                        },
                        {
                          "action_id": "resource-controller.instance.update_plan",
                          "description": "The ability to update the plan or configuration of existing instances."
                        },
                        {
                          "action_id": "resource-controller.key.create",
                          "description": "The ability to create keys."
                        },
                        {
                          "action_id": "resource-controller.key.delete",
                          "description": "The ability to delete existing keys."
                        },
                        {
                          "action_id": "resource-controller.key.manager_create",
                          "description": "The ability to create keys by KeyManager."
                        },
                        {
                          "action_id": "resource-controller.key.manager_delete",
                          "description": "The ability to delete existing keys by KeyManager."
                        },
                        {
                          "action_id": "resource-controller.key.manager_retrieve",
                          "description": "The ability to retrieve keys by KeyManager."
                        },
                        {
                          "action_id": "resource-controller.key.manager_update",
                          "description": "The ability to update or edit existing keys by KeyManager."
                        },
                        {
                          "action_id": "resource-controller.key.retrieve",
                          "description": "The ability to retrieve keys."
                        },
                        {
                          "action_id": "resource-controller.key.update",
                          "description": "The ability to update or edit existing keys."
                        }
                      ],
                      "api_type_id": "crn:v1:bluemix:public:context-based-restrictions::::platform-api-type:resource-management",
                      "description": "Protects access to platform APIs related to resource instances such as attaching tags and managing service credentials.",
                      "display_name": "Resource Management",
                      "enforcement_modes": [
                        "disabled",
                        "enabled",
                        "report"
                      ],
                      "type": "platform"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The service operations could not be retrieved due to an invalid or missing input parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 400,
                  "errors": [
                    {
                      "code": "parameter_error",
                      "message": "The parameter \"service_name\" in query has an error.",
                      "target": {
                        "name": "service_name",
                        "type": "parameter",
                        "value": "an_invalid_service_name"
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "You are not authorized to make this request. The token is either missing, invalid, or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 401,
                  "errors": [
                    {
                      "code": "invalid_auth_token",
                      "message": "The token failed to validate.",
                      "target": {
                        "name": "Authorization",
                        "type": "header"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 429,
                  "errors": [
                    {
                      "code": "too_many_requests",
                      "message": "The client has sent too many requests in a given amount of time."
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "A backend service required to complete the operation is unavailable. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorContainer"
                },
                "example": {
                  "trace": "b05ed07e-c4d9-4285-841c-1e954c0b4a0e",
                  "status_code": 503,
                  "errors": [
                    {
                      "code": "backend_service_unavailable",
                      "message": "Unexpected error retrieving service definition."
                    }
                  ]
                }
              }
            }
          }
        },
        "x-sdk-operations": {
          "request-examples": {
            "curl": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "curl -X GET --location --header \"Authorization: Bearer {iam_token}\" \\\n",
                      "  --header \"Accept: application/json\" \\\n",
                      "  \"https://cbr.cloud.ibm.com/v1/operations?service_name={service_name}\""
                    ]
                  }
                ]
              }
            ],
            "go": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "listAvailableServiceOperationsOptions := contextBasedRestrictionsService.NewListAvailableServiceOperationsOptions()\n",
                      "listAvailableServiceOperationsOptions.SetServiceName(\"containers-kubernetes\")\n",
                      "\n",
                      "operationsList, response, err := contextBasedRestrictionsService.ListAvailableServiceOperations(listAvailableServiceOperationsOptions)\n",
                      "if err != nil {\n",
                      "  panic(err)\n",
                      "}\n",
                      "b, _ := json.MarshalIndent(operationsList, \"\", \"  \")\n",
                      "fmt.Println(string(b))"
                    ]
                  }
                ]
              }
            ],
            "java": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "ListAvailableServiceOperationsOptions listAvailableServiceOperationsOptions = new ListAvailableServiceOperationsOptions.Builder()\n",
                      "  .serviceName(\"containers-kubernetes\")\n",
                      "  .build();\n",
                      "\n",
                      "Response<OperationsList> response = contextBasedRestrictionsService.listAvailableServiceOperations(listAvailableServiceOperationsOptions).execute();\n",
                      "OperationsList operationsList = response.getResult();\n",
                      "\n",
                      "System.out.println(operationsList);"
                    ]
                  }
                ]
              }
            ],
            "node": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "const params = {\n",
                      "  serviceName: 'containers-kubernetes',\n",
                      "};\n",
                      "\n",
                      "let res;\n",
                      "try {\n",
                      "  res = await contextBasedRestrictionsService.listAvailableServiceOperations(params);\n",
                      "  console.log(JSON.stringify(res.result, null, 2));\n",
                      "} catch (err) {\n",
                      "  console.warn(err);\n",
                      "}"
                    ]
                  }
                ]
              }
            ],
            "python": [
              {
                "name": "Example request",
                "example": [
                  {
                    "type": "code",
                    "source": [
                      "operations_list = context_based_restrictions_service.list_available_service_operations(\n",
                      "  service_name='containers-kubernetes'\n",
                      ").get_result()\n",
                      "\n",
                      "print(json.dumps(operations_list, indent=2))"
                    ]
                  }
                ]
              }
            ]
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "IamToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Your IBM Cloud access token."
      }
    },
    "headers": {
      "etag": {
        "schema": {
          "type": "string",
          "description": "The current revision of the resource."
        }
      }
    },
    "parameters": {
      "x_correlation_id_in_header": {
        "name": "X-Correlation-Id",
        "in": "header",
        "required": false,
        "description": "The supplied or generated value of this header is logged for a request and repeated in a response header\nfor the corresponding response.\nThe same value is used for downstream requests and retries of those requests.\nIf a value of this headers is not supplied in a request, the service generates a random (version 4) UUID.\n",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024,
          "pattern": "^[a-zA-Z0-9 ,\\-_]+$"
        }
      },
      "transaction_id_in_header": {
        "name": "Transaction-Id",
        "in": "header",
        "required": false,
        "description": "The `Transaction-Id` header behaves as the `X-Correlation-Id` header.\nIt is supported for backward compatibility with other IBM platform services that support the `Transaction-Id` header only.\nIf both `X-Correlation-Id` and `Transaction-Id` are provided, `X-Correlation-Id` has the precedence over `Transaction-Id`.\n",
        "deprecated": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024,
          "pattern": "^[a-zA-Z0-9 ,\\-_]+$"
        }
      },
      "if_match_in_header": {
        "name": "If-Match",
        "in": "header",
        "required": true,
        "description": "The current revision of the resource being updated.\nThis can be found in the Create/Get/Update resource response ETag header.\n",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[a-fA-F0-9\\-]+$"
        }
      },
      "region_in_query": {
        "name": "region",
        "in": "query",
        "description": "The `region` resource attribute.",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32,
          "pattern": "^[a-zA-Z0-9\\-]+$"
        }
      },
      "resource_in_query": {
        "name": "resource",
        "in": "query",
        "description": "The `resource` resource attribute.",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024,
          "pattern": "^[\\S\\s]+$"
        }
      },
      "resource_type_in_query": {
        "name": "resource_type",
        "in": "query",
        "description": "The `resourceType` resource attribute.",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[\\S\\s]+$"
        }
      },
      "service_instance_in_query": {
        "name": "service_instance",
        "in": "query",
        "description": "The `serviceInstance` resource attribute.",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[0-9a-z\\-/]+$"
        }
      },
      "service_name_in_query": {
        "name": "service_name",
        "in": "query",
        "description": "The `serviceName` resource attribute.",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[0-9a-z\\-]+$"
        }
      },
      "enforcement_mode_in_query": {
        "name": "enforcement_mode",
        "in": "query",
        "description": "The rule's `enforcement_mode` attribute.",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "enabled",
            "disabled",
            "report"
          ]
        }
      },
      "service_type_in_query": {
        "name": "service_type",
        "in": "query",
        "description": "The rule's `serviceType` resource attribute.",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[0-9a-z_]+$"
        }
      },
      "service_group_in_query": {
        "name": "service_group_id",
        "in": "query",
        "description": "The rule's `service_group_id` resource attribute.",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[a-zA-Z0-9]+$"
        }
      },
      "zone_id_in_query": {
        "name": "zone_id",
        "in": "query",
        "description": "The globally unique ID of the zone.",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 32,
          "maxLength": 32,
          "pattern": "^[a-fA-F0-9]{32}$"
        }
      },
      "zone_name_in_query": {
        "name": "name",
        "in": "query",
        "description": "The name of the zone.",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100,
          "pattern": "^\\*?[a-zA-Z0-9 \\-_]+\\*?$"
        }
      },
      "sort_in_query": {
        "name": "sort",
        "in": "query",
        "description": "Sorts results by using a valid sort field.\nTo learn more, see [Sorting](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-sorting).\n",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32,
          "pattern": "^[\\-]?[a-z0-9_]+$"
        }
      },
      "account_id_in_path": {
        "name": "account_id",
        "in": "path",
        "description": "The ID of the account the settings are for.",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[a-zA-Z0-9\\-]+$"
        }
      },
      "rule_id_in_path": {
        "name": "rule_id",
        "in": "path",
        "description": "The ID of a rule.",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 32,
          "maxLength": 32,
          "pattern": "^[a-fA-F0-9]{32}$"
        }
      },
      "service_name_in_path": {
        "name": "service_name",
        "in": "path",
        "description": "The name of a service.",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[0-9a-z\\-]+$"
        }
      },
      "zone_id_in_path": {
        "name": "zone_id",
        "in": "path",
        "description": "The ID of a zone.",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 32,
          "maxLength": 32,
          "pattern": "^[a-fA-F0-9]{32}$"
        }
      },
      "required_account_id_in_query": {
        "name": "account_id",
        "in": "query",
        "description": "The ID of the managing account.",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[a-zA-Z0-9\\-]+$"
        }
      },
      "operations_service_name_in_query": {
        "name": "service_name",
        "in": "query",
        "description": "The name of the service.",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^[-0-9a-z]+$"
        }
      },
      "operations_service_group_in_query": {
        "name": "service_group_id",
        "in": "query",
        "description": "The id of the service group.",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[a-zA-Z0-9]+$"
        }
      },
      "operations_resource_type_in_query": {
        "name": "resource_type",
        "in": "query",
        "description": "The type of resource.",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[\\S\\s]+$"
        }
      }
    },
    "schemas": {
      "RuleContextAttribute": {
        "description": "An rule context attribute",
        "type": "object",
        "required": [
          "name",
          "value"
        ],
        "properties": {
          "name": {
            "description": "The attribute name",
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[a-zA-Z0-9]+$"
          },
          "value": {
            "description": "The attribute value",
            "type": "string",
            "minLength": 1,
            "maxLength": 1000,
            "pattern": "^[\\S\\s]+$"
          }
        },
        "additionalProperties": false
      },
      "RuleContext": {
        "description": "A rule context",
        "type": "object",
        "required": [
          "attributes"
        ],
        "properties": {
          "attributes": {
            "description": "The attributes",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleContextAttribute"
            },
            "minItems": 1
          }
        },
        "additionalProperties": false
      },
      "ResourceAttribute": {
        "description": "A rule resource attribute",
        "type": "object",
        "required": [
          "name",
          "value"
        ],
        "properties": {
          "name": {
            "description": "The attribute name",
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[a-zA-Z0-9_]+$"
          },
          "value": {
            "description": "The attribute value",
            "type": "string",
            "minLength": 1,
            "maxLength": 1000,
            "pattern": "^[\\S\\s]+$"
          },
          "operator": {
            "description": "The attribute operator",
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[a-zA-Z0-9]+$"
          }
        },
        "additionalProperties": false
      },
      "ResourceTagAttribute": {
        "description": "A rule resource tag attribute",
        "type": "object",
        "required": [
          "name",
          "value"
        ],
        "properties": {
          "name": {
            "description": "The tag attribute name",
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-zA-Z0-9 _.-]+$"
          },
          "value": {
            "description": "The tag attribute value",
            "type": "string",
            "minLength": 1,
            "maxLength": 1000,
            "pattern": "^[a-zA-Z0-9 _*?.-]+$"
          },
          "operator": {
            "description": "The attribute operator",
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[a-zA-Z0-9]+$"
          }
        },
        "additionalProperties": false
      },
      "Resource": {
        "description": "An rule resource",
        "type": "object",
        "required": [
          "attributes"
        ],
        "properties": {
          "attributes": {
            "description": "The resource attributes",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResourceAttribute"
            },
            "minItems": 1
          },
          "tags": {
            "description": "The optional resource tags",
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/ResourceTagAttribute"
            }
          }
        },
        "additionalProperties": false
      },
      "Error": {
        "description": "Error details to return for failed operations.",
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "description": "A code that is used to identify the problem that caused the error.",
            "type": "string"
          },
          "message": {
            "description": "An extended description that describes the solution to the problem.",
            "type": "string"
          },
          "more_info": {
            "description": "The publicly-accessible URL where information about the error can be read in a web browser.",
            "type": "string"
          },
          "target": {
            "$ref": "#/components/schemas/ErrorTarget"
          },
          "cause": {
            "description": "The underlying cause of the error.",
            "type": "string"
          }
        }
      },
      "ErrorTarget": {
        "description": "The error target.",
        "type": "object",
        "required": [
          "type",
          "name"
        ],
        "properties": {
          "type": {
            "description": "The error target type.",
            "type": "string",
            "enum": [
              "field",
              "parameter",
              "header"
            ]
          },
          "name": {
            "description": "The error target name.",
            "type": "string"
          },
          "value": {
            "description": "The error target value.",
            "type": "string"
          }
        }
      },
      "ErrorContainer": {
        "description": "Container of error details to return for failed operations.",
        "type": "object",
        "required": [
          "errors",
          "trace",
          "status_code"
        ],
        "properties": {
          "errors": {
            "description": "An array with at least one error.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Error"
            },
            "minItems": 1
          },
          "trace": {
            "description": "A lowercase UUID uniquely identifying the request.",
            "type": "string"
          },
          "status_code": {
            "description": "The HTTP status code used for the response.",
            "type": "integer"
          }
        }
      },
      "ResourceMetadata": {
        "description": "Resource metadata",
        "allOf": [
          {
            "type": "object",
            "required": [
              "href",
              "created_at",
              "created_by_id",
              "last_modified_at",
              "last_modified_by_id"
            ]
          },
          {
            "$ref": "#/components/schemas/RuntimeResourceMetadata"
          },
          {
            "$ref": "#/components/schemas/PersistentResourceMetadata"
          }
        ]
      },
      "ResourceMetadataOptionalPersistentProperties": {
        "description": "Resource metadata\nPersistent properties are optional\n",
        "allOf": [
          {
            "type": "object",
            "required": [
              "href"
            ]
          },
          {
            "$ref": "#/components/schemas/RuntimeResourceMetadata"
          },
          {
            "$ref": "#/components/schemas/PersistentResourceMetadata"
          }
        ]
      },
      "RuntimeResourceMetadata": {
        "description": "Runtime resource metadata",
        "type": "object",
        "properties": {
          "href": {
            "description": "The href link to the resource.",
            "type": "string"
          }
        }
      },
      "PersistentResourceMetadata": {
        "description": "Persistent resource metadata",
        "type": "object",
        "properties": {
          "created_at": {
            "description": "The time the resource was created.",
            "type": "string",
            "format": "date-time"
          },
          "created_by_id": {
            "description": "IAM ID of the user or service which created the resource.",
            "type": "string"
          },
          "last_modified_at": {
            "description": "The last time the resource was modified.",
            "type": "string",
            "format": "date-time"
          },
          "last_modified_by_id": {
            "description": "IAM ID of the user or service which modified the resource.",
            "type": "string"
          }
        }
      },
      "Address": {
        "description": "A zone address",
        "properties": {
          "type": {
            "description": "The type of address",
            "type": "string",
            "enum": [
              "ipAddress",
              "ipRange",
              "subnet",
              "vpc",
              "serviceRef"
            ]
          }
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/IPAddress"
          },
          {
            "$ref": "#/components/schemas/IPAddressRange"
          },
          {
            "$ref": "#/components/schemas/Subnet"
          },
          {
            "$ref": "#/components/schemas/VPC"
          },
          {
            "$ref": "#/components/schemas/ServiceRef"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "ipAddress": "#/components/schemas/IPAddress",
            "ipRange": "#/components/schemas/IPAddressRange",
            "subnet": "#/components/schemas/Subnet",
            "vpc": "#/components/schemas/VPC",
            "serviceRef": "#/components/schemas/ServiceRef"
          }
        }
      },
      "IPAddress": {
        "description": "A single IP address. IPv4 and IPv6 are supported.",
        "type": "object",
        "required": [
          "type",
          "value"
        ],
        "properties": {
          "type": {
            "description": "The type of address",
            "type": "string",
            "enum": [
              "ipAddress"
            ]
          },
          "value": {
            "description": "The IP address",
            "type": "string",
            "minLength": 2,
            "maxLength": 45,
            "pattern": "^[a-zA-Z0-9:.]+$"
          }
        },
        "additionalProperties": false
      },
      "IPAddressRange": {
        "description": "An IP address range. IPv4 and IPv6 are supported.",
        "type": "object",
        "required": [
          "type",
          "value"
        ],
        "properties": {
          "type": {
            "description": "The type of address",
            "type": "string",
            "enum": [
              "ipRange"
            ]
          },
          "value": {
            "description": "The ip range in <first-ip>-<last-ip> format",
            "type": "string",
            "minLength": 5,
            "maxLength": 91,
            "pattern": "^[a-zA-Z0-9:.-]+$"
          }
        },
        "additionalProperties": false
      },
      "Subnet": {
        "description": "A subnet in CIDR format",
        "type": "object",
        "required": [
          "type",
          "value"
        ],
        "properties": {
          "type": {
            "description": "The type of address",
            "type": "string",
            "enum": [
              "subnet"
            ]
          },
          "value": {
            "description": "The subnet in CIDR format",
            "type": "string",
            "minLength": 4,
            "maxLength": 49,
            "pattern": "^[a-zA-Z0-9:./]+$"
          }
        },
        "additionalProperties": false
      },
      "VPC": {
        "description": "A single VPC address",
        "type": "object",
        "required": [
          "type",
          "value"
        ],
        "properties": {
          "type": {
            "description": "The type of address",
            "type": "string",
            "enum": [
              "vpc"
            ]
          },
          "value": {
            "description": "The VPC CRN",
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^crn:v1:([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):vpc:([^:]*)$"
          }
        },
        "additionalProperties": false
      },
      "ServiceRef": {
        "description": "A service reference",
        "type": "object",
        "required": [
          "type",
          "ref"
        ],
        "properties": {
          "type": {
            "description": "The type of address",
            "type": "string",
            "enum": [
              "serviceRef"
            ]
          },
          "ref": {
            "$ref": "#/components/schemas/ServiceRefValue"
          }
        },
        "additionalProperties": false
      },
      "ServiceRefValue": {
        "description": "A service reference value",
        "type": "object",
        "required": [
          "account_id"
        ],
        "properties": {
          "account_id": {
            "description": "The id of the account owning the service",
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[a-zA-Z0-9\\-]+$"
          },
          "service_type": {
            "description": "The service type",
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[0-9a-z_]+$"
          },
          "service_name": {
            "description": "The service name",
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[0-9a-z\\-]+$"
          },
          "service_instance": {
            "description": "The service instance",
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[0-9a-z\\-/]+$"
          },
          "location": {
            "description": "The location",
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[0-9a-z\\-]+$"
          }
        },
        "additionalProperties": false
      },
      "ServiceRefTarget": {
        "description": "Summary information about a service reference target",
        "type": "object",
        "required": [
          "service_name"
        ],
        "properties": {
          "service_name": {
            "description": "The name of the service.",
            "type": "string"
          },
          "service_type": {
            "description": "The type of the service.",
            "type": "string"
          },
          "locations": {
            "description": "The locations the service is available.",
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "name"
              ],
              "properties": {
                "display_name": {
                  "description": "The location display name.",
                  "type": "string"
                },
                "kind": {
                  "description": "The location kind.",
                  "type": "string"
                },
                "name": {
                  "description": "The location name.",
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "ServiceRefTargetList": {
        "description": "A list of service reference targets",
        "type": "object",
        "required": [
          "count",
          "targets"
        ],
        "properties": {
          "count": {
            "description": "The number of returned results.",
            "type": "integer"
          },
          "targets": {
            "description": "The list of service reference targets.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceRefTarget"
            }
          }
        }
      },
      "NewBaseZone": {
        "description": "A base input zone",
        "type": "object",
        "required": [
          "addresses"
        ],
        "properties": {
          "description": {
            "description": "The description of the zone.",
            "type": "string",
            "minLength": 0,
            "maxLength": 300,
            "pattern": "^[^\u0000-\u001f-]*$"
          },
          "addresses": {
            "description": "The list of addresses in the zone.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Address"
            },
            "minItems": 0,
            "maxItems": 1000
          },
          "excluded": {
            "description": "The list of excluded addresses in the zone.\nOnly addresses of type `ipAddress`, `ipRange`, and `subnet` can be excluded.\n",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Address"
            },
            "maxItems": 1000
          }
        }
      },
      "ZoneSummary": {
        "description": "An output zone summary",
        "allOf": [
          {
            "type": "object",
            "required": [
              "id",
              "crn",
              "name",
              "addresses_preview",
              "address_count",
              "excluded_count"
            ],
            "properties": {
              "id": {
                "description": "The globally unique ID of the zone.",
                "type": "string"
              },
              "crn": {
                "description": "The zone CRN.",
                "type": "string"
              },
              "name": {
                "description": "The name of the zone.",
                "type": "string"
              },
              "description": {
                "description": "The description of the zone.",
                "type": "string"
              },
              "addresses_preview": {
                "description": "A preview of addresses in the zone (3 addresses maximum).",
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Address"
                },
                "maxItems": 3
              },
              "address_count": {
                "description": "The number of addresses in the zone.",
                "type": "integer"
              },
              "excluded_count": {
                "description": "The number of excluded addresses in the zone.",
                "type": "integer"
              }
            }
          },
          {
            "$ref": "#/components/schemas/ResourceMetadata"
          }
        ]
      },
      "NewZone": {
        "description": "An input zone",
        "allOf": [
          {
            "type": "object",
            "required": [
              "name",
              "account_id"
            ],
            "properties": {
              "name": {
                "description": "The name of the zone.",
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[^\u0000-\u001f!-,.-/:-@[-^`{--]+$"
              },
              "account_id": {
                "description": "The id of the account owning this zone.",
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "^[a-zA-Z0-9\\-]+$"
              }
            }
          },
          {
            "$ref": "#/components/schemas/NewBaseZone"
          }
        ]
      },
      "Zone": {
        "description": "An output zone",
        "type": "object",
        "x-terraform-datasource-name": "cbr_zone",
        "x-terraform-resource-name": "cbr_zone",
        "x-terraform-resource operations": {
          "create": "create_zone",
          "read": "get_zone",
          "update": "replace_zone",
          "delete": "delete_zone"
        },
        "x-terraform-resource-id": "zone_id",
        "allOf": [
          {
            "type": "object",
            "required": [
              "id",
              "crn",
              "description",
              "excluded",
              "address_count",
              "excluded_count"
            ],
            "properties": {
              "id": {
                "description": "The globally unique ID of the zone.",
                "type": "string"
              },
              "crn": {
                "description": "The zone CRN.",
                "type": "string"
              },
              "address_count": {
                "description": "The number of addresses in the zone.",
                "type": "integer"
              },
              "excluded_count": {
                "description": "The number of excluded addresses in the zone.",
                "type": "integer"
              }
            }
          },
          {
            "$ref": "#/components/schemas/NewZone"
          },
          {
            "$ref": "#/components/schemas/ResourceMetadata"
          }
        ]
      },
      "ZoneList": {
        "description": "The response object of the ListZones operation.",
        "type": "object",
        "required": [
          "count",
          "zones"
        ],
        "properties": {
          "count": {
            "description": "The number of returned results.",
            "type": "integer"
          },
          "zones": {
            "description": "The returned zones.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ZoneSummary"
            }
          }
        }
      },
      "NewRule": {
        "description": "A rule",
        "type": "object",
        "required": [
          "contexts",
          "resources"
        ],
        "properties": {
          "description": {
            "description": "The description of the rule.",
            "type": "string",
            "minLength": 0,
            "maxLength": 300,
            "pattern": "^[^\u0000-\u001f-]*$"
          },
          "contexts": {
            "description": "The contexts this rule applies to.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RuleContext"
            },
            "minItems": 0,
            "maxItems": 1000
          },
          "resources": {
            "description": "The resources this rule apply to.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Resource"
            },
            "minItems": 1,
            "maxItems": 1
          },
          "operations": {
            "description": "The operations this rule applies to.",
            "type": "object",
            "required": [
              "api_types"
            ],
            "properties": {
              "api_types": {
                "description": "The API types this rule applies to.",
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "api_type_id"
                  ],
                  "properties": {
                    "api_type_id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128,
                      "pattern": "^[a-zA-Z0-9_.\\-:]+$"
                    }
                  },
                  "additionalProperties": false
                },
                "minItems": 1,
                "maxItems": 100
              }
            },
            "additionalProperties": false
          },
          "enforcement_mode": {
            "description": "The rule enforcement mode:\n * `enabled` - The restrictions are enforced and reported. This is the default.\n * `disabled` - The restrictions are disabled. Nothing is enforced or reported.\n * `report` - The restrictions are evaluated and reported, but not enforced.\n",
            "type": "string",
            "enum": [
              "enabled",
              "disabled",
              "report"
            ],
            "default": "enabled"
          }
        }
      },
      "Rule": {
        "description": "An output rule",
        "type": "object",
        "x-terraform-datasource-name": "cbr_rule",
        "x-terraform-resource-name": "cbr_rule",
        "x-terraform-resource operations": {
          "create": "create_rule",
          "read": "get_rule",
          "update": "replace_rule",
          "delete": "delete_rule"
        },
        "x-terraform-resource-id": "rule_id",
        "allOf": [
          {
            "type": "object",
            "required": [
              "id",
              "crn",
              "description"
            ],
            "properties": {
              "id": {
                "description": "The globally unique ID of the rule.",
                "type": "string"
              },
              "crn": {
                "description": "The rule CRN.",
                "type": "string"
              }
            }
          },
          {
            "$ref": "#/components/schemas/NewRule"
          },
          {
            "$ref": "#/components/schemas/ResourceMetadata"
          }
        ]
      },
      "RuleList": {
        "description": "The response object of the ListRules operation.",
        "type": "object",
        "required": [
          "count",
          "rules"
        ],
        "properties": {
          "count": {
            "description": "The number of returned results.",
            "type": "integer"
          },
          "rules": {
            "description": "The returned rules.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Rule"
            }
          }
        }
      },
      "AccountSettings": {
        "description": "An output account settings",
        "allOf": [
          {
            "type": "object",
            "required": [
              "id",
              "crn",
              "rule_count_limit",
              "zone_count_limit",
              "tags_rule_count_limit",
              "current_rule_count",
              "current_zone_count",
              "current_tags_rule_count"
            ],
            "properties": {
              "id": {
                "description": "The globally unique ID of the account settings.",
                "type": "string"
              },
              "crn": {
                "description": "The account settings CRN.",
                "type": "string"
              },
              "rule_count_limit": {
                "description": "the max number of rules allowed for the account.",
                "type": "integer"
              },
              "zone_count_limit": {
                "description": "the max number of zones allowed for the account.",
                "type": "integer"
              },
              "tags_rule_count_limit": {
                "description": "the max number of rules with tags allowed for the account.",
                "type": "integer"
              },
              "current_rule_count": {
                "description": "the current number of rules used by the account.",
                "type": "integer"
              },
              "current_zone_count": {
                "description": "the current number of zones used by the account.",
                "type": "integer"
              },
              "current_tags_rule_count": {
                "description": "the current number of rules with tags used by the account.",
                "type": "integer"
              }
            }
          },
          {
            "$ref": "#/components/schemas/ResourceMetadataOptionalPersistentProperties"
          }
        ]
      },
      "Action": {
        "description": "Service API Type actions",
        "type": "object",
        "required": [
          "action_id",
          "description"
        ],
        "properties": {
          "action_id": {
            "description": "The id of the action.",
            "type": "string"
          },
          "description": {
            "description": "The description of the action.",
            "type": "string"
          }
        }
      },
      "APIType": {
        "description": "Service API Type details",
        "type": "object",
        "required": [
          "api_type_id",
          "display_name",
          "description",
          "type",
          "actions"
        ],
        "properties": {
          "api_type_id": {
            "description": "The id of the API type.",
            "type": "string"
          },
          "display_name": {
            "description": "The displayed name of the API type.",
            "type": "string"
          },
          "description": {
            "description": "The description of the API type.",
            "type": "string"
          },
          "type": {
            "description": "The type of the API type.",
            "type": "string"
          },
          "actions": {
            "description": "The actions available for the API type.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Action"
            }
          },
          "enforcement_modes": {
            "description": "The enforcement modes supported by the API type.",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "OperationsList": {
        "description": "The response object of the `list_available_service_operations` operation.",
        "type": "object",
        "required": [
          "api_types"
        ],
        "properties": {
          "api_types": {
            "description": "The returned API types.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/APIType"
            }
          }
        }
      }
    }
  }
}