def fields(opts={})
      bypass_cache = opts.delete(:bypass_cache) { false }
      field_name = opts.delete(:only) { nil }

      if field_name
        field_name = field_name.to_s
        if bypass_cache || @fields.nil? || @fields.empty?
          response = Hubspot::Connection.get_json(FIELD_PATH, { form_guid: @guid, field_name: field_name })
          response
        else
          @fields.detect { |f| f['name'] == field_name }
        end
      else
        if bypass_cache || @fields.nil? || @fields.empty?
          response = Hubspot::Connection.get_json(FIELDS_PATH, { form_guid: @guid })
          @fields = response
        end
        @fields
      end
    end
def fields(opts={})
      bypass_cache = opts.delete(:bypass_cache) { false }
      field_name = opts.delete(:only) { nil }

      if field_name
        field_name = field_name.to_s
        if bypass_cache || @fields.nil? || @fields.empty?
          response = Hubspot::Connection.get_json(FIELD_PATH, { form_guid: @guid, field_name: field_name })
          response
        else
          @fields.detect { |f| f['name'] == field_name }
        end
      else
        if bypass_cache || @fields.nil? || @fields.empty?
          response = Hubspot::Connection.get_json(FIELDS_PATH, { form_guid: @guid })
          @fields = response
        end
        @fields
      end
    end
{https://developers.hubspot.com/docs/methods/forms/get_fields}
 {https://developers.hubspot.com/docs/methods/forms/get_field}