openapi: 3.0.1
info:
  title: Site Template Service
  description: The Site Template Service is meant to support the retail operating model where Sites can be linked to Departments and Roles to better model real world use cases.
  version: '2.0'
tags:
  - name: SiteTemplateService
security:
  - Authorization: []
paths:
  /users/site-template:
    get:
      operationId: SiteTemplateService_ListSiteTemplates
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2ListSiteTemplatesResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: tenantId
          description: 'TenantId of the siteTemplate. Required: false (False as this can be inferred from the token)'
          in: query
          required: false
          schema:
            type: string
        - name: pageSize
          description: 'pageSize is the maximum number of items to return. If not specified, a default value of 100 will be used. The maximum page size is 1000; values above 1000 will be changed to 100. Required: false'
          in: query
          required: false
          schema:
            type: integer
            format: int32
        - name: pageToken
          description: 'pageToken is a page token received from a previous ListSiteTemplates call. Provide this token to retrieve the subsequent page. 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: sortField
          description: 'Sort Field for the results, available sort_fields: creation_time, friendly_name, site_template_id, Default: NAME, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: friendlyName
          description: 'The friendlyName you want to search for. Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: startsWithSingleCharacter
          description: 'Ability to search for a single starts with character, only applicable to friendly_name, Required: false, Default: false'
          in: query
          required: false
          schema:
            type: boolean
      tags:
        - SiteTemplateService
    post:
      operationId: SiteTemplateService_CreateSiteTemplate
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2SiteTemplateProto'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v2CreateSiteTemplateRequest'
        required: true
      tags:
        - SiteTemplateService
  /users/site-template/availableDepartments:
    get:
      summary: Get all of the available departments that can be added to a user given a site_template that is added to the user
      operationId: SiteTemplateService_ListAvailableDepartmentsBySiteTemplate
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2ListAvailableDepartmentsResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: tenantId
          description: 'TenantId of the site. Required: false (False as this can be inferred from the token)'
          in: query
          required: false
          schema:
            type: string
        - name: siteTemplateId
          description: 'Id of the site_template. Required: true'
          in: query
          required: false
          schema:
            type: string
      tags:
        - SiteTemplateService
  /users/site-template/availableRoles:
    get:
      summary: Get all of the available roles that can be added to a user given a site_template that is added to the user
      operationId: SiteTemplateService_ListAvailableRolesBySiteTemplate
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2ListAvailableRolesResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: tenantId
          description: 'TenantId of the site. Required: false (False as this can be inferred from the token)'
          in: query
          required: false
          schema:
            type: string
        - name: siteTemplateId
          description: 'Id of the site_template. Required: true'
          in: query
          required: false
          schema:
            type: string
        - name: pageSize
          description: 'Page size for the list of roles. Required: false, Default: 10'
          in: query
          required: false
          schema:
            type: integer
            format: int32
        - name: pageToken
          description: 'Page token for the list of roles. Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: sortField
          description: 'Sort field valid values: displayName. Default: displayName, 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
      tags:
        - SiteTemplateService
  /users/site-template/search:
    get:
      operationId: SiteTemplateService_SearchSiteTemplates
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2ListSiteTemplatesResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: tenantId
          description: 'TenantId of the siteTemplate. Required: false (False as this can be inferred from the token)'
          in: query
          required: false
          schema:
            type: string
        - name: friendlyName
          description: 'The friendlyName you want to search for. Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: pageSize
          description: 'pageSize is the maximum number of items to return. If not specified, a default value of 100 will be used. The maximum page size is 1000; values above 1000 will be changed to 100. Required: false'
          in: query
          required: false
          schema:
            type: integer
            format: int32
        - name: pageToken
          description: 'pageToken is a page token received from a previous ListSiteTemplates call. Provide this token to retrieve the subsequent page. 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: sortField
          description: 'Sort Field for the results, available sort_fields: creation_time, friendly_name, site_template_id, Default: friendly_name, Required: false'
          in: query
          required: false
          schema:
            type: string
        - name: partialTextSearch
          description: 'Whether you want to search for a substring or an exact match on friendly_name. Required: false, Default: false'
          in: query
          required: false
          schema:
            type: boolean
      tags:
        - SiteTemplateService
  /users/site-template/{siteTemplateId}:
    get:
      operationId: SiteTemplateService_GetSiteTemplate
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2SiteTemplateProto'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: siteTemplateId
          description: 'Id of the siteTemplate. Required: true'
          in: path
          required: true
          schema:
            type: string
        - name: tenantId
          description: 'TenantId of the siteTemplate. Required: false (False as this can be inferred from the token)'
          in: query
          required: false
          schema:
            type: string
      tags:
        - SiteTemplateService
    delete:
      operationId: SiteTemplateService_DeleteSiteTemplate
      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/googleRpcStatus'
      parameters:
        - name: siteTemplateId
          description: 'Id of the siteTemplate. Required: true'
          in: path
          required: true
          schema:
            type: string
        - name: tenantId
          description: 'TenantId of the siteTemplate. Required: false (False as this can be inferred from the token)'
          in: query
          required: false
          schema:
            type: string
      tags:
        - SiteTemplateService
    put:
      operationId: SiteTemplateService_UpdateSiteTemplate
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2SiteTemplateProto'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: siteTemplateId
          description: 'Id of the siteTemplate. Required: true'
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SiteTemplateServiceUpdateSiteTemplateBody'
        required: true
      tags:
        - SiteTemplateService
  /users/site-template/{siteTemplateId}/departments:
    post:
      summary: |-
        Add a list of departments to a Site Template.
         Permission Level: Read-Write
      operationId: SiteTemplateService_AddDepartmentsToSiteTemplate
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2SiteTemplateProto'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: siteTemplateId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SiteTemplateServiceAddDepartmentsToSiteTemplateBody'
        required: true
      tags:
        - SiteTemplateService
  /users/site-template/{siteTemplateId}/roles:
    post:
      summary: |-
        Add a list of roles to a Site Template.
         Permission Level: Read-Write
      operationId: SiteTemplateService_AddRolesToSiteTemplate
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v2SiteTemplateProto'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/googleRpcStatus'
      parameters:
        - name: siteTemplateId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SiteTemplateServiceAddRolesToSiteTemplateBody'
        required: true
      tags:
        - SiteTemplateService
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:
    SiteTemplateServiceAddDepartmentsToSiteTemplateBody:
      type: object
      properties:
        tenantId:
          type: string
        departments:
          type: array
          items:
            type: string
    SiteTemplateServiceAddRolesToSiteTemplateBody:
      type: object
      properties:
        tenantId:
          type: string
        roles:
          type: array
          items:
            $ref: '#/components/schemas/v2SiteTemplateRole'
    SiteTemplateServiceUpdateSiteTemplateBody:
      type: object
      properties:
        tenantId:
          type: string
          title: 'TenantId of the siteTemplate. Required: false (False as this can be inferred from the token)'
        friendlyName:
          type: string
          title: 'friendlyName of the siteTemplate. Required: false'
        departments:
          type: array
          items:
            type: string
          title: 'departments that belong to this site. Required: false'
        roles:
          type: array
          items:
            $ref: '#/components/schemas/v2SiteTemplateRole'
          title: 'roles that belong to this site. Required: false'
        siteAttributes:
          type: array
          items:
            type: string
          title: 'site attributes that belong to this site. Required: false'
        allRoles:
          type: boolean
          title: 'allRoles flag indicates that all roles are valid for this SiteTemplate. Required: false'
        allDepartments:
          type: boolean
          title: 'allDepartments flag, indicates that all departments are valid for this SiteTemplate. Required: false'
        allSiteAttributes:
          type: boolean
          title: 'allSiteAttributes flag, indicates that all site attributes are valid for this SiteTemplate. Required: false'
        updateFieldMask:
          type: string
          title: 'updateFieldMask is used to specify the fields to be updated. Required: false'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/v2SiteTemplateAttributeProto'
          title: 'attributes of the site template (not site attributes). Required: false'
    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'
    v2CreateSiteTemplateRequest:
      type: object
      properties:
        tenantId:
          type: string
          title: 'TenantId of the siteTemplate. Required: false (False as this can be inferred from the token)'
        friendlyName:
          type: string
          title: 'friendlyName of the siteTemplate. Required: false'
        departments:
          type: array
          items:
            type: string
          title: 'departments that belong to this site. Required: false'
        roles:
          type: array
          items:
            $ref: '#/components/schemas/v2SiteTemplateRole'
          title: 'roles that belong to this site. Required: false'
        siteAttributes:
          type: array
          items:
            type: string
          title: 'site attributes that belong to this site. Required: false'
        allRoles:
          type: boolean
          title: 'allRoles flag indicates that all roles are valid for this SiteTemplate. Required: false'
        allDepartments:
          type: boolean
          title: 'allDepartments flag, indicates that all departments are valid for this SiteTemplate. Required: false'
        allSiteAttributes:
          type: boolean
          title: 'allSiteAttributes flag, indicates that all site attributes are valid for this SiteTemplate. Required: false'
        siteTemplateId:
          type: string
          title: 'The ID of the site template, if not provided it will be autogenerated. Required: false'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/v2SiteTemplateAttributeProto'
          title: 'attributes of the site template (not site attributes). Required: false'
    v2DisplayableDepartment:
      type: object
      properties:
        tenantId:
          type: string
        name:
          type: string
        displayName:
          type: string
    v2DisplayableRole:
      type: object
      properties:
        tenantId:
          type: string
        roleId:
          type: string
        displayName:
          type: string
        domain:
          type: string
        scope:
          type: string
    v2ListAvailableDepartmentsResponse:
      type: object
      properties:
        availableDepartments:
          type: array
          items:
            $ref: '#/components/schemas/v2DisplayableDepartment'
          title: List of available departments
    v2ListAvailableRolesResponse:
      type: object
      properties:
        availableRoles:
          type: array
          items:
            $ref: '#/components/schemas/v2DisplayableRole'
          title: List of available roles
        nextPageToken:
          type: string
          title: Next page token
    v2ListSiteTemplatesResponse:
      type: object
      properties:
        siteTemplates:
          type: array
          items:
            $ref: '#/components/schemas/v2SiteTemplateProto'
          title: 'siteTemplates is the list of siteTemplates. Required: true'
        nextPageToken:
          type: string
          description: nextPageToken is a token that can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.
    v2SimpleDepartmentProto:
      type: object
      properties:
        tenantId:
          type: string
        departmentName:
          type: string
      description: |-
        Protobuf created to represent a Department.
        Using this name because UniqueDepartmentProto is already used for another use case.
    v2SiteTemplateAttributeProto:
      type: object
      properties:
        scope:
          type: string
          title: 'General scoping for attribute. Required: false'
        fieldName:
          type: string
          title: 'Name of the attribute. Required: true'
        value:
          type: string
          title: 'Value of the attribute. Required: false'
        domain:
          type: string
          title: 'Domain of the attribute. Required : false'
    v2SiteTemplateProto:
      type: object
      properties:
        siteTemplateId:
          type: string
        tenantId:
          type: string
        friendlyName:
          type: string
        departments:
          type: array
          items:
            type: string
        roles:
          type: array
          items:
            $ref: '#/components/schemas/v2SiteTemplateRole'
        siteAttributes:
          type: array
          items:
            type: string
        allRoles:
          type: boolean
        allDepartments:
          type: boolean
        allSiteAttributes:
          type: boolean
        creationTime:
          type: string
          format: date-time
        lastUpdated:
          type: string
          format: date-time
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/v2SiteTemplateAttributeProto'
        departmentDetails:
          type: array
          items:
            $ref: '#/components/schemas/v2SimpleDepartmentProto'
          description: |-
            The departments that the site_template is assigned to. This is to support UI for getting the details part of the graphQL query.
            In V3, we can remove the existing departments field and use this one instead.
    v2SiteTemplateRole:
      type: object
      properties:
        roleId:
          type: string
          title: 'roleId of the role you wish to add. Required: true'
        scope:
          type: string
          title: 'scope of the role you wish to add. Required: true'
        domain:
          type: string
          title: 'domain of the role you wish to add. Required: true'
        autoAssigned:
          type: boolean
          title: 'auto_assigned flag indicates that the role is auto assigned to users who are part of the site. Required: false'
        tenantId:
          type: string
          title: 'tenant_id of the role. Required: false (Multi-tenancy of roles is not supported currently, this field is for display purposes only)'
    googleRpcStatus:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/protobufAny'
  securitySchemes:
    Authorization:
      type: apiKey
      description: Bearer token
      name: Authorization
      in: header
