You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: request_resource.rb
    path of file: ./repos/sequencescape/app/resources/api/v2
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Api
  module V2
    # Provides a JSON API representation of request
    # See: http://jsonapi-resources.com/ for JSONAPI::Resource documentation
    class RequestResource < BaseResource
      # Constants...

      # immutable # comment to make the resource mutable

      # model_name / model_hint if require
    
      def options # rubocop:todo Metrics/AbcSize
        # We need to pass in the attribute details here, as eager loading the metadata just instantiates
        # Request::Metadata
        # TODO: Nuke the separate metadata classes and metaprogramming
        {}.tap do |attrs|
          metadata_class = _model.class::Metadata
          _model
            .request_metadata
            .attribute_value_pairs(metadata_class.attribute_details)
            .each { |attribute, value| attrs[attribute.name.to_s] = value unless value.nil? }
          _model
            .request_metadata
            .association_value_pairs(metadata_class.association_details)
            .each { |association, value| attrs[association.name.to_s] = value unless value.nil? }
        end
      end