Class AbstractMetafieldResource

    • Method Detail

      • getApplicationName

        protected abstract String getApplicationName()
      • getOwnerResource

        protected abstract String getOwnerResource()
      • existsByOwnerId

        protected abstract boolean existsByOwnerId​(long ownerId)
      • createMetafield

        protected org.springframework.http.ResponseEntity<NtsMetafieldDTO> createMetafield​(long ownerId,
                                                                                           MetafieldInput metafield)
                                                                                    throws URISyntaxException
        POST /metafields : Create a new metafield
        Parameters:
        ownerId - the owner id.
        metafield - the metafield to create.
        Returns:
        the ResponseEntity with status 201 (Created) and with body the new metafieldDTO, or with status 400 (Bad Request).
        Throws:
        URISyntaxException - if the Location URI syntax is incorrect.
      • updateMetafield

        protected org.springframework.http.ResponseEntity<NtsMetafieldDTO> updateMetafield​(long ownerId,
                                                                                           long id,
                                                                                           MetafieldInput metafield,
                                                                                           javax.servlet.http.HttpServletRequest request)
                                                                                    throws IOException
        PUT /metafields/:id : Updates an existing metafield.
        Parameters:
        ownerId - the owner id.
        id - the id of the metafield to save.
        metafield - the metafield to update.
        request - the http servlet request.
        Returns:
        the ResponseEntity with status 200 (OK) and with body the updated metafield, or with status 400 (Bad Request) if the customerDTO is not valid, or with status 500 (Internal Server Error) if the metafield couldn't be updated.
        Throws:
        IOException - if the Location URI syntax is incorrect.
      • getAllMetafields

        protected org.springframework.http.ResponseEntity<List<NtsMetafieldDTO>> getAllMetafields​(long ownerId)
        GET /metafields : get all metafields
        Parameters:
        ownerId - the owner id
        Returns:
        the ResponseEntity with status 200 (OK) and the list of metafields in body.
      • countMetafields

        protected org.springframework.http.ResponseEntity<Long> countMetafields​(long ownerId)
        GET /metafields/count : count all the metafields.
        Parameters:
        ownerId - the owner id
        Returns:
        the ResponseEntity with status 200 (OK) and the count in body.
      • getMetafield

        protected org.springframework.http.ResponseEntity<NtsMetafieldDTO> getMetafield​(long ownerId,
                                                                                        long id)
        GET /metafields/:id : get the "id" metafield.
        Parameters:
        ownerId - the owner id
        id - the id of the metafield to retrieve.
        Returns:
        the ResponseEntity with status 200 (OK) and with body the metafield, or with status 404 (Not Found).
      • deleteMetafield

        protected org.springframework.http.ResponseEntity<Void> deleteMetafield​(long ownerId,
                                                                                long id)
        DELETE /metafields/:id : delete the "id" metafields.
        Parameters:
        ownerId - the owner id
        id - the id of the metafields to delete.
        Returns:
        the ResponseEntity with status 204 (NO_CONTENT).