Class: Gusto::Documents::DocumentSigned

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/documents/types/document_signed.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uuid: OMIT, title: OMIT, name: OMIT, recipient_type: OMIT, recipient_uuid: OMIT, signed_at: OMIT, description: OMIT, requires_signing: OMIT, draft: OMIT, year: OMIT, quarter: OMIT, additional_properties: nil) ⇒ Gusto::Documents::DocumentSigned

Parameters:

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/fern_gusto/documents/types/document_signed.rb', line 60

def initialize(uuid: OMIT, title: OMIT, name: OMIT, recipient_type: OMIT, recipient_uuid: OMIT, signed_at: OMIT, description: OMIT, requires_signing: OMIT, draft: OMIT, year: OMIT, quarter: OMIT, additional_properties: nil)
  @uuid = uuid if uuid != OMIT
  @title = title if title != OMIT
  @name = name if name != OMIT
  @recipient_type = recipient_type if recipient_type != OMIT
  @recipient_uuid = recipient_uuid if recipient_uuid != OMIT
  @signed_at = signed_at if signed_at != OMIT
  @description = description if description != OMIT
  @requires_signing = requires_signing if requires_signing != OMIT
  @draft = draft if draft != OMIT
  @year = year if year != OMIT
  @quarter = quarter if quarter != OMIT
  @additional_properties = additional_properties
  @_field_set = { "uuid": uuid, "title": title, "name": name, "recipient_type": recipient_type, "recipient_uuid": recipient_uuid, "signed_at": signed_at, "description": description, "requires_signing": requires_signing, "draft": draft, "year": year, "quarter": quarter }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



36
37
38
# File 'lib/fern_gusto/documents/types/document_signed.rb', line 36

def additional_properties
  @additional_properties
end

#descriptionString (readonly)

Returns The description of the document.

Returns:

  • (String)

    The description of the document



23
24
25
# File 'lib/fern_gusto/documents/types/document_signed.rb', line 23

def description
  @description
end

#draftBoolean (readonly)

Returns If the document is in a draft state.

Returns:

  • (Boolean)

    If the document is in a draft state



28
29
30
# File 'lib/fern_gusto/documents/types/document_signed.rb', line 28

def draft
  @draft
end

#nameString (readonly)

Returns The type identifier of the document.

Returns:

  • (String)

    The type identifier of the document



14
15
16
# File 'lib/fern_gusto/documents/types/document_signed.rb', line 14

def name
  @name
end

#quarterObject (readonly)

all documents.



34
35
36
# File 'lib/fern_gusto/documents/types/document_signed.rb', line 34

def quarter
  @quarter
end

#recipient_typeObject (readonly)

Contractor Documents)



17
18
19
# File 'lib/fern_gusto/documents/types/document_signed.rb', line 17

def recipient_type
  @recipient_type
end

#recipient_uuidString (readonly)

Returns Unique identifier for the recipient associated with the document.

Returns:

  • (String)

    Unique identifier for the recipient associated with the document



19
20
21
# File 'lib/fern_gusto/documents/types/document_signed.rb', line 19

def recipient_uuid
  @recipient_uuid
end

#requires_signingObject (readonly)

that this value will change after the document is signed.



26
27
28
# File 'lib/fern_gusto/documents/types/document_signed.rb', line 26

def requires_signing
  @requires_signing
end

#signed_atString (readonly)

Returns When the document was signed (will be ‘null` if unsigned).

Returns:

  • (String)

    When the document was signed (will be ‘null` if unsigned)



21
22
23
# File 'lib/fern_gusto/documents/types/document_signed.rb', line 21

def signed_at
  @signed_at
end

#titleString (readonly)

Returns The title of the document.

Returns:

  • (String)

    The title of the document



12
13
14
# File 'lib/fern_gusto/documents/types/document_signed.rb', line 12

def title
  @title
end

#uuidString (readonly)

Returns The UUID of the document.

Returns:

  • (String)

    The UUID of the document



10
11
12
# File 'lib/fern_gusto/documents/types/document_signed.rb', line 10

def uuid
  @uuid
end

#yearObject (readonly)

documents.



31
32
33
# File 'lib/fern_gusto/documents/types/document_signed.rb', line 31

def year
  @year
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::Documents::DocumentSigned

Parameters:

  • json_object (String)

Returns:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/fern_gusto/documents/types/document_signed.rb', line 81

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  uuid = parsed_json["uuid"]
  title = parsed_json["title"]
  name = parsed_json["name"]
  recipient_type = parsed_json["recipient_type"]
  recipient_uuid = parsed_json["recipient_uuid"]
  signed_at = parsed_json["signed_at"]
  description = parsed_json["description"]
  requires_signing = parsed_json["requires_signing"]
  draft = parsed_json["draft"]
  year = parsed_json["year"]
  quarter = parsed_json["quarter"]
  new(
    uuid: uuid,
    title: title,
    name: name,
    recipient_type: recipient_type,
    recipient_uuid: recipient_uuid,
    signed_at: signed_at,
    description: description,
    requires_signing: requires_signing,
    draft: draft,
    year: year,
    quarter: quarter,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/fern_gusto/documents/types/document_signed.rb', line 122

def self.validate_raw(obj:)
  obj.uuid&.is_a?(String) != false || raise("Passed value for field obj.uuid is not the expected type, validation failed.")
  obj.title&.is_a?(String) != false || raise("Passed value for field obj.title is not the expected type, validation failed.")
  obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
  obj.recipient_type&.is_a?(Gusto::Documents::DocumentSignedRecipientType) != false || raise("Passed value for field obj.recipient_type is not the expected type, validation failed.")
  obj.recipient_uuid&.is_a?(String) != false || raise("Passed value for field obj.recipient_uuid is not the expected type, validation failed.")
  obj.signed_at&.is_a?(String) != false || raise("Passed value for field obj.signed_at is not the expected type, validation failed.")
  obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
  obj.requires_signing&.is_a?(Boolean) != false || raise("Passed value for field obj.requires_signing is not the expected type, validation failed.")
  obj.draft&.is_a?(Boolean) != false || raise("Passed value for field obj.draft is not the expected type, validation failed.")
  obj.year&.is_a?(Integer) != false || raise("Passed value for field obj.year is not the expected type, validation failed.")
  obj.quarter&.is_a?(Integer) != false || raise("Passed value for field obj.quarter is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


113
114
115
# File 'lib/fern_gusto/documents/types/document_signed.rb', line 113

def to_json
  @_field_set&.to_json
end