# # Autogenerated by Thrift # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # module Evernote module EDAM module Error module EDAMErrorCode UNKNOWN = 1 BAD_DATA_FORMAT = 2 PERMISSION_DENIED = 3 INTERNAL_ERROR = 4 DATA_REQUIRED = 5 LIMIT_REACHED = 6 QUOTA_REACHED = 7 INVALID_AUTH = 8 AUTH_EXPIRED = 9 DATA_CONFLICT = 10 ENML_VALIDATION = 11 SHARD_UNAVAILABLE = 12 VALUE_MAP = {1 => "UNKNOWN", 2 => "BAD_DATA_FORMAT", 3 => "PERMISSION_DENIED", 4 => "INTERNAL_ERROR", 5 => "DATA_REQUIRED", 6 => "LIMIT_REACHED", 7 => "QUOTA_REACHED", 8 => "INVALID_AUTH", 9 => "AUTH_EXPIRED", 10 => "DATA_CONFLICT", 11 => "ENML_VALIDATION", 12 => "SHARD_UNAVAILABLE"} VALID_VALUES = Set.new([UNKNOWN, BAD_DATA_FORMAT, PERMISSION_DENIED, INTERNAL_ERROR, DATA_REQUIRED, LIMIT_REACHED, QUOTA_REACHED, INVALID_AUTH, AUTH_EXPIRED, DATA_CONFLICT, ENML_VALIDATION, SHARD_UNAVAILABLE]).freeze end # This exception is thrown by EDAM procedures when a call fails as a result of # a problem that a user may be able to resolve. For example, if the user # attempts to add a note to their account which would exceed their storage # quota, this type of exception may be thrown to indicate the source of the # error so that they can choose an alternate action. # # This exception would not be used for internal system errors that do not # reflect user actions, but rather reflect a problem within the service that # the user cannot resolve. # # errorCode: The numeric code indicating the type of error that occurred. # must be one of the values of EDAMErrorCode. # # parameter: If the error applied to a particular input parameter, this will # indicate which parameter. class EDAMUserException < ::Thrift::Exception include ::Thrift::Struct, ::Thrift::Struct_Union ERRORCODE = 1 PARAMETER = 2 FIELDS = { ERRORCODE => {:type => ::Thrift::Types::I32, :name => 'errorCode', :enum_class => Evernote::EDAM::Error::EDAMErrorCode}, PARAMETER => {:type => ::Thrift::Types::STRING, :name => 'parameter', :optional => true} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field errorCode is unset!') unless @errorCode unless @errorCode.nil? || Evernote::EDAM::Error::EDAMErrorCode::VALID_VALUES.include?(@errorCode) raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field errorCode!') end end ::Thrift::Struct.generate_accessors self end # This exception is thrown by EDAM procedures when a call fails as a result of # an a problem in the service that could not be changed through user action. # # errorCode: The numeric code indicating the type of error that occurred. # must be one of the values of EDAMErrorCode. # # message: This may contain additional information about the error class EDAMSystemException < ::Thrift::Exception include ::Thrift::Struct, ::Thrift::Struct_Union ERRORCODE = 1 MESSAGE = 2 FIELDS = { ERRORCODE => {:type => ::Thrift::Types::I32, :name => 'errorCode', :enum_class => Evernote::EDAM::Error::EDAMErrorCode}, MESSAGE => {:type => ::Thrift::Types::STRING, :name => 'message', :optional => true} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field errorCode is unset!') unless @errorCode unless @errorCode.nil? || Evernote::EDAM::Error::EDAMErrorCode::VALID_VALUES.include?(@errorCode) raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field errorCode!') end end ::Thrift::Struct.generate_accessors self end # This exception is thrown by EDAM procedures when a caller asks to perform # an operation that does not exist. This may be thrown based on an invalid # primary identifier (e.g. a bad GUID), or when the caller refers to an object # by another unique identifier (e.g. a User's email address). # # identifier: the object identifier that was not found on the server. # # key: the value passed from the client in the identifier, which was not # found. E.g. the GUID of an object that was not found. class EDAMNotFoundException < ::Thrift::Exception include ::Thrift::Struct, ::Thrift::Struct_Union IDENTIFIER = 1 KEY = 2 FIELDS = { IDENTIFIER => {:type => ::Thrift::Types::STRING, :name => 'identifier', :optional => true}, KEY => {:type => ::Thrift::Types::STRING, :name => 'key', :optional => true} } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self end end end end