openapi: 3.0.1
info:
  title: Property Service
  description: 'The Property Service provides APIs for CRUD''ing properties.  Properties can be things like shared ENUMs or allowed list values.  We also support defining parent/child relationships at a single level for properties.  An example of this use case is the resourceType/grant relationship allows an application to define specific grants that are allowed to use for a specific resourceType when creating a permission.Specific property values in use are: domain - for valid values for the domain field (E.G. PLATFORM, SAVANNA, ZTM, VIQ), PERMISSION_RESOURCE_TYPE - for valid values for resourceType in permissions, PERMISSION_GRANTS - for valid values for grants in permissions'', PLATFORM_SCOPE - for valid values for scopes in permissions'', SITE - for valid sites used for Site-Department validation,SITE_DEPARTMENT_LINK - for validating which departments are valid for a given site.Confluence Page: https://confluence.zebra.com/pages/viewpage.action?spaceKey=ZRPS&title=Phoenix+Property+Service Confluence Page for SITE_DEPARTMENT_LINK and SITE: https://confluence.zebra.com/display/ZRPS/Design+Doc+for+Linking+Sites+to+Departments'
  version: '2.0'
tags:
  - name: PropertyService
security:
  - Authorization: []
paths:
  /property:
    get:
      summary: |-
        Lists all properties
        Permission level: read
      operationId: PropertyService_ListProperties
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2ListPropertiesResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
      parameters:
        - name: propertyCharacteristics.tenantId
          description: The property is specific for this tenant. Required = false
          in: query
          required: false
          schema:
            type: string
        - name: propertyCharacteristics.scope
          description: The property is specific for this scope. Required = false
          in: query
          required: false
          schema:
            type: string
        - name: propertyCharacteristics.domain
          description: The property is specific for this domain. Required = false
          in: query
          required: false
          schema:
            type: string
        - name: propertyCharacteristics.parentPropertyKey
          description: The parent property key. Required = false
          in: query
          required: false
          schema:
            type: string
        - name: propertyCharacteristics.parentPropertyValue
          description: The parent property value. Required = false
          in: query
          required: false
          schema:
            type: string
        - name: propertyCharacteristics.parentTenantId
          description: The parent tenant id. Required = false
          in: query
          required: false
          schema:
            type: string
        - name: propertyCharacteristics.parentScope
          description: The parent scope. Required = false
          in: query
          required: false
          schema:
            type: string
        - name: propertyCharacteristics.parentDomain
          description: The parent domain. Required = false
          in: query
          required: false
          schema:
            type: string
        - name: includeDisabled
          description: 'Include disabled properties. Default: false'
          in: query
          required: false
          schema:
            type: boolean
        - name: propertyValueName
          description: The Value name of the property. this will always be converted to lowercase. Required = false
          in: query
          required: false
          schema:
            type: string
        - name: startsWithSingleCharacter
          description: 'Ability to search for a single starts with character, only applicable to property_value_name and property_friendly_name. Required: false, Default: false'
          in: query
          required: false
          schema:
            type: boolean
        - name: pageSize
          description: |-
            Requested size of the next page of data. If not set, the default page size is 1000 for now to not break existing
            UI integrations, Required: false.
          in: query
          required: false
          schema:
            type: integer
            format: int32
        - name: pageToken
          description: 'MongoDB Field, describes the encoded page token for page traversal, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: sortField
          description: 'Sort field, valid values: propertyKey, propertyValue. Default: propertyKey, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: sortType
          description: 'Sort Type for the results, Default: ASC, Required: false'
          in: query
          required: false
          schema:
            type: string
            enum:
              - NONE
              - ASC
              - DESC
            default: NONE
        - name: propertyKey
          description: 'The propertyKey of the property to filter by, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: propertyFriendlyName
          description: 'The property''s friendly name to filter by, Required: false'
          in: query
          required: false
          schema:
            type: string
      tags:
        - PropertyService
    post:
      summary: |-
        Creates a property
        Permission level: read-write
      operationId: PropertyService_CreateProperty
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2CreatePropertyResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v2CreatePropertyRequest'
        required: true
      tags:
        - PropertyService
  /property/search:
    post:
      summary: |-
        Responsible for doing advanced searching on property
        Example use case: retrieving all properties that meet a given set of filters
      operationId: PropertyService_SearchProperty
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2SearchPropertyResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v2SearchPropertyRequest'
        required: true
      tags:
        - PropertyService
  /property/{propertyKey}:
    get:
      summary: |-
        Gets a property by key
        Permission level: read
      operationId: PropertyService_GetProperty
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2GetPropertyResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
      parameters:
        - name: propertyKey
          description: The property to retrieve
          in: path
          required: true
          schema:
            type: string
        - name: propertyCharacteristics.tenantId
          description: The property is specific for this tenant. Required = false
          in: query
          required: false
          schema:
            type: string
        - name: propertyCharacteristics.scope
          description: The property is specific for this scope. Required = false
          in: query
          required: false
          schema:
            type: string
        - name: propertyCharacteristics.domain
          description: The property is specific for this domain. Required = false
          in: query
          required: false
          schema:
            type: string
        - name: propertyCharacteristics.parentPropertyKey
          description: The parent property key. Required = false
          in: query
          required: false
          schema:
            type: string
        - name: propertyCharacteristics.parentPropertyValue
          description: The parent property value. Required = false
          in: query
          required: false
          schema:
            type: string
        - name: propertyCharacteristics.parentTenantId
          description: The parent tenant id. Required = false
          in: query
          required: false
          schema:
            type: string
        - name: propertyCharacteristics.parentScope
          description: The parent scope. Required = false
          in: query
          required: false
          schema:
            type: string
        - name: propertyCharacteristics.parentDomain
          description: The parent domain. Required = false
          in: query
          required: false
          schema:
            type: string
        - name: includeGenerics
          description: 'If true, include the generic properties under the requested key (if any). Default: false'
          in: query
          required: false
          schema:
            type: boolean
      tags:
        - PropertyService
    delete:
      summary: |-
        Deletes a property value. 
        Only one value can be deleted at a time.
        Permission level: read-write
      operationId: PropertyService_DeleteProperty
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                type: object
                properties: {}
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
      parameters:
        - name: propertyKey
          description: 'The key of the property. Required: true'
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PropertyServiceDeletePropertyBody'
        required: true
      tags:
        - PropertyService
    put:
      summary: |-
        Updates a property
        Only existing properties can be updated. The characteristics of a property cannot be changed.
        Example use case: Set enabled to false
        Permission level: read-write
      operationId: PropertyService_UpdateProperty
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2UpdatePropertyResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
      parameters:
        - name: propertyKey
          description: 'The key of the property. Required: true'
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PropertyServiceUpdatePropertyBody'
        required: true
      tags:
        - PropertyService
