{"openapi":"3.0.1","info":{"title":"Attribute Models","description":"Stores and queries Attribute Models","termsOfService":"https://cimpress-support.atlassian.net/wiki/spaces/FALCON/pages/15743026370/Tier+3+Support+Process","contact":{"name":"CT RAD Squad","email":"CTProductRADSquad@cimpress.com"},"version":"0.0.1"},"servers":[{"url":"/"}],"security":[{"auth0AccessToken":[]},{"cimpressAccessToken":[]}],"paths":{"/livecheck":{"get":{"tags":["Livecheck"],"summary":"Runs a healthcheck to ensure that the service is running.","operationId":"getLivecheck","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}},"head":{"tags":["Livecheck"],"summary":"Runs a healthcheck to ensure that the service is running.","operationId":"headLivecheck","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v0/attributeModels":{"post":{"tags":["/v0/attributeModels"],"summary":"Create an attribute model.","operationId":"createV0AttributeModel","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttributeModelRequest"}}},"required":true},"responses":{"201":{"description":"Attribute model creation was successful.","headers":{"Location":{"description":"An absolute URL to get the created Attribute Model.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAttributeModelResponse"}}}},"400":{"description":"The request body was malformed.","content":{"application/json":{"schema":{"type":"string","description":"Error message describing malformed request."}}}},"401":{"description":"The caller was not authorized.","content":{}},"500":{"description":"An error occurred within the service.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}}}}},"x-codegen-request-body-name":"body"}},"/v0/attributeModels/{id}":{"put":{"tags":["/v0/attributeModels"],"summary":"Create a new version of an attribute model.","operationId":"updateV0AttributeModel","parameters":[{"name":"id","in":"path","description":"The attribute model's id.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttributeModelRequest"}}},"required":true},"responses":{"201":{"description":"Attribute model was created.","headers":{"Location":{"description":"An absolute URL to get the created Attribute Model.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAttributeModelResponse"}}}},"400":{"description":"The request body was malformed.","content":{"application/json":{"schema":{"type":"string","description":"Error message describing malformed request."}}}},"401":{"description":"The caller was not authorized.","content":{}},"404":{"description":"The attribute model with the given id could not be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}}}},"500":{"description":"An error occurred within the service.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}}}}},"x-codegen-request-body-name":"attributeModel"}},"/v0/attributeModels/{id}/versions":{"get":{"tags":["/v0/attributeModels"],"summary":"Get the version of an attribute mode.","operationId":"getV0AttributeModelVersions","parameters":[{"name":"id","in":"path","description":"The attribute model's id.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved attribute model versions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttributeModelVersionSummaries"}}}},"401":{"description":"The caller was not authorized.","content":{}},"404":{"description":"The attribute model with the given id could not be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}}}},"500":{"description":"An error occurred within the service.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}}}}}}},"/v0/attributeModels/{id}/versions/{version}":{"get":{"tags":["/v0/attributeModels"],"summary":"Get a specific attribute model version.","operationId":"getV0AttributeModelVersion","parameters":[{"name":"id","in":"path","description":"The attribute model's id.","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","description":"The version of the attribute model to retrieve.","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Successfully retrieved the attribute model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttributeModelResponse"}},"application/octet-stream":{"schema":{"$ref":"#/components/schemas/AttributeModelResponse"}}}},"401":{"description":"The caller was not authorized.","content":{}},"404":{"description":"The attribute model with the given id or version could not be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}},"application/octet-stream":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}}}},"500":{"description":"An error occurred within the service.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}},"application/octet-stream":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}}}}}}},"/v0/attributeModels/{id}/versions/{version}/codec/{codecs}":{"get":{"tags":["/v0/attributeModels"],"summary":"Get a specific attribute model for version and codec version binary.","operationId":"getV0AttributeModelCodecVersion","parameters":[{"name":"id","in":"path","description":"The attribute model's id.","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","description":"The version of the attribute model to retrieve.","required":true,"schema":{"type":"integer"}},{"name":"codecs","in":"path","description":"The codec version using which the attribute model is serialized.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved the attribute model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttributeModelResponse"}}}},"401":{"description":"The caller was not authorized.","content":{}},"404":{"description":"The attribute model with the given id or version could not be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}}}},"500":{"description":"An error occurred within the service.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageResponse"}}}}}}}},"components":{"schemas":{"AttributeModelVersionSummaries":{"type":"object","properties":{"_embedded":{"type":"object","properties":{"items":{"type":"array","description":"A collection of Attribute Model Version summaries.","items":{"$ref":"#/components/schemas/AttributeModelVersionSummary"}}}}},"description":"Summaries of the Attribute Model Versions."},"AttributeModelVersionSummary":{"required":["_links","createdAt","createdBy","id","version"],"type":"object","properties":{"_links":{"$ref":"#/components/schemas/AttributeModelLinks"},"id":{"type":"string","description":"The Attribute Model's identifier."},"version":{"type":"integer","description":"The Attribute Model's version."},"createdAt":{"type":"string","description":"The datetime this Attribute Model version was created."},"createdBy":{"type":"string","description":"The username of who created this Attribute Model version."}},"description":"A summary of the Attribute Model Version."},"AttributeModelRequest":{"required":["attributes"],"type":"object","properties":{"attributes":{"minItems":1,"type":"array","description":"The set of attributes on the model and their possible values.","items":{"$ref":"#/components/schemas/Attribute"}},"constraints":{"$ref":"#/components/schemas/AttributeConstraints"},"_links":{"$ref":"#/components/schemas/AttributeModelLinks"}},"description":"A model of attributes, their possible values, and constraints describing the relationships between attributes."},"CreateAttributeModelResponse":{"required":["_links","attributes","createdAt","createdBy","id","version"],"type":"object","properties":{"_links":{"$ref":"#/components/schemas/AttributeModelLinks"},"id":{"type":"string","description":"The Attribute Model's identifier."},"version":{"type":"integer","description":"The Attribute Model's version."},"createdAt":{"type":"string","description":"The datetime this Attribute Model version was created."},"createdBy":{"type":"string","description":"The username of who created this Attribute Model version."},"attributes":{"minItems":1,"type":"array","description":"The set of attributes on the model and their possible values.","items":{"$ref":"#/components/schemas/Attribute"}},"constraints":{"$ref":"#/components/schemas/AttributeConstraints"}},"description":"A model of attributes, their possible values, and constraints describing the relationships between attributes."},"AttributeModelResponse":{"required":["attributes","createdAt","createdBy","id","version"],"type":"object","properties":{"id":{"type":"string","description":"The Attribute Model's identifier."},"version":{"type":"integer","description":"The Attribute Model's version."},"createdAt":{"type":"string","description":"The datetime this Attribute Model version was created."},"createdBy":{"type":"string","description":"The username of who created this Attribute Model version."},"attributes":{"minItems":1,"type":"array","description":"The set of attributes on the model and their possible values.","items":{"$ref":"#/components/schemas/Attribute"}},"constraints":{"$ref":"#/components/schemas/AttributeConstraints"},"_links":{"$ref":"#/components/schemas/AttributeModelLinks"}},"description":"A model of attributes, their possible values, and constraints describing the relationships between attributes."},"AttributeModelLinks":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string","description":"Absolute URL."}},"description":"Self link to the Attribute Model."},"isolatedPropertyAssignments":{"type":"object","properties":{"href":{"type":"string","description":"Absolute URL."}},"description":"The URI to the Isolated Property Assignments resource associated."}},"description":"Links associated with the Attribute Model"},"ErrorMessageResponse":{"type":"object","properties":{"message":{"type":"string","description":"Human-readable error message."}},"description":"Error message response object"},"Range":{"required":["minimum"],"type":"object","properties":{"minimum":{"type":"string","description":"The lower boundary of the numeric range, inclusive."},"maximum":{"type":"string","description":"The upper boundary of the numeric range, inclusive. If not provided, then maximum will be unbounded."},"increment":{"type":"string","description":"The increment between discrete numbers in the range. If not provided, then the range will be continuous."}},"description":"A range describing a set of numbers."},"Attribute":{"required":["key","type"],"type":"object","properties":{"key":{"type":"string","description":"The name of this attribute. Must be unique within the Model (case insensitive)."},"type":{"type":"string","description":"The type of attribute, defining the shape of this attribute's values and how the values\ncan be specified.\n* numeric - resolves to a numeric value. Initial set of values are specified with a\nsingle formula or a combination of numberLiterals and ranges.\n* string - resolves to a string. Initial set of values are specified with stringLiterals.\n","enum":["numeric","string"]},"unitOfMeasure":{"type":"string","description":"The unit of measure for this attribute."},"values":{"minItems":1,"type":"array","description":"The set of values for this attribute.","items":{"$ref":"#/components/schemas/Value"}}},"description":"An attribute describing a piece of data and its possible values."},"Value":{"required":["type"],"type":"object","properties":{"type":{"type":"string","description":"The type of specification, driving how this specification should be interpreted.","enum":["formula","numberLiteral","range","stringLiteral"]},"stringLiteral":{"type":"string","description":"A single string value, used when type is 'stringLiteral'."},"numberLiteral":{"type":"string","description":"A single numeric value, used when type is 'numberLiteral'."},"range":{"$ref":"#/components/schemas/Range"},"formula":{"type":"string","description":"A formula that calculates a value, used when type is 'formula'."}},"description":"Specifies value(s) for a constraint or attribute."},"StaticValue":{"required":["type"],"type":"object","properties":{"type":{"type":"string","description":"The type of specification, driving how this specification should be interpreted.","enum":["formula","numberLiteral","stringLiteral"]},"stringLiteral":{"type":"string","description":"A single string value, used when type is 'stringLiteral'."},"numberLiteral":{"type":"string","description":"A single numeric value, used when type is 'numberLiteral'."},"formula":{"type":"string","description":"A formula that calculates a value, used when type is 'formula'."}},"description":"Specifies static value(s) for a constraint or attribute."},"AttributeConstraints":{"type":"object","properties":{"rules":{"type":"array","description":"Rules as predicate-result rules.","items":{"$ref":"#/components/schemas/RuleConstraint"}},"dataSheets":{"type":"array","description":"Data Sheets describing the valid combinations of attribute values.","items":{"$ref":"#/components/schemas/DataSheetConstraint"}},"conditionalAssignments":{"type":"array","description":"Conditional Assignments describing the valid assignments of attribute values.","items":{"$ref":"#/components/schemas/ConditionalAssignmentConstraint"}}},"description":"The set of constraints, each with a different format for describing relationships between attributes."},"RuleConstraint":{"required":["name","predicates","results"],"type":"object","properties":{"name":{"type":"string","description":"A human-friendly name for the rule. Set by the user, not guaranteed to be unique."},"predicates":{"type":"array","description":"The predicate of the rule expression. Predicate terms are ANDd together in the rule expression.","items":{"$ref":"#/components/schemas/RuleTerm"}},"results":{"type":"array","description":"The result of the rule expression. Result terms are ORd together in the rule expression.","items":{"$ref":"#/components/schemas/RuleTerm"}}},"description":"A predicate-result constraint, commonly known as a 'Rule'. Must have at least one predicate or result."},"RuleTerm":{"required":["attributeKey","operator","values"],"type":"object","properties":{"attributeKey":{"type":"string","description":"The name of the attribute constrained by the term."},"operator":{"type":"string","description":"The operator used to evaluate this term.","enum":["in","notIn","greaterThan","greaterThanOrEqualTo","lessThan","lessThanOrEqualTo"]},"values":{"minItems":1,"type":"array","description":"The values operated on by the term.","items":{"$ref":"#/components/schemas/Value"}}},"description":"A constraint on the values of one attribute, either an option or property."},"DataSheetConstraint":{"required":["name","rows"],"type":"object","properties":{"name":{"type":"string","description":"A human-friendly name for the data sheet. Set by the user, not guaranteed to be unique."},"rows":{"minItems":1,"type":"array","description":"The rows of the data sheet, each describing a valid combination of attribute values using value specifiers.","items":{"$ref":"#/components/schemas/DataSheetRow"}}},"description":"A constraint enumerating valid combinations of attribute values in tabular-form."},"DataSheetRow":{"required":["cells"],"type":"object","properties":{"cells":{"minItems":1,"type":"array","description":"A cell in the row which describes the valid value(s) for a particular attribute.","items":{"$ref":"#/components/schemas/DataSheetCell"}}},"description":"A row describing a valid combination of attribute values using value specifiers."},"DataSheetCell":{"required":["attributeKey","operator","values"],"type":"object","properties":{"attributeKey":{"type":"string","description":"The name of the attribute whose valid value(s) are described by this term."},"operator":{"type":"string","description":"The operator used to evaluate this cell.","enum":["in","notIn","greaterThan","greaterThanOrEqualTo","lessThan","lessThanOrEqualTo"]},"values":{"minItems":1,"type":"array","description":"The values that are described by this cell.","items":{"$ref":"#/components/schemas/Value"}}},"description":"A cell in a data sheet row, describing the valid value(s) for an attribute."},"ConditionalAssignmentConstraint":{"required":["attributeKey"],"type":"object","properties":{"attributeKey":{"type":"string","description":"The name of the attribute whose valid value(s) are described by this conditional assignment."},"fallbackAssignment":{"$ref":"#/components/schemas/StaticValue"},"assignments":{"type":"array","description":"The Assignments that describe the possible values of the attribute.","items":{"$ref":"#/components/schemas/Assignment"}}},"description":"A constraint assigning values to an attribute based on a set of conditions or a fallback assignment."},"Assignment":{"required":["conditions","value"],"type":"object","properties":{"conditions":{"type":"array","description":"The conditions that must be met in order for this assignment to apply.","items":{"$ref":"#/components/schemas/AssignmentCondition"}},"value":{"$ref":"#/components/schemas/StaticValue"}},"description":"A single assignment in the conditional assignments constraint."},"AssignmentCondition":{"required":["attributeKey","operator","values"],"type":"object","properties":{"attributeKey":{"type":"string","description":"The name of the attribute whose valid value(s) are described by this condition."},"operator":{"type":"string","description":"The operator used to evaluate this condition.","enum":["in","notIn","greaterThan","greaterThanOrEqualTo","lessThan","lessThanOrEqualTo"]},"values":{"minItems":1,"type":"array","description":"The values that are described by this condition.","items":{"$ref":"#/components/schemas/Value"}}},"description":"A condition that must be met, describing valid value(s) for a particular attribute."}},"securitySchemes":{"auth0AccessToken":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://cimpress.auth0.com/authorize","scopes":{}}}},"cimpressAccessToken":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://oauth.cimpress.io/authorize","scopes":{}}}}}},"x-original-swagger-version":"2.0"}