{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nexus/json-schema/nexus-s3-blob-store-api-model-schema.json",
  "title": "S3BlobStoreApiModel",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nexus-blob-store-api-openapi.yml#/components/schemas/S3BlobStoreApiModel",
  "required": [
    "bucketConfiguration",
    "name"
  ],
  "type": "object",
  "properties": {
    "name": {
      "pattern": "^[a-zA-Z0-9\\-]{1}[a-zA-Z0-9_\\-\\.]*$",
      "type": "string",
      "description": "The name of the S3 blob store."
    },
    "softQuota": {
      "$ref": "#/$defs/BlobStoreApiSoftQuota"
    },
    "bucketConfiguration": {
      "$ref": "#/$defs/S3BlobStoreApiBucketConfiguration"
    },
    "type": {
      "type": "string",
      "description": "The blob store type."
    }
  },
  "$defs": {
    "BlobStoreApiSoftQuota": {
      "required": [
        "type"
      ],
      "type": "object",
      "properties": {
        "type": {
          "minLength": 1,
          "type": "string",
          "description": "The type to use such as spaceRemainingQuota, or spaceUsedQuotaspaceUsedQuota"
        },
        "limit": {
          "minimum": 0,
          "type": "integer",
          "description": "The limit in MB.",
          "format": "int64"
        }
      },
      "description": "Settings to control the soft quota"
    },
    "S3BlobStoreApiAdvancedBucketConnection": {
      "type": "object",
      "properties": {
        "endpoint": {
          "type": "string",
          "description": "A custom endpoint URL for third party object stores using the S3 API."
        },
        "signerType": {
          "type": "string",
          "description": "An API signature version which may be required for third party object stores using the S3 API."
        },
        "forcePathStyle": {
          "type": "boolean",
          "description": "Setting this flag will result in path-style access being used for all requests."
        },
        "maxConnectionPoolSize": {
          "type": "integer",
          "description": "Setting this value will override the default connection pool size of Nexus of the s3 client for this blobstore.",
          "format": "int32"
        }
      },
      "description": "A custom endpoint URL, signer type and whether path style access is enabled"
    },
    "S3BlobStoreApiBucket": {
      "required": [
        "name",
        "region"
      ],
      "type": "object",
      "properties": {
        "region": {
          "type": "string",
          "description": "The AWS region to create a new S3 bucket in or an existing S3 bucket's region"
        },
        "name": {
          "type": "string",
          "description": "The name of the S3 bucket"
        },
        "prefix": {
          "type": "string",
          "description": "The S3 blob store (i.e S3 object) key prefix"
        }
      },
      "description": "Details of the S3 bucket such as name and region"
    },
    "S3BlobStoreApiBucketConfiguration": {
      "required": [
        "bucket"
      ],
      "type": "object",
      "properties": {
        "bucket": {
          "$ref": "#/$defs/S3BlobStoreApiBucket"
        },
        "security": {
          "$ref": "#/$defs/S3BlobStoreApiBucketSecurity"
        },
        "encryption": {
          "$ref": "#/$defs/S3BlobStoreApiEncryption"
        },
        "advancedConnection": {
          "$ref": "#/$defs/S3BlobStoreApiAdvancedBucketConnection"
        },
        "failoverBuckets": {
          "type": "array",
          "description": "A list of secondary buckets which have bidirectional replication enabled and should be used when Nexus is running in the region",
          "items": {
            "$ref": "#/$defs/S3BlobStoreApiFailoverBucket"
          }
        },
        "activeRegion": {
          "type": "string",
          "description": "The active region based on bucket configuration, failover buckets, and EC2 region Nexus is running.",
          "readOnly": true
        },
        "preSignedUrlEnabled": {
          "type": "boolean",
          "description": "Enables redirecting downloads to S3 pre-signed URLs. (Pro feature)"
        },
        "bucketSecurity": {
          "$ref": "#/$defs/S3BlobStoreApiBucketSecurity"
        },
        "advancedBucketConnection": {
          "$ref": "#/$defs/S3BlobStoreApiAdvancedBucketConnection"
        }
      },
      "description": "The S3 specific configuration details for the S3 object that'll contain the blob store."
    },
    "S3BlobStoreApiBucketSecurity": {
      "type": "object",
      "properties": {
        "accessKeyId": {
          "type": "string",
          "description": "An IAM access key ID for granting access to the S3 bucket"
        },
        "secretAccessKey": {
          "type": "string",
          "description": "The secret access key associated with the specified IAM access key ID"
        },
        "role": {
          "type": "string",
          "description": "An IAM role to assume in order to access the S3 bucket"
        },
        "sessionToken": {
          "type": "string",
          "description": "An AWS STS session token associated with temporary security credentials which grant access to the S3 bucket"
        }
      },
      "description": "Security details for granting access the S3 API"
    },
    "S3BlobStoreApiEncryption": {
      "type": "object",
      "properties": {
        "encryptionType": {
          "type": "string",
          "description": "The type of S3 server side encryption to use."
        },
        "encryptionKey": {
          "type": "string",
          "description": "The encryption key."
        }
      },
      "description": "The type of encryption to use if any"
    },
    "S3BlobStoreApiFailoverBucket": {
      "required": [
        "bucketName",
        "region"
      ],
      "type": "object",
      "properties": {
        "region": {
          "type": "string",
          "description": "The region containing the bucket"
        },
        "bucketName": {
          "type": "string",
          "description": "The name of the bucket in the region"
        }
      },
      "description": "A list of secondary buckets which have bidirectional replication enabled and should be used when Nexus is running in the region"
    }
  }
}