servers:
  - url: https://prod-ui-zwseuprod01p.pp.zebra.com/api
    description: EU Server
  - url: https://prod-ui-zwsusprod01p.pp.zebra.com/api
    description: NA Server
components:
  schemas:
    PropertyServiceDeletePropertyBody:
      type: object
      properties:
        propertyValue:
          type: string
          title: 'The value to delete. this will always be converted to lowercase. Required: true'
        propertyCharacteristics:
          $ref: '#/components/schemas/v2PropertyCharacteristicsProto'
    PropertyServiceUpdatePropertyBody:
      type: object
      properties:
        propertyValues:
          type: array
          items:
            $ref: '#/components/schemas/v2UpdatePropertyNameStatusValuesProto'
          title: 'One or more values of the property: Required: true'
        propertyCharacteristics:
          $ref: '#/components/schemas/v2PropertyCharacteristicsProto'
        newParent:
          $ref: '#/components/schemas/UpdatePropertyRequestNewParent'
    UpdatePropertyRequestNewParent:
      type: object
      properties:
        parentPropertyKey:
          type: string
          title: The parent property key. Required = false
        parentPropertyValue:
          type: string
          title: The parent property value. Required = false
        parentTenantId:
          type: string
          title: The parent tenant id. Required = false
        parentScope:
          type: string
          title: The parent scope. Required = false
        parentDomain:
          type: string
          title: The parent domain. Required = false
      title: Fields to set a new parent
    commonsSortType:
      type: string
      enum:
        - NONE
        - ASC
        - DESC
      default: NONE
    protobufAny:
      type: object
      properties:
        '@type':
          type: string
      additionalProperties: {}
    rpcStatus:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/protobufAny'
    v2CreatePropertyRequest:
      type: object
      properties:
        propertyKey:
          type: string
          title: 'The key of the property. Required: true'
        propertyValues:
          type: array
          items:
            $ref: '#/components/schemas/v2PropertyNameStatusValuesProto'
          title: 'One or more values of the property: Required: true'
        propertyCharacteristics:
          $ref: '#/components/schemas/v2PropertyCharacteristicsProto'
    v2CreatePropertyResponse:
      type: object
      properties:
        property:
          $ref: '#/components/schemas/v2PropertyMapProto'
    v2GetPropertyResponse:
      type: object
      properties:
        property:
          $ref: '#/components/schemas/v2PropertyMapProto'
    v2ListPropertiesResponse:
      type: object
      properties:
        propertyMaps:
          type: array
          items:
            $ref: '#/components/schemas/v2PropertyMapProto'
        nextPageToken:
          type: string
    v2PropertyCharacteristicsAndValuesListProto:
      type: object
      properties:
        propertyCharacteristicsAndValues:
          type: array
          items:
            $ref: '#/components/schemas/v2PropertyCharacteristicsAndValuesProto'
          title: list of property data grouped by characteristics
    v2PropertyCharacteristicsAndValuesProto:
      type: object
      properties:
        propertyCharacteristics:
          $ref: '#/components/schemas/v2PropertyCharacteristicsProto'
        propertyNameStatusValues:
          type: array
          items:
            $ref: '#/components/schemas/v2PropertyNameStatusValuesProto'
          title: list of name and status values
    v2PropertyCharacteristicsProto:
      type: object
      properties:
        tenantId:
          type: string
          title: The property is specific for this tenant. Required = false
        scope:
          type: string
          title: The property is specific for this scope. Required = false
        domain:
          type: string
          title: The property is specific for this domain. Required = false
        parentPropertyKey:
          type: string
          title: The parent property key. Required = false
        parentPropertyValue:
          type: string
          title: The parent property value. Required = false
        parentTenantId:
          type: string
          title: The parent tenant id. Required = false
        parentScope:
          type: string
          title: The parent scope. Required = false
        parentDomain:
          type: string
          title: The parent domain. Required = false
      description: |-
        The property characteristics proto is to define if a property is not 'generic' in that it should not apply to everything when being retrieved by a key.  By defining this we can limit the properties we returned by our requests to only those properties
        applicable to our application.  For example, VIQ only wants to see resourceTypes and grants specific to VIQ and does not care to see resourceTypes being used by WFC.  When they do a list properties for PERMISSION_RESOURCE_TYPE they can include the domain = VIQ and only
        resourceType properties for VIQ would be returned.  Tenant would be if a particular tenant had special values just for it.  We have no actual use cases for this yet.

        The 'parent' characteristics allow us to specify that a property is the 'child' of another property.  The only current use case for this is with resourceTypes and grants.  What this does is allow us to specify that certain grants are the child of a particular resourceType:
        so if you had a resourceType with value admin and domain VIQ, you would define the child grants with this in its characteristics: (parent_property_key=PERMISSION_RESOURCE_TYPE, parent_property_value=admin, parent_domain=VIQ).
    v2PropertyMapProto:
      type: object
      properties:
        properties:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/v2PropertyCharacteristicsAndValuesListProto'
          title: map of propertyKey to grouped property data
    v2PropertyNameStatusValuesProto:
      type: object
      properties:
        name:
          type: string
          title: 'the name of the property value. this will always be converted to lowercase. Required : true'
        enabled:
          type: boolean
          title: 'whether this property value is enabled, upon property creation or update the default value is false. Required: false'
        friendlyName:
          type: string
          title: 'friendly name of the property value. Required: false'
        description:
          type: string
          title: 'description of the property value. Required: false'
        creationTime:
          type: string
          format: date-time
          title: creation time (Used only for responses). Required = DO NOT USE
    v2SearchPropertyRequest:
      type: object
      properties:
        pageSize:
          type: integer
          format: int32
          description: |-
            Requested size of the next page of data.
            If not set, the default page size is 10000 same as ListProperties. Required: false.
        pageNumber:
          type: integer
          format: int32
          title: 'Requested page number. Required: false. Default: 1'
        propertyCharacteristicsProto:
          $ref: '#/components/schemas/v2PropertyCharacteristicsProto'
        propertyKey:
          type: string
          description: 'The Property Key that can be used to filter results. Required: false.'
        propertyNameValue:
          type: string
          title: 'The Value name of the property. this will always be converted to lowercase. Required: false'
        partialTextSearch:
          type: boolean
          description: 'Partial text search on the property_name_value and property_friendly_name . Required: false, Default: false.'
        sortField:
          type: string
          title: 'Sort field, valid values: propertyKey, propertyValue. Default: propertyKey, Required: false'
        sortType:
          $ref: '#/components/schemas/commonsSortType'
        propertyFriendlyName:
          type: string
          title: 'The friendly name of the property that you are searching for. Required: false'
    v2SearchPropertyResponse:
      type: object
      properties:
        propertyMaps:
          type: array
          items:
            $ref: '#/components/schemas/v2PropertyMapProto'
    v2UpdatePropertyNameStatusValuesProto:
      type: object
      properties:
        name:
          type: string
          title: 'the name of the property value. this will always be converted to lowercase. Required : true'
        enabled:
          type: boolean
        friendlyName:
          type: string
        description:
          type: string
    v2UpdatePropertyResponse:
      type: object
      properties:
        property:
          $ref: '#/components/schemas/v2PropertyMapProto'
  securitySchemes:
    Authorization:
      type: apiKey
      description: Bearer token
      name: Authorization
      in: header
