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: role.rb
    path of file: ./repos/diplomat/lib/diplomat
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Diplomat
  # Methods for interacting with the Consul ACL Role API endpoint
  class Role < Diplomat::RestClient
    @access_methods = %i[l
    
    def update(value, options = {})
      id = value[:ID] || value['ID']
      raise Diplomat::IdParameterRequired if id.nil?

      role_name = value[:Name] || value['Name']
      raise Diplomat::NameParameterRequired if role_name.nil?

      custom_params = use_cas(@options)
      @raw = send_put_request(@conn, ["/v1/acl/role/#{id}"], options, value, custom_params)
      if @raw.status == 200
        parse_body
      elsif @raw.status == 400
        raise Diplomat::RoleMalformed, @raw.body
      else
        raise Diplomat::UnknownStatus, "status #{@raw.status}: #{@raw.body}"
      end