From a7a9aa90f2738e2e4bc4c018d024274a6621b54d Mon Sep 17 00:00:00 2001 From: Antoine Date: Tue, 1 Oct 2024 19:38:42 +0000 Subject: [PATCH 1/2] Fix sites --- api/openapi.yaml | 305 +----------------- netbox/api/openapi.yaml | 304 ----------------- netbox/git_push.sh | 57 ---- netbox/model_aggregate.go | 72 +++-- netbox/model_asn.go | 108 ++++--- netbox/model_asn_range.go | 72 +++-- netbox/model_available_ip.go | 37 ++- netbox/model_available_prefix.go | 37 ++- netbox/model_available_vlan.go | 37 ++- netbox/model_bookmark.go | 59 ++-- netbox/model_brief_interface.go | 37 ++- netbox/model_brief_job.go | 37 ++- netbox/model_brief_power_port.go | 37 ++- netbox/model_brief_region.go | 37 ++- netbox/model_brief_site_group.go | 37 ++- netbox/model_cable.go | 72 +++-- netbox/model_cable_termination.go | 94 ++++-- netbox/model_circuit.go | 142 +++++--- netbox/model_circuit_circuit_termination.go | 72 +++-- ...del_circuit_circuit_termination_request.go | 110 +++---- netbox/model_circuit_group.go | 72 +++-- netbox/model_circuit_group_assignment.go | 72 +++-- netbox/model_circuit_termination.go | 142 +++++--- netbox/model_circuit_type.go | 72 +++-- netbox/model_cluster.go | 72 +++-- netbox/model_cluster_group.go | 72 +++-- netbox/model_cluster_type.go | 72 +++-- netbox/model_config_context.go | 107 ++++-- netbox/model_config_template.go | 107 ++++-- netbox/model_console_port.go | 199 ++++++++---- netbox/model_console_port_template.go | 72 +++-- netbox/model_console_server_port.go | 199 ++++++++---- netbox/model_console_server_port_template.go | 72 +++-- netbox/model_contact.go | 72 +++-- netbox/model_contact_assignment.go | 72 +++-- netbox/model_contact_group.go | 72 +++-- netbox/model_contact_role.go | 72 +++-- netbox/model_custom_field.go | 72 +++-- netbox/model_custom_field_choice_set.go | 72 +++-- netbox/model_custom_link.go | 72 +++-- netbox/model_data_source.go | 107 ++++-- netbox/model_device_bay.go | 72 +++-- netbox/model_device_bay_template.go | 72 +++-- netbox/model_device_role.go | 72 +++-- netbox/model_device_type.go | 72 +++-- netbox/model_device_with_config_context.go | 164 +++++++--- netbox/model_event_rule.go | 72 +++-- netbox/model_export_template.go | 107 ++++-- netbox/model_fhrp_group.go | 72 +++-- netbox/model_fhrp_group_assignment.go | 94 ++++-- netbox/model_front_port.go | 142 +++++--- netbox/model_front_port_template.go | 72 +++-- netbox/model_generic_object.go | 24 +- netbox/model_ike_policy.go | 72 +++-- netbox/model_ike_proposal.go | 72 +++-- netbox/model_image_attachment.go | 94 ++++-- netbox/model_interface.go | 269 ++++++++++----- netbox/model_interface_template.go | 72 +++-- netbox/model_inventory_item.go | 94 ++++-- netbox/model_inventory_item_role.go | 72 +++-- netbox/model_inventory_item_template.go | 94 ++++-- netbox/model_ip_address.go | 94 ++++-- netbox/model_ip_range.go | 72 +++-- netbox/model_ip_sec_policy.go | 72 +++-- netbox/model_ip_sec_profile.go | 72 +++-- netbox/model_ip_sec_proposal.go | 72 +++-- netbox/model_job.go | 37 ++- netbox/model_journal_entry.go | 94 ++++-- netbox/model_l2_vpn.go | 72 +++-- netbox/model_l2_vpn_termination.go | 94 ++++-- netbox/model_location.go | 72 +++-- netbox/model_manufacturer.go | 72 +++-- netbox/model_module.go | 72 +++-- netbox/model_module_bay.go | 72 +++-- netbox/model_module_bay_template.go | 72 +++-- netbox/model_module_type.go | 72 +++-- netbox/model_notification.go | 59 ++-- netbox/model_object_change.go | 68 ++-- netbox/model_platform.go | 72 +++-- netbox/model_power_feed.go | 199 ++++++++---- netbox/model_power_outlet.go | 199 ++++++++---- netbox/model_power_outlet_template.go | 72 +++-- netbox/model_power_panel.go | 72 +++-- netbox/model_power_port.go | 199 ++++++++---- netbox/model_power_port_template.go | 72 +++-- netbox/model_prefix.go | 72 +++-- netbox/model_provider.go | 72 +++-- netbox/model_provider_account.go | 72 +++-- netbox/model_provider_network.go | 72 +++-- netbox/model_rack.go | 72 +++-- netbox/model_rack_reservation.go | 72 +++-- netbox/model_rack_role.go | 72 +++-- netbox/model_rack_type.go | 72 +++-- netbox/model_rear_port.go | 142 +++++--- netbox/model_rear_port_template.go | 72 +++-- netbox/model_region.go | 107 ++++-- netbox/model_rir.go | 72 +++-- netbox/model_role.go | 72 +++-- netbox/model_route_target.go | 72 +++-- netbox/model_saved_filter.go | 72 +++-- netbox/model_script.go | 59 ++-- netbox/model_service.go | 72 +++-- netbox/model_service_template.go | 72 +++-- netbox/model_site.go | 72 +++-- netbox/model_site_group.go | 107 ++++-- netbox/model_subscription.go | 59 ++-- netbox/model_tag.go | 72 +++-- netbox/model_tenant.go | 107 ++++-- netbox/model_tenant_group.go | 72 +++-- netbox/model_token.go | 37 ++- netbox/model_token_provision.go | 37 ++- netbox/model_tunnel.go | 72 +++-- netbox/model_tunnel_group.go | 72 +++-- netbox/model_tunnel_termination.go | 129 +++++--- netbox/model_tunnel_termination_request.go | 37 ++- netbox/model_virtual_chassis.go | 72 +++-- netbox/model_virtual_device_context.go | 107 ++++-- netbox/model_virtual_disk.go | 72 +++-- ...del_virtual_machine_with_config_context.go | 129 +++++--- netbox/model_vlan.go | 107 ++++-- netbox/model_vlan_group.go | 94 ++++-- netbox/model_vm_interface.go | 107 ++++-- netbox/model_vrf.go | 72 +++-- netbox/model_webhook.go | 72 +++-- netbox/model_wireless_lan.go | 72 +++-- netbox/model_wireless_lan_group.go | 72 +++-- netbox/model_wireless_link.go | 72 +++-- .../model_writable_contact_group_request.go | 37 ++- netbox/model_writable_location_request.go | 37 ++- netbox/model_writable_region_request.go | 37 ++- netbox/model_writable_site_group_request.go | 37 ++- ...del_writable_tunnel_termination_request.go | 37 ++- ...del_writable_wireless_lan_group_request.go | 37 ++- scripts/fix-spec.py | 40 ++- tests/sites_test.go | 20 ++ tests/tenant_test.go | 18 ++ 136 files changed, 7408 insertions(+), 3902 deletions(-) delete mode 100644 netbox/git_push.sh create mode 100644 tests/sites_test.go create mode 100644 tests/tenant_test.go diff --git a/api/openapi.yaml b/api/openapi.yaml index 7901d8056..9e5f00222 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -145872,12 +145872,9 @@ components: readOnly: true required: - asn - - created - display - id - - last_updated - provider_count - - site_count - url ASNRange: type: object @@ -145945,11 +145942,9 @@ components: readOnly: true required: - asn_count - - created - display - end - id - - last_updated - name - rir - slug @@ -146103,11 +146098,9 @@ components: readOnly: true nullable: true required: - - created - display - family - id - - last_updated - prefix - rir - url @@ -146174,7 +146167,6 @@ components: required: - address - family - - vrf AvailablePrefix: type: object description: Representation of a prefix which does not exist in the database. @@ -146193,7 +146185,6 @@ components: required: - family - prefix - - vrf AvailableVLAN: type: object description: Representation of a VLAN which does not exist in the database. @@ -146207,7 +146198,6 @@ components: readOnly: true nullable: true required: - - group - vid Bookmark: type: object @@ -146243,10 +146233,8 @@ components: format: date-time readOnly: true required: - - created - display - id - - object - object_id - object_type - url @@ -147400,7 +147388,6 @@ components: title: ' occupied' required: - _occupied - - cable - device - display - id @@ -147530,7 +147517,6 @@ components: - $ref: '#/components/schemas/BriefUser' readOnly: true required: - - created - status - url - user @@ -148050,7 +148036,6 @@ components: title: ' occupied' required: - _occupied - - cable - device - display - id @@ -148551,7 +148536,6 @@ components: - display - id - name - - site_count - slug - url BriefRegionRequest: @@ -148698,7 +148682,6 @@ components: - display - id - name - - site_count - slug - url BriefSiteGroupRequest: @@ -149490,10 +149473,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - url CableRequest: type: object @@ -149698,11 +149679,8 @@ components: required: - cable - cable_end - - created - display - id - - last_updated - - termination - termination_id - termination_type - url @@ -149857,13 +149835,9 @@ components: $ref: '#/components/schemas/BriefCircuitGroupAssignmentSerializer_' required: - cid - - created - display - id - - last_updated - provider - - termination_a - - termination_z - type - url CircuitCircuitTermination: @@ -149923,8 +149897,6 @@ components: required: - display - id - - provider_network - - site - url CircuitCircuitTerminationRequest: type: object @@ -149966,9 +149938,7 @@ components: description: type: string maxLength: 200 - required: - - provider_network - - site + required: [] CircuitGroup: type: object description: Adds support for custom fields and tags. @@ -150024,10 +149994,8 @@ components: readOnly: true required: - circuit_count - - created - display - id - - last_updated - name - slug - url @@ -150095,11 +150063,9 @@ components: nullable: true required: - circuit - - created - display - group - id - - last_updated - url CircuitGroupAssignmentRequest: type: object @@ -150350,15 +150316,11 @@ components: title: ' occupied' required: - _occupied - - cable - cable_end - circuit - - created - display - id - - last_updated - link_peers - - link_peers_type - term_side - url CircuitTerminationRequest: @@ -150480,10 +150442,8 @@ components: readOnly: true required: - circuit_count - - created - display - id - - last_updated - name - slug - url @@ -150612,10 +150572,8 @@ components: format: int64 readOnly: true required: - - created - display - id - - last_updated - name - type - url @@ -150669,10 +150627,8 @@ components: format: int64 readOnly: true required: - - created - display - id - - last_updated - name - slug - url @@ -150807,10 +150763,8 @@ components: format: int64 readOnly: true required: - - created - display - id - - last_updated - name - slug - url @@ -150953,14 +150907,11 @@ components: readOnly: true nullable: true required: - - created - data - data_file - data_path - - data_synced - display - id - - last_updated - name - url ConfigContextRequest: @@ -151106,12 +151057,9 @@ components: readOnly: true nullable: true required: - - created - data_path - - data_synced - display - id - - last_updated - name - template_code - url @@ -151348,18 +151296,12 @@ components: title: ' occupied' required: - _occupied - - cable - cable_end - - connected_endpoints - connected_endpoints_reachable - - connected_endpoints_type - - created - device - display - id - - last_updated - link_peers - - link_peers_type - name - url ConsolePortRequest: @@ -151591,10 +151533,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - url ConsolePortTemplateRequest: @@ -151877,18 +151817,12 @@ components: title: ' occupied' required: - _occupied - - cable - cable_end - - connected_endpoints - connected_endpoints_reachable - - connected_endpoints_type - - created - device - display - id - - last_updated - link_peers - - link_peers_type - name - url ConsoleServerPortRequest: @@ -152120,10 +152054,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - url ConsoleServerPortTemplateRequest: @@ -152270,10 +152202,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - url ContactAssignment: @@ -152352,10 +152282,8 @@ components: nullable: true required: - contact - - created - display - id - - last_updated - object - object_id - object_type @@ -152464,10 +152392,8 @@ components: required: - _depth - contact_count - - created - display - id - - last_updated - name - slug - url @@ -152590,10 +152516,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - slug - url @@ -152865,11 +152789,9 @@ components: readOnly: true nullable: true required: - - created - data_type - display - id - - last_updated - name - object_types - type @@ -152947,11 +152869,9 @@ components: nullable: true required: - choices_count - - created - display - extra_choices - id - - last_updated - name - url CustomFieldChoiceSetRequest: @@ -153276,10 +153196,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - link_text - link_url - name @@ -153547,12 +153465,9 @@ components: format: int64 readOnly: true required: - - created - display - file_count - id - - last_synced - - last_updated - name - source_url - status @@ -153935,11 +153850,9 @@ components: readOnly: true nullable: true required: - - created - device - display - id - - last_updated - name - url DeviceBayRequest: @@ -154015,11 +153928,9 @@ components: readOnly: true nullable: true required: - - created - device_type - display - id - - last_updated - name - url DeviceBayTemplateRequest: @@ -154112,10 +154023,8 @@ components: format: int64 readOnly: true required: - - created - display - id - - last_updated - name - slug - url @@ -154366,14 +154275,12 @@ components: required: - console_port_template_count - console_server_port_template_count - - created - device_bay_template_count - display - front_port_template_count - id - interface_template_count - inventory_item_template_count - - last_updated - manufacturer - model - module_bay_template_count @@ -154781,10 +154688,8 @@ components: type: integer readOnly: true required: - - config_context - console_port_count - console_server_port_count - - created - device_bay_count - device_type - display @@ -154792,12 +154697,9 @@ components: - id - interface_count - inventory_item_count - - last_updated - module_bay_count - - parent_device - power_outlet_count - power_port_count - - primary_ip - rear_port_count - role - site @@ -155097,11 +154999,9 @@ components: - action_object - action_object_type - action_type - - created - display - event_types - id - - last_updated - name - object_types - url @@ -155259,13 +155159,10 @@ components: readOnly: true nullable: true required: - - created - data_file - data_path - - data_synced - display - id - - last_updated - name - object_types - template_code @@ -155402,12 +155299,10 @@ components: $ref: '#/components/schemas/BriefIPAddress' readOnly: true required: - - created - display - group_id - id - ip_addresses - - last_updated - protocol - url FHRPGroupAssignment: @@ -155451,14 +155346,11 @@ components: readOnly: true nullable: true required: - - created - display - group - id - - interface - interface_id - interface_type - - last_updated - priority - url FHRPGroupAssignmentRequest: @@ -155866,15 +155758,11 @@ components: title: ' occupied' required: - _occupied - - cable - cable_end - - created - device - display - id - - last_updated - link_peers - - link_peers_type - name - rear_port - type @@ -156435,10 +156323,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - rear_port - type @@ -156667,7 +156553,6 @@ components: nullable: true readOnly: true required: - - object - object_id - object_type GenericObjectRequest: @@ -156827,10 +156712,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - url - version @@ -157133,12 +157016,10 @@ components: nullable: true required: - authentication_method - - created - display - encryption_algorithm - group - id - - last_updated - name - url IKEProposalRequest: @@ -157474,12 +157355,9 @@ components: nullable: true required: - address - - assigned_object - - created - display - family - id - - last_updated - nat_outside - url IPAddressRequest: @@ -157677,12 +157555,10 @@ components: type: boolean description: Treat as fully utilized required: - - created - display - end_address - family - id - - last_updated - size - start_address - url @@ -157891,10 +157767,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - url IPSecPolicyRequest: @@ -158063,12 +157937,10 @@ components: readOnly: true nullable: true required: - - created - display - id - ike_policy - ipsec_policy - - last_updated - mode - name - url @@ -158239,11 +158111,9 @@ components: nullable: true required: - authentication_algorithm - - created - display - encryption_algorithm - id - - last_updated - name - url IPSecProposalRequest: @@ -158379,16 +158249,13 @@ components: readOnly: true nullable: true required: - - created - display - id - image - image_height - image_width - - last_updated - object_id - object_type - - parent - url ImageAttachmentRequest: type: object @@ -160046,25 +159913,17 @@ components: title: ' occupied' required: - _occupied - - cable - cable_end - - connected_endpoints - connected_endpoints_reachable - - connected_endpoints_type - count_fhrp_groups - count_ipaddresses - - created - device - display - id - - l2vpn_termination - - last_updated - link_peers - - link_peers_type - name - type - url - - wireless_link InterfaceRequest: type: object description: Adds support for custom fields and tags. @@ -161904,10 +161763,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - type - url @@ -162484,12 +162341,9 @@ components: title: ' depth' required: - _depth - - component - - created - device - display - id - - last_updated - name - url InventoryItemRequest: @@ -162609,11 +162463,9 @@ components: format: int64 readOnly: true required: - - created - display - id - inventoryitem_count - - last_updated - name - slug - url @@ -162722,12 +162574,9 @@ components: title: ' depth' required: - _depth - - component - - created - device_type - display - id - - last_updated - name - url InventoryItemTemplateRequest: @@ -162877,7 +162726,6 @@ components: type: string format: uuid required: - - created - display - error - id @@ -162963,14 +162811,11 @@ components: readOnly: true nullable: true required: - - assigned_object - assigned_object_id - assigned_object_type - comments - - created - display - id - - last_updated - url JournalEntryRequest: type: object @@ -163138,10 +162983,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - slug - url @@ -163278,14 +163121,11 @@ components: readOnly: true nullable: true required: - - assigned_object - assigned_object_id - assigned_object_type - - created - display - id - l2vpn - - last_updated - url L2VPNTerminationRequest: type: object @@ -163413,10 +163253,8 @@ components: title: ' depth' required: - _depth - - created - display - id - - last_updated - name - site - slug @@ -163538,11 +163376,9 @@ components: format: int64 readOnly: true required: - - created - display - id - inventoryitem_count - - last_updated - name - platform_count - slug @@ -163662,11 +163498,9 @@ components: readOnly: true nullable: true required: - - created - device - display - id - - last_updated - module_bay - module_type - url @@ -163730,11 +163564,9 @@ components: readOnly: true nullable: true required: - - created - device - display - id - - last_updated - name - url ModuleBayRequest: @@ -163828,10 +163660,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - url ModuleBayTemplateRequest: @@ -164044,10 +163874,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - manufacturer - model - url @@ -165147,11 +164975,9 @@ components: x-spec-enum-id: 80d172232f4af424 title: Event required: - - created - display - event_type - id - - object - object_id - object_type - url @@ -165343,13 +165169,10 @@ components: nullable: true required: - action - - changed_object - changed_object_id - changed_object_type - display - id - - postchange_data - - prechange_data - request_id - time - url @@ -177627,10 +177450,8 @@ components: format: int64 readOnly: true required: - - created - display - id - - last_updated - name - slug - url @@ -177848,17 +177669,11 @@ components: title: ' occupied' required: - _occupied - - cable - cable_end - - connected_endpoints - connected_endpoints_reachable - - connected_endpoints_type - - created - display - id - - last_updated - link_peers - - link_peers_type - name - power_panel - url @@ -178472,18 +178287,12 @@ components: title: ' occupied' required: - _occupied - - cable - cable_end - - connected_endpoints - connected_endpoints_reachable - - connected_endpoints_type - - created - device - display - id - - last_updated - link_peers - - link_peers_type - name - url PowerOutletRequest: @@ -179315,10 +179124,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - url PowerOutletTemplateRequest: @@ -179722,10 +179529,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - powerfeed_count - site @@ -180287,18 +180092,12 @@ components: title: ' occupied' required: - _occupied - - cable - cable_end - - connected_endpoints - connected_endpoints_reachable - - connected_endpoints_type - - created - device - display - id - - last_updated - link_peers - - link_peers_type - name - url PowerPortRequest: @@ -181151,10 +180950,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - url PowerPortTemplateRequest: @@ -181638,11 +181435,9 @@ components: required: - _depth - children - - created - display - family - id - - last_updated - prefix - url PrefixRequest: @@ -181770,10 +181565,8 @@ components: readOnly: true required: - circuit_count - - created - display - id - - last_updated - name - slug - url @@ -181829,10 +181622,8 @@ components: nullable: true required: - account - - created - display - id - - last_updated - provider - url ProviderAccountRequest: @@ -181914,10 +181705,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - provider - url @@ -182041,10 +181830,8 @@ components: readOnly: true required: - aggregate_count - - created - display - id - - last_updated - name - slug - url @@ -182366,10 +182153,8 @@ components: format: int64 readOnly: true required: - - created - display - id - - last_updated - name - powerfeed_count - site @@ -182628,11 +182413,9 @@ components: type: object additionalProperties: {} required: - - created - description - display - id - - last_updated - rack - units - url @@ -182727,10 +182510,8 @@ components: format: int64 readOnly: true required: - - created - display - id - - last_updated - name - slug - url @@ -182973,10 +182754,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - manufacturer - model - slug @@ -183495,15 +183274,11 @@ components: title: ' occupied' required: - _occupied - - cable - cable_end - - created - device - display - id - - last_updated - link_peers - - link_peers_type - name - type - url @@ -184004,10 +183779,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - type - url @@ -184277,12 +184050,9 @@ components: title: ' depth' required: - _depth - - created - display - id - - last_updated - name - - site_count - slug - url RegionRequest: @@ -184373,10 +184143,8 @@ components: format: int64 readOnly: true required: - - created - display - id - - last_updated - name - slug - url @@ -184459,10 +184227,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - url RouteTargetRequest: @@ -184550,10 +184316,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - object_types - parameters @@ -184641,7 +184405,6 @@ components: type: boolean readOnly: true required: - - description - display - id - is_executable @@ -184649,7 +184412,6 @@ components: - name - result - url - - vars ScriptInputRequest: type: object properties: @@ -184750,10 +184512,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - ports - url @@ -184883,10 +184643,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - ports - url @@ -185084,10 +184842,8 @@ components: readOnly: true required: - circuit_count - - created - display - id - - last_updated - name - slug - url @@ -185150,12 +184906,9 @@ components: title: ' depth' required: - _depth - - created - display - id - - last_updated - name - - site_count - slug - url SiteGroupRequest: @@ -185319,10 +185072,8 @@ components: format: date-time readOnly: true required: - - created - display - id - - object - object_id - object_type - url @@ -185401,10 +185152,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - slug - tagged_items @@ -185533,13 +185282,10 @@ components: readOnly: true required: - circuit_count - - created - display - id - ipaddress_count - - last_updated - name - - site_count - slug - url TenantGroup: @@ -185601,10 +185347,8 @@ components: title: ' depth' required: - _depth - - created - display - id - - last_updated - name - slug - tenant_count @@ -185717,7 +185461,6 @@ components: type: string maxLength: 200 required: - - created - display - id - url @@ -185769,7 +185512,6 @@ components: type: string maxLength: 200 required: - - created - display - id - key @@ -185945,11 +185687,9 @@ components: format: int64 readOnly: true required: - - created - display - encapsulation - id - - last_updated - name - status - terminations_count @@ -186004,10 +185744,8 @@ components: format: int64 readOnly: true required: - - created - display - id - - last_updated - name - slug - tunnel_count @@ -186181,13 +185919,9 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - role - - termination - - termination_id - termination_type - tunnel - url @@ -186230,7 +185964,6 @@ components: additionalProperties: {} required: - role - - termination_id - termination_type - tunnel User: @@ -186453,11 +186186,8 @@ components: format: int64 readOnly: true required: - - created - display - id - - l2vpn_termination - - last_updated - name - url - vid @@ -186523,12 +186253,9 @@ components: type: string readOnly: true required: - - created - display - id - - last_updated - name - - scope - slug - url - utilization @@ -186730,11 +186457,8 @@ components: required: - count_fhrp_groups - count_ipaddresses - - created - display - id - - l2vpn_termination - - last_updated - name - url - virtual_machine @@ -186879,11 +186603,9 @@ components: format: int64 readOnly: true required: - - created - display - id - ipaddress_count - - last_updated - name - url VRFRequest: @@ -186989,10 +186711,8 @@ components: $ref: '#/components/schemas/NestedDevice' readOnly: true required: - - created - display - id - - last_updated - member_count - members - name @@ -187119,14 +186839,11 @@ components: format: int64 readOnly: true required: - - created - device - display - id - interface_count - - last_updated - name - - primary_ip - status - url VirtualDeviceContextRequest: @@ -187233,10 +186950,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - size - url @@ -187424,14 +187139,10 @@ components: type: integer readOnly: true required: - - config_context - - created - display - id - interface_count - - last_updated - name - - primary_ip - url - virtual_disk_count VirtualMachineWithConfigContextRequest: @@ -187639,10 +187350,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - name - payload_url - url @@ -187860,10 +187569,8 @@ components: readOnly: true nullable: true required: - - created - display - id - - last_updated - ssid - url WirelessLANGroup: @@ -187925,10 +187632,8 @@ components: title: ' depth' required: - _depth - - created - display - id - - last_updated - name - slug - url @@ -188206,12 +187911,10 @@ components: readOnly: true nullable: true required: - - created - display - id - interface_a - interface_b - - last_updated - url WirelessLinkRequest: type: object @@ -189132,7 +188835,6 @@ components: additionalProperties: {} required: - name - - parent - slug WritableCustomFieldChoiceSetRequest: type: object @@ -192663,7 +192365,6 @@ components: additionalProperties: {} required: - name - - parent - site - slug WritableModuleRequest: @@ -195178,7 +194879,6 @@ components: additionalProperties: {} required: - name - - parent - slug WritableServiceRequest: type: object @@ -195306,7 +195006,6 @@ components: additionalProperties: {} required: - name - - parent - slug WritableSiteRequest: type: object @@ -195540,7 +195239,6 @@ components: type: object additionalProperties: {} required: - - termination_id - termination_type - tunnel WritableVLANRequest: @@ -195890,7 +195588,6 @@ components: additionalProperties: {} required: - name - - parent - slug WritableWirelessLANRequest: type: object diff --git a/netbox/api/openapi.yaml b/netbox/api/openapi.yaml index 4a931a437..be56ace3f 100644 --- a/netbox/api/openapi.yaml +++ b/netbox/api/openapi.yaml @@ -136009,12 +136009,9 @@ components: type: integer required: - asn - - created - display - id - - last_updated - provider_count - - site_count - url type: object ASNRange: @@ -136121,11 +136118,9 @@ components: type: integer required: - asn_count - - created - display - end - id - - last_updated - name - rir - slug @@ -136338,11 +136333,9 @@ components: readOnly: true type: string required: - - created - display - family - id - - last_updated - prefix - rir - url @@ -136436,7 +136429,6 @@ components: required: - address - family - - vrf type: object AvailablePrefix: description: Representation of a prefix which does not exist in the database. @@ -136459,7 +136451,6 @@ components: required: - family - prefix - - vrf type: object AvailableVLAN: description: Representation of a VLAN which does not exist in the database. @@ -136476,7 +136467,6 @@ components: nullable: true readOnly: true required: - - group - vid type: object Bookmark: @@ -136524,10 +136514,8 @@ components: readOnly: true type: string required: - - created - display - id - - object - object_id - object_type - url @@ -137772,7 +137760,6 @@ components: type: boolean required: - _occupied - - cable - device - display - id @@ -137876,7 +137863,6 @@ components: - $ref: '#/components/schemas/BriefUser' readOnly: true required: - - created - status - url - user @@ -138364,7 +138350,6 @@ components: type: boolean required: - _occupied - - cable - device - display - id @@ -138904,7 +138889,6 @@ components: - display - id - name - - site_count - slug - url type: object @@ -139058,7 +139042,6 @@ components: - display - id - name - - site_count - slug - url type: object @@ -139802,10 +139785,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - url type: object CableRequest: @@ -139937,11 +139918,8 @@ components: required: - cable - cable_end - - created - display - id - - last_updated - - termination - termination_id - termination_type - url @@ -140138,13 +140116,9 @@ components: type: array required: - cid - - created - display - id - - last_updated - provider - - termination_a - - termination_z - type - url type: object @@ -140201,8 +140175,6 @@ components: required: - display - id - - provider_network - - site - url type: object CircuitCircuitTerminationRequest: @@ -140241,9 +140213,6 @@ components: description: maxLength: 200 type: string - required: - - provider_network - - site type: object CircuitGroup: description: Adds support for custom fields and tags. @@ -140328,10 +140297,8 @@ components: type: integer required: - circuit_count - - created - display - id - - last_updated - name - slug - url @@ -140419,11 +140386,9 @@ components: type: string required: - circuit - - created - display - group - id - - last_updated - url type: object CircuitGroupAssignmentRequest: @@ -140753,15 +140718,11 @@ components: type: boolean required: - _occupied - - cable - cable_end - circuit - - created - display - id - - last_updated - link_peers - - link_peers_type - term_side - url type: object @@ -140930,10 +140891,8 @@ components: type: integer required: - circuit_count - - created - display - id - - last_updated - name - slug - url @@ -141092,10 +141051,8 @@ components: readOnly: true type: integer required: - - created - display - id - - last_updated - name - type - url @@ -141177,10 +141134,8 @@ components: readOnly: true type: integer required: - - created - display - id - - last_updated - name - slug - url @@ -141361,10 +141316,8 @@ components: readOnly: true type: integer required: - - created - display - id - - last_updated - name - slug - url @@ -142541,14 +142494,11 @@ components: readOnly: true type: string required: - - created - data - data_file - data_path - - data_synced - display - id - - last_updated - name - url type: object @@ -142779,12 +142729,9 @@ components: readOnly: true type: string required: - - created - data_path - - data_synced - display - id - - last_updated - name - template_code - url @@ -142980,18 +142927,12 @@ components: type: boolean required: - _occupied - - cable - cable_end - - connected_endpoints - connected_endpoints_reachable - - connected_endpoints_type - - created - device - display - id - - last_updated - link_peers - - link_peers_type - name - url type: object @@ -143115,10 +143056,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - url type: object @@ -143305,18 +143244,12 @@ components: type: boolean required: - _occupied - - cable - cable_end - - connected_endpoints - connected_endpoints_reachable - - connected_endpoints_type - - created - device - display - id - - last_updated - link_peers - - link_peers_type - name - url type: object @@ -143440,10 +143373,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - url type: object @@ -143582,10 +143513,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - url type: object @@ -143677,10 +143606,8 @@ components: type: string required: - contact - - created - display - id - - last_updated - object - object_id - object_type @@ -143822,10 +143749,8 @@ components: required: - _depth - contact_count - - created - display - id - - last_updated - name - slug - url @@ -144008,10 +143933,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - slug - url @@ -144219,11 +144142,9 @@ components: readOnly: true type: string required: - - created - data_type - display - id - - last_updated - name - object_types - type @@ -144300,11 +144221,9 @@ components: type: string required: - choices_count - - created - display - extra_choices - id - - last_updated - name - url type: object @@ -144549,10 +144468,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - link_text - link_url - name @@ -144772,12 +144689,9 @@ components: readOnly: true type: integer required: - - created - display - file_count - id - - last_synced - - last_updated - name - source_url - status @@ -145205,11 +145119,9 @@ components: readOnly: true type: string required: - - created - device - display - id - - last_updated - name - url type: object @@ -145326,11 +145238,9 @@ components: readOnly: true type: string required: - - created - device_type - display - id - - last_updated - name - url type: object @@ -145466,10 +145376,8 @@ components: readOnly: true type: integer required: - - created - display - id - - last_updated - name - slug - url @@ -145721,14 +145629,12 @@ components: required: - console_port_template_count - console_server_port_template_count - - created - device_bay_template_count - display - front_port_template_count - id - interface_template_count - inventory_item_template_count - - last_updated - manufacturer - model - module_bay_template_count @@ -146129,10 +146035,8 @@ components: readOnly: true type: integer required: - - config_context - console_port_count - console_server_port_count - - created - device_bay_count - device_type - display @@ -146140,12 +146044,9 @@ components: - id - interface_count - inventory_item_count - - last_updated - module_bay_count - - parent_device - power_outlet_count - power_port_count - - primary_ip - rear_port_count - role - site @@ -146442,11 +146343,9 @@ components: - action_object - action_object_type - action_type - - created - display - event_types - id - - last_updated - name - object_types - url @@ -146619,13 +146518,10 @@ components: readOnly: true type: string required: - - created - data_file - data_path - - data_synced - display - id - - last_updated - name - object_types - template_code @@ -146791,12 +146687,10 @@ components: readOnly: true type: array required: - - created - display - group_id - id - ip_addresses - - last_updated - protocol - url type: object @@ -146857,14 +146751,11 @@ components: readOnly: true type: string required: - - created - display - group - id - - interface - interface_id - interface_type - - last_updated - priority - url type: object @@ -147094,15 +146985,11 @@ components: type: boolean required: - _occupied - - cable - cable_end - - created - device - display - id - - last_updated - link_peers - - link_peers_type - name - rear_port - type @@ -147328,10 +147215,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - rear_port - type @@ -147409,7 +147294,6 @@ components: nullable: true readOnly: true required: - - object - object_id - object_type type: object @@ -147740,10 +147624,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - url - version @@ -147899,12 +147781,10 @@ components: type: string required: - authentication_method - - created - display - encryption_algorithm - group - id - - last_updated - name - url type: object @@ -148104,12 +147984,9 @@ components: type: string required: - address - - assigned_object - - created - display - family - id - - last_updated - nat_outside - url type: object @@ -148290,12 +148167,10 @@ components: description: Treat as fully utilized type: boolean required: - - created - display - end_address - family - id - - last_updated - size - start_address - url @@ -148509,10 +148384,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - url type: object @@ -148652,12 +148525,10 @@ components: readOnly: true type: string required: - - created - display - id - ike_policy - ipsec_policy - - last_updated - mode - name - url @@ -148810,11 +148681,9 @@ components: type: string required: - authentication_algorithm - - created - display - encryption_algorithm - id - - last_updated - name - url type: object @@ -148938,16 +148807,13 @@ components: readOnly: true type: string required: - - created - display - id - image - image_height - image_width - - last_updated - object_id - object_type - - parent - url type: object ImageAttachmentRequest: @@ -149498,25 +149364,17 @@ components: type: boolean required: - _occupied - - cable - cable_end - - connected_endpoints - connected_endpoints_reachable - - connected_endpoints_type - count_fhrp_groups - count_ipaddresses - - created - device - display - id - - l2vpn_termination - - last_updated - link_peers - - link_peers_type - name - type - url - - wireless_link type: object InterfaceRequest: description: Adds support for custom fields and tags. @@ -149785,10 +149643,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - type - url @@ -149988,12 +149844,9 @@ components: type: integer required: - _depth - - component - - created - device - display - id - - last_updated - name - url type: object @@ -150167,11 +150020,9 @@ components: readOnly: true type: integer required: - - created - display - id - inventoryitem_count - - last_updated - name - slug - url @@ -150326,12 +150177,9 @@ components: type: integer required: - _depth - - component - - created - device_type - display - id - - last_updated - name - url type: object @@ -150486,7 +150334,6 @@ components: format: uuid type: string required: - - created - display - error - id @@ -150581,14 +150428,11 @@ components: readOnly: true type: string required: - - assigned_object - assigned_object_id - assigned_object_type - comments - - created - display - id - - last_updated - url type: object JournalEntryRequest: @@ -150846,10 +150690,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - slug - url @@ -151010,14 +150852,11 @@ components: readOnly: true type: string required: - - assigned_object - assigned_object_id - assigned_object_type - - created - display - id - l2vpn - - last_updated - url type: object L2VPNTerminationRequest: @@ -151179,10 +151018,8 @@ components: type: integer required: - _depth - - created - display - id - - last_updated - name - site - slug @@ -151339,11 +151176,9 @@ components: readOnly: true type: integer required: - - created - display - id - inventoryitem_count - - last_updated - name - platform_count - slug @@ -151502,11 +151337,9 @@ components: readOnly: true type: string required: - - created - device - display - id - - last_updated - module_bay - module_type - url @@ -151606,11 +151439,9 @@ components: readOnly: true type: string required: - - created - device - display - id - - last_updated - name - url type: object @@ -151734,10 +151565,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - url type: object @@ -151949,10 +151778,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - manufacturer - model - url @@ -152981,11 +152808,9 @@ components: event_type: $ref: '#/components/schemas/Event' required: - - created - display - event_type - id - - object - object_id - object_type - url @@ -153825,13 +153650,10 @@ components: readOnly: true required: - action - - changed_object - changed_object_id - changed_object_type - display - id - - postchange_data - - prechange_data - request_id - time - url @@ -177303,10 +177125,8 @@ components: readOnly: true type: integer required: - - created - display - id - - last_updated - name - slug - url @@ -177535,17 +177355,11 @@ components: type: boolean required: - _occupied - - cable - cable_end - - connected_endpoints - connected_endpoints_reachable - - connected_endpoints_type - - created - display - id - - last_updated - link_peers - - link_peers_type - name - power_panel - url @@ -177783,18 +177597,12 @@ components: type: boolean required: - _occupied - - cable - cable_end - - connected_endpoints - connected_endpoints_reachable - - connected_endpoints_type - - created - device - display - id - - last_updated - link_peers - - link_peers_type - name - url type: object @@ -177933,10 +177741,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - url type: object @@ -178075,10 +177881,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - powerfeed_count - site @@ -178285,18 +178089,12 @@ components: type: boolean required: - _occupied - - cable - cable_end - - connected_endpoints - connected_endpoints_reachable - - connected_endpoints_type - - created - device - display - id - - last_updated - link_peers - - link_peers_type - name - url type: object @@ -178445,10 +178243,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - url type: object @@ -178628,11 +178424,9 @@ components: required: - _depth - children - - created - display - family - id - - last_updated - prefix - url type: object @@ -178871,10 +178665,8 @@ components: type: integer required: - circuit_count - - created - display - id - - last_updated - name - slug - url @@ -178966,10 +178758,8 @@ components: type: string required: - account - - created - display - id - - last_updated - provider - url type: object @@ -179105,10 +178895,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - provider - url @@ -179299,10 +179087,8 @@ components: type: integer required: - aggregate_count - - created - display - id - - last_updated - name - slug - url @@ -179562,10 +179348,8 @@ components: readOnly: true type: integer required: - - created - display - id - - last_updated - name - powerfeed_count - site @@ -179819,11 +179603,9 @@ components: additionalProperties: {} type: object required: - - created - description - display - id - - last_updated - rack - units - url @@ -179968,10 +179750,8 @@ components: readOnly: true type: integer required: - - created - display - id - - last_updated - name - slug - url @@ -180182,10 +179962,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - manufacturer - model - slug @@ -180486,15 +180264,11 @@ components: type: boolean required: - _occupied - - cable - cable_end - - created - device - display - id - - last_updated - link_peers - - link_peers_type - name - type - url @@ -180638,10 +180412,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - type - url @@ -180783,12 +180555,9 @@ components: type: integer required: - _depth - - created - display - id - - last_updated - name - - site_count - slug - url type: object @@ -180923,10 +180692,8 @@ components: readOnly: true type: integer required: - - created - display - id - - last_updated - name - slug - url @@ -181051,10 +180818,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - url type: object @@ -181173,10 +180938,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - object_types - parameters @@ -181285,7 +181048,6 @@ components: readOnly: true type: boolean required: - - description - display - id - is_executable @@ -181293,7 +181055,6 @@ components: - name - result - url - - vars type: object ScriptInputRequest: example: @@ -181526,10 +181287,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - ports - url @@ -181685,10 +181444,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - ports - url @@ -181973,10 +181730,8 @@ components: type: integer required: - circuit_count - - created - display - id - - last_updated - name - slug - url @@ -182069,12 +181824,9 @@ components: type: integer required: - _depth - - created - display - id - - last_updated - name - - site_count - slug - url type: object @@ -182275,10 +182027,8 @@ components: readOnly: true type: string required: - - created - display - id - - object - object_id - object_type - url @@ -182375,10 +182125,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - slug - tagged_items @@ -182553,13 +182301,10 @@ components: type: integer required: - circuit_count - - created - display - id - ipaddress_count - - last_updated - name - - site_count - slug - url type: object @@ -182651,10 +182396,8 @@ components: type: integer required: - _depth - - created - display - id - - last_updated - name - slug - tenant_count @@ -182811,7 +182554,6 @@ components: maxLength: 200 type: string required: - - created - display - id - url @@ -182874,7 +182616,6 @@ components: maxLength: 200 type: string required: - - created - display - id - key @@ -183058,11 +182799,9 @@ components: readOnly: true type: integer required: - - created - display - encapsulation - id - - last_updated - name - status - terminations_count @@ -183145,10 +182884,8 @@ components: readOnly: true type: integer required: - - created - display - id - - last_updated - name - slug - tunnel_count @@ -183349,13 +183086,9 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - role - - termination - - termination_id - termination_type - tunnel - url @@ -183405,7 +183138,6 @@ components: type: object required: - role - - termination_id - termination_type - tunnel type: object @@ -183907,11 +183639,8 @@ components: readOnly: true type: integer required: - - created - display - id - - l2vpn_termination - - last_updated - name - url - vid @@ -184009,12 +183738,9 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - - scope - slug - url - utilization @@ -184338,11 +184064,8 @@ components: required: - count_fhrp_groups - count_ipaddresses - - created - display - id - - l2vpn_termination - - last_updated - name - url - virtual_machine @@ -184644,11 +184367,9 @@ components: readOnly: true type: integer required: - - created - display - id - ipaddress_count - - last_updated - name - url type: object @@ -184817,10 +184538,8 @@ components: readOnly: true type: array required: - - created - display - id - - last_updated - member_count - members - name @@ -184985,14 +184704,11 @@ components: readOnly: true type: integer required: - - created - device - display - id - interface_count - - last_updated - name - - primary_ip - status - url type: object @@ -185143,10 +184859,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - size - url @@ -185367,14 +185081,10 @@ components: readOnly: true type: integer required: - - config_context - - created - display - id - interface_count - - last_updated - name - - primary_ip - url - virtual_disk_count type: object @@ -185609,10 +185319,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - name - payload_url - url @@ -185806,10 +185514,8 @@ components: readOnly: true type: string required: - - created - display - id - - last_updated - ssid - url type: object @@ -185901,10 +185607,8 @@ components: type: integer required: - _depth - - created - display - id - - last_updated - name - slug - url @@ -186159,12 +185863,10 @@ components: readOnly: true type: string required: - - created - display - id - interface_a - interface_b - - last_updated - url type: object WirelessLinkRequest: @@ -186848,7 +186550,6 @@ components: type: object required: - name - - parent - slug type: object WritableCustomFieldChoiceSetRequest: @@ -188352,7 +188053,6 @@ components: type: object required: - name - - parent - site - slug type: object @@ -189292,7 +188992,6 @@ components: type: object required: - name - - parent - slug type: object WritableServiceRequest: @@ -189453,7 +189152,6 @@ components: type: object required: - name - - parent - slug type: object WritableSiteRequest: @@ -189715,7 +189413,6 @@ components: additionalProperties: {} type: object required: - - termination_id - termination_type - tunnel type: object @@ -190132,7 +189829,6 @@ components: type: object required: - name - - parent - slug type: object WritableWirelessLANRequest: diff --git a/netbox/git_push.sh b/netbox/git_push.sh deleted file mode 100644 index 9a055f5e9..000000000 --- a/netbox/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="sherweb" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="go-netbox/v4" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/netbox/model_aggregate.go b/netbox/model_aggregate.go index 7f34d93ff..63a70d1b6 100644 --- a/netbox/model_aggregate.go +++ b/netbox/model_aggregate.go @@ -34,8 +34,8 @@ type Aggregate struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -45,7 +45,7 @@ type _Aggregate Aggregate // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewAggregate(id int32, url string, display string, family AggregateFamily, prefix string, rir BriefRIR, created NullableTime, lastUpdated NullableTime) *Aggregate { +func NewAggregate(id int32, url string, display string, family AggregateFamily, prefix string, rir BriefRIR) *Aggregate { this := Aggregate{} this.Id = id this.Url = url @@ -53,8 +53,6 @@ func NewAggregate(id int32, url string, display string, family AggregateFamily, this.Family = family this.Prefix = prefix this.Rir = rir - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -460,18 +458,16 @@ func (o *Aggregate) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Aggregate) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Aggregate) GetCreatedOk() (*time.Time, bool) { @@ -481,24 +477,39 @@ func (o *Aggregate) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Aggregate) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Aggregate) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Aggregate) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Aggregate) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Aggregate) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Aggregate) GetLastUpdatedOk() (*time.Time, bool) { @@ -508,11 +519,28 @@ func (o *Aggregate) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Aggregate) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Aggregate) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Aggregate) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Aggregate) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o Aggregate) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -551,8 +579,12 @@ func (o Aggregate) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -572,8 +604,6 @@ func (o *Aggregate) UnmarshalJSON(data []byte) (err error) { "family", "prefix", "rir", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_asn.go b/netbox/model_asn.go index 14a360274..1a040103c 100644 --- a/netbox/model_asn.go +++ b/netbox/model_asn.go @@ -33,9 +33,9 @@ type ASN struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` - SiteCount int64 `json:"site_count"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` + SiteCount *int64 `json:"site_count,omitempty"` ProviderCount int64 `json:"provider_count"` AdditionalProperties map[string]interface{} } @@ -46,15 +46,12 @@ type _ASN ASN // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewASN(id int32, url string, display string, asn int64, created NullableTime, lastUpdated NullableTime, siteCount int64, providerCount int64) *ASN { +func NewASN(id int32, url string, display string, asn int64, providerCount int64) *ASN { this := ASN{} this.Id = id this.Url = url this.Display = display this.Asn = asn - this.Created = created - this.LastUpdated = lastUpdated - this.SiteCount = siteCount this.ProviderCount = providerCount return &this } @@ -411,18 +408,16 @@ func (o *ASN) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ASN) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ASN) GetCreatedOk() (*time.Time, bool) { @@ -432,24 +427,39 @@ func (o *ASN) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ASN) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ASN) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ASN) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ASN) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ASN) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ASN) GetLastUpdatedOk() (*time.Time, bool) { @@ -459,36 +469,60 @@ func (o *ASN) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ASN) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ASN) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ASN) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ASN) UnsetLastUpdated() { + o.LastUpdated.Unset() +} -// GetSiteCount returns the SiteCount field value +// GetSiteCount returns the SiteCount field value if set, zero value otherwise. func (o *ASN) GetSiteCount() int64 { - if o == nil { + if o == nil || IsNil(o.SiteCount) { var ret int64 return ret } - - return o.SiteCount + return *o.SiteCount } -// GetSiteCountOk returns a tuple with the SiteCount field value +// GetSiteCountOk returns a tuple with the SiteCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ASN) GetSiteCountOk() (*int64, bool) { - if o == nil { + if o == nil || IsNil(o.SiteCount) { return nil, false } - return &o.SiteCount, true + return o.SiteCount, true } -// SetSiteCount sets field value -func (o *ASN) SetSiteCount(v int64) { - o.SiteCount = v +// HasSiteCount returns a boolean if a field has been set. +func (o *ASN) HasSiteCount() bool { + if o != nil && !IsNil(o.SiteCount) { + return true + } + + return false } +// SetSiteCount gets a reference to the given int64 and assigns it to the SiteCount field. +func (o *ASN) SetSiteCount(v int64) { + o.SiteCount = &v +} // GetProviderCount returns the ProviderCount field value func (o *ASN) GetProviderCount() int64 { @@ -550,9 +584,15 @@ func (o ASN) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() - toSerialize["site_count"] = o.SiteCount + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } + if !IsNil(o.SiteCount) { + toSerialize["site_count"] = o.SiteCount + } toSerialize["provider_count"] = o.ProviderCount for key, value := range o.AdditionalProperties { @@ -571,10 +611,6 @@ func (o *ASN) UnmarshalJSON(data []byte) (err error) { "url", "display", "asn", - "created", - "last_updated", - "site_count", - "provider_count", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_asn_range.go b/netbox/model_asn_range.go index 898435bfd..a2fb8702b 100644 --- a/netbox/model_asn_range.go +++ b/netbox/model_asn_range.go @@ -34,8 +34,8 @@ type ASNRange struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AsnCount int32 `json:"asn_count"` AdditionalProperties map[string]interface{} } @@ -46,7 +46,7 @@ type _ASNRange ASNRange // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewASNRange(id int32, url string, display string, name string, slug string, rir BriefRIR, start int64, end int64, created NullableTime, lastUpdated NullableTime, asnCount int32) *ASNRange { +func NewASNRange(id int32, url string, display string, name string, slug string, rir BriefRIR, start int64, end int64, asnCount int32) *ASNRange { this := ASNRange{} this.Id = id this.Url = url @@ -56,8 +56,6 @@ func NewASNRange(id int32, url string, display string, name string, slug string, this.Rir = rir this.Start = start this.End = end - this.Created = created - this.LastUpdated = lastUpdated this.AsnCount = asnCount return &this } @@ -440,18 +438,16 @@ func (o *ASNRange) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ASNRange) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ASNRange) GetCreatedOk() (*time.Time, bool) { @@ -461,24 +457,39 @@ func (o *ASNRange) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ASNRange) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ASNRange) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ASNRange) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ASNRange) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ASNRange) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ASNRange) GetLastUpdatedOk() (*time.Time, bool) { @@ -488,11 +499,28 @@ func (o *ASNRange) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ASNRange) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ASNRange) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ASNRange) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ASNRange) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetAsnCount returns the AsnCount field value func (o *ASNRange) GetAsnCount() int32 { @@ -552,8 +580,12 @@ func (o ASNRange) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["asn_count"] = o.AsnCount for key, value := range o.AdditionalProperties { @@ -576,8 +608,6 @@ func (o *ASNRange) UnmarshalJSON(data []byte) (err error) { "rir", "start", "end", - "created", - "last_updated", "asn_count", } diff --git a/netbox/model_available_ip.go b/netbox/model_available_ip.go index 98f6ee639..aa14d4dad 100644 --- a/netbox/model_available_ip.go +++ b/netbox/model_available_ip.go @@ -22,7 +22,7 @@ var _ MappedNullable = &AvailableIP{} type AvailableIP struct { Family int32 `json:"family"` Address string `json:"address"` - Vrf NullableBriefVRF `json:"vrf"` + Vrf NullableBriefVRF `json:"vrf,omitempty"` Description *string `json:"description,omitempty"` AdditionalProperties map[string]interface{} } @@ -33,11 +33,10 @@ type _AvailableIP AvailableIP // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewAvailableIP(family int32, address string, vrf NullableBriefVRF) *AvailableIP { +func NewAvailableIP(family int32, address string) *AvailableIP { this := AvailableIP{} this.Family = family this.Address = address - this.Vrf = vrf return &this } @@ -99,18 +98,16 @@ func (o *AvailableIP) SetAddress(v string) { } -// GetVrf returns the Vrf field value -// If the value is explicit nil, the zero value for BriefVRF will be returned +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). func (o *AvailableIP) GetVrf() BriefVRF { - if o == nil || o.Vrf.Get() == nil { + if o == nil || IsNil(o.Vrf.Get()) { var ret BriefVRF return ret } - return *o.Vrf.Get() } -// GetVrfOk returns a tuple with the Vrf field value +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *AvailableIP) GetVrfOk() (*BriefVRF, bool) { @@ -120,11 +117,28 @@ func (o *AvailableIP) GetVrfOk() (*BriefVRF, bool) { return o.Vrf.Get(), o.Vrf.IsSet() } -// SetVrf sets field value +// HasVrf returns a boolean if a field has been set. +func (o *AvailableIP) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableBriefVRF and assigns it to the Vrf field. func (o *AvailableIP) SetVrf(v BriefVRF) { o.Vrf.Set(&v) } +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *AvailableIP) SetVrfNil() { + o.Vrf.Set(nil) +} +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *AvailableIP) UnsetVrf() { + o.Vrf.Unset() +} // GetDescription returns the Description field value if set, zero value otherwise. func (o *AvailableIP) GetDescription() string { @@ -170,7 +184,9 @@ func (o AvailableIP) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["family"] = o.Family toSerialize["address"] = o.Address - toSerialize["vrf"] = o.Vrf.Get() + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } if !IsNil(o.Description) { toSerialize["description"] = o.Description } @@ -189,7 +205,6 @@ func (o *AvailableIP) UnmarshalJSON(data []byte) (err error) { requiredProperties := []string{ "family", "address", - "vrf", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_available_prefix.go b/netbox/model_available_prefix.go index 4140b9f62..fd07527eb 100644 --- a/netbox/model_available_prefix.go +++ b/netbox/model_available_prefix.go @@ -22,7 +22,7 @@ var _ MappedNullable = &AvailablePrefix{} type AvailablePrefix struct { Family int32 `json:"family"` Prefix string `json:"prefix"` - Vrf NullableBriefVRF `json:"vrf"` + Vrf NullableBriefVRF `json:"vrf,omitempty"` AdditionalProperties map[string]interface{} } @@ -32,11 +32,10 @@ type _AvailablePrefix AvailablePrefix // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewAvailablePrefix(family int32, prefix string, vrf NullableBriefVRF) *AvailablePrefix { +func NewAvailablePrefix(family int32, prefix string) *AvailablePrefix { this := AvailablePrefix{} this.Family = family this.Prefix = prefix - this.Vrf = vrf return &this } @@ -98,18 +97,16 @@ func (o *AvailablePrefix) SetPrefix(v string) { } -// GetVrf returns the Vrf field value -// If the value is explicit nil, the zero value for BriefVRF will be returned +// GetVrf returns the Vrf field value if set, zero value otherwise (both if not set or set to explicit null). func (o *AvailablePrefix) GetVrf() BriefVRF { - if o == nil || o.Vrf.Get() == nil { + if o == nil || IsNil(o.Vrf.Get()) { var ret BriefVRF return ret } - return *o.Vrf.Get() } -// GetVrfOk returns a tuple with the Vrf field value +// GetVrfOk returns a tuple with the Vrf field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *AvailablePrefix) GetVrfOk() (*BriefVRF, bool) { @@ -119,11 +116,28 @@ func (o *AvailablePrefix) GetVrfOk() (*BriefVRF, bool) { return o.Vrf.Get(), o.Vrf.IsSet() } -// SetVrf sets field value +// HasVrf returns a boolean if a field has been set. +func (o *AvailablePrefix) HasVrf() bool { + if o != nil && o.Vrf.IsSet() { + return true + } + + return false +} + +// SetVrf gets a reference to the given NullableBriefVRF and assigns it to the Vrf field. func (o *AvailablePrefix) SetVrf(v BriefVRF) { o.Vrf.Set(&v) } +// SetVrfNil sets the value for Vrf to be an explicit nil +func (o *AvailablePrefix) SetVrfNil() { + o.Vrf.Set(nil) +} +// UnsetVrf ensures that no value is present for Vrf, not even an explicit nil +func (o *AvailablePrefix) UnsetVrf() { + o.Vrf.Unset() +} func (o AvailablePrefix) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -137,7 +151,9 @@ func (o AvailablePrefix) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["family"] = o.Family toSerialize["prefix"] = o.Prefix - toSerialize["vrf"] = o.Vrf.Get() + if o.Vrf.IsSet() { + toSerialize["vrf"] = o.Vrf.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -153,7 +169,6 @@ func (o *AvailablePrefix) UnmarshalJSON(data []byte) (err error) { requiredProperties := []string{ "family", "prefix", - "vrf", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_available_vlan.go b/netbox/model_available_vlan.go index c68a3d6e6..3656e747b 100644 --- a/netbox/model_available_vlan.go +++ b/netbox/model_available_vlan.go @@ -21,7 +21,7 @@ var _ MappedNullable = &AvailableVLAN{} // AvailableVLAN Representation of a VLAN which does not exist in the database. type AvailableVLAN struct { Vid int32 `json:"vid"` - Group NullableBriefVLANGroup `json:"group"` + Group NullableBriefVLANGroup `json:"group,omitempty"` AdditionalProperties map[string]interface{} } @@ -31,10 +31,9 @@ type _AvailableVLAN AvailableVLAN // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewAvailableVLAN(vid int32, group NullableBriefVLANGroup) *AvailableVLAN { +func NewAvailableVLAN(vid int32) *AvailableVLAN { this := AvailableVLAN{} this.Vid = vid - this.Group = group return &this } @@ -71,18 +70,16 @@ func (o *AvailableVLAN) SetVid(v int32) { } -// GetGroup returns the Group field value -// If the value is explicit nil, the zero value for BriefVLANGroup will be returned +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). func (o *AvailableVLAN) GetGroup() BriefVLANGroup { - if o == nil || o.Group.Get() == nil { + if o == nil || IsNil(o.Group.Get()) { var ret BriefVLANGroup return ret } - return *o.Group.Get() } -// GetGroupOk returns a tuple with the Group field value +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *AvailableVLAN) GetGroupOk() (*BriefVLANGroup, bool) { @@ -92,11 +89,28 @@ func (o *AvailableVLAN) GetGroupOk() (*BriefVLANGroup, bool) { return o.Group.Get(), o.Group.IsSet() } -// SetGroup sets field value +// HasGroup returns a boolean if a field has been set. +func (o *AvailableVLAN) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableBriefVLANGroup and assigns it to the Group field. func (o *AvailableVLAN) SetGroup(v BriefVLANGroup) { o.Group.Set(&v) } +// SetGroupNil sets the value for Group to be an explicit nil +func (o *AvailableVLAN) SetGroupNil() { + o.Group.Set(nil) +} +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *AvailableVLAN) UnsetGroup() { + o.Group.Unset() +} func (o AvailableVLAN) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -109,7 +123,9 @@ func (o AvailableVLAN) MarshalJSON() ([]byte, error) { func (o AvailableVLAN) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["vid"] = o.Vid - toSerialize["group"] = o.Group.Get() + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -124,7 +140,6 @@ func (o *AvailableVLAN) UnmarshalJSON(data []byte) (err error) { // that every required field exists as a key in the generic map. requiredProperties := []string{ "vid", - "group", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_bookmark.go b/netbox/model_bookmark.go index 5293eb8fd..c9add9ae1 100644 --- a/netbox/model_bookmark.go +++ b/netbox/model_bookmark.go @@ -26,9 +26,9 @@ type Bookmark struct { Display string `json:"display"` ObjectType string `json:"object_type"` ObjectId int64 `json:"object_id"` - Object interface{} `json:"object"` + Object interface{} `json:"object,omitempty"` User BriefUser `json:"user"` - Created time.Time `json:"created"` + Created *time.Time `json:"created,omitempty"` AdditionalProperties map[string]interface{} } @@ -38,16 +38,14 @@ type _Bookmark Bookmark // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBookmark(id int32, url string, display string, objectType string, objectId int64, object interface{}, user BriefUser, created time.Time) *Bookmark { +func NewBookmark(id int32, url string, display string, objectType string, objectId int64, user BriefUser) *Bookmark { this := Bookmark{} this.Id = id this.Url = url this.Display = display this.ObjectType = objectType this.ObjectId = objectId - this.Object = object this.User = user - this.Created = created return &this } @@ -184,18 +182,16 @@ func (o *Bookmark) SetObjectId(v int64) { } -// GetObject returns the Object field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetObject returns the Object field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Bookmark) GetObject() interface{} { if o == nil { var ret interface{} return ret } - return o.Object } -// GetObjectOk returns a tuple with the Object field value +// GetObjectOk returns a tuple with the Object field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Bookmark) GetObjectOk() (*interface{}, bool) { @@ -205,12 +201,20 @@ func (o *Bookmark) GetObjectOk() (*interface{}, bool) { return &o.Object, true } -// SetObject sets field value +// HasObject returns a boolean if a field has been set. +func (o *Bookmark) HasObject() bool { + if o != nil && !IsNil(o.Object) { + return true + } + + return false +} + +// SetObject gets a reference to the given interface{} and assigns it to the Object field. func (o *Bookmark) SetObject(v interface{}) { o.Object = v } - // GetUser returns the User field value func (o *Bookmark) GetUser() BriefUser { if o == nil { @@ -236,30 +240,37 @@ func (o *Bookmark) SetUser(v BriefUser) { } -// GetCreated returns the Created field value +// GetCreated returns the Created field value if set, zero value otherwise. func (o *Bookmark) GetCreated() time.Time { - if o == nil { + if o == nil || IsNil(o.Created) { var ret time.Time return ret } - - return o.Created + return *o.Created } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Bookmark) GetCreatedOk() (*time.Time, bool) { - if o == nil { + if o == nil || IsNil(o.Created) { return nil, false } - return &o.Created, true + return o.Created, true } -// SetCreated sets field value -func (o *Bookmark) SetCreated(v time.Time) { - o.Created = v +// HasCreated returns a boolean if a field has been set. +func (o *Bookmark) HasCreated() bool { + if o != nil && !IsNil(o.Created) { + return true + } + + return false } +// SetCreated gets a reference to the given time.Time and assigns it to the Created field. +func (o *Bookmark) SetCreated(v time.Time) { + o.Created = &v +} func (o Bookmark) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -280,7 +291,9 @@ func (o Bookmark) ToMap() (map[string]interface{}, error) { toSerialize["object"] = o.Object } toSerialize["user"] = o.User - toSerialize["created"] = o.Created + if !IsNil(o.Created) { + toSerialize["created"] = o.Created + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -299,9 +312,7 @@ func (o *Bookmark) UnmarshalJSON(data []byte) (err error) { "display", "object_type", "object_id", - "object", "user", - "created", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_brief_interface.go b/netbox/model_brief_interface.go index 2369366d6..12b31634c 100644 --- a/netbox/model_brief_interface.go +++ b/netbox/model_brief_interface.go @@ -26,7 +26,7 @@ type BriefInterface struct { Device BriefDevice `json:"device"` Name string `json:"name"` Description *string `json:"description,omitempty"` - Cable NullableBriefCable `json:"cable"` + Cable NullableBriefCable `json:"cable,omitempty"` Occupied bool `json:"_occupied"` AdditionalProperties map[string]interface{} } @@ -37,14 +37,13 @@ type _BriefInterface BriefInterface // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBriefInterface(id int32, url string, display string, device BriefDevice, name string, cable NullableBriefCable, occupied bool) *BriefInterface { +func NewBriefInterface(id int32, url string, display string, device BriefDevice, name string, occupied bool) *BriefInterface { this := BriefInterface{} this.Id = id this.Url = url this.Display = display this.Device = device this.Name = name - this.Cable = cable this.Occupied = occupied return &this } @@ -214,18 +213,16 @@ func (o *BriefInterface) SetDescription(v string) { o.Description = &v } -// GetCable returns the Cable field value -// If the value is explicit nil, the zero value for BriefCable will be returned +// GetCable returns the Cable field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BriefInterface) GetCable() BriefCable { - if o == nil || o.Cable.Get() == nil { + if o == nil || IsNil(o.Cable.Get()) { var ret BriefCable return ret } - return *o.Cable.Get() } -// GetCableOk returns a tuple with the Cable field value +// GetCableOk returns a tuple with the Cable field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *BriefInterface) GetCableOk() (*BriefCable, bool) { @@ -235,11 +232,28 @@ func (o *BriefInterface) GetCableOk() (*BriefCable, bool) { return o.Cable.Get(), o.Cable.IsSet() } -// SetCable sets field value +// HasCable returns a boolean if a field has been set. +func (o *BriefInterface) HasCable() bool { + if o != nil && o.Cable.IsSet() { + return true + } + + return false +} + +// SetCable gets a reference to the given NullableBriefCable and assigns it to the Cable field. func (o *BriefInterface) SetCable(v BriefCable) { o.Cable.Set(&v) } +// SetCableNil sets the value for Cable to be an explicit nil +func (o *BriefInterface) SetCableNil() { + o.Cable.Set(nil) +} +// UnsetCable ensures that no value is present for Cable, not even an explicit nil +func (o *BriefInterface) UnsetCable() { + o.Cable.Unset() +} // GetOccupied returns the Occupied field value func (o *BriefInterface) GetOccupied() bool { @@ -284,7 +298,9 @@ func (o BriefInterface) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["cable"] = o.Cable.Get() + if o.Cable.IsSet() { + toSerialize["cable"] = o.Cable.Get() + } toSerialize["_occupied"] = o.Occupied for key, value := range o.AdditionalProperties { @@ -304,7 +320,6 @@ func (o *BriefInterface) UnmarshalJSON(data []byte) (err error) { "display", "device", "name", - "cable", "_occupied", } diff --git a/netbox/model_brief_job.go b/netbox/model_brief_job.go index 76685fa8e..d14d89942 100644 --- a/netbox/model_brief_job.go +++ b/netbox/model_brief_job.go @@ -23,7 +23,7 @@ var _ MappedNullable = &BriefJob{} type BriefJob struct { Url string `json:"url"` Status BriefJobStatus `json:"status"` - Created time.Time `json:"created"` + Created *time.Time `json:"created,omitempty"` Completed NullableTime `json:"completed,omitempty"` User BriefUser `json:"user"` AdditionalProperties map[string]interface{} @@ -35,11 +35,10 @@ type _BriefJob BriefJob // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBriefJob(url string, status BriefJobStatus, created time.Time, user BriefUser) *BriefJob { +func NewBriefJob(url string, status BriefJobStatus, user BriefUser) *BriefJob { this := BriefJob{} this.Url = url this.Status = status - this.Created = created this.User = user return &this } @@ -102,30 +101,37 @@ func (o *BriefJob) SetStatus(v BriefJobStatus) { } -// GetCreated returns the Created field value +// GetCreated returns the Created field value if set, zero value otherwise. func (o *BriefJob) GetCreated() time.Time { - if o == nil { + if o == nil || IsNil(o.Created) { var ret time.Time return ret } - - return o.Created + return *o.Created } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *BriefJob) GetCreatedOk() (*time.Time, bool) { - if o == nil { + if o == nil || IsNil(o.Created) { return nil, false } - return &o.Created, true + return o.Created, true } -// SetCreated sets field value -func (o *BriefJob) SetCreated(v time.Time) { - o.Created = v +// HasCreated returns a boolean if a field has been set. +func (o *BriefJob) HasCreated() bool { + if o != nil && !IsNil(o.Created) { + return true + } + + return false } +// SetCreated gets a reference to the given time.Time and assigns it to the Created field. +func (o *BriefJob) SetCreated(v time.Time) { + o.Created = &v +} // GetCompleted returns the Completed field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BriefJob) GetCompleted() time.Time { @@ -206,7 +212,9 @@ func (o BriefJob) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["url"] = o.Url toSerialize["status"] = o.Status - toSerialize["created"] = o.Created + if !IsNil(o.Created) { + toSerialize["created"] = o.Created + } if o.Completed.IsSet() { toSerialize["completed"] = o.Completed.Get() } @@ -226,7 +234,6 @@ func (o *BriefJob) UnmarshalJSON(data []byte) (err error) { requiredProperties := []string{ "url", "status", - "created", "user", } diff --git a/netbox/model_brief_power_port.go b/netbox/model_brief_power_port.go index c1cdf82cc..0301e25a9 100644 --- a/netbox/model_brief_power_port.go +++ b/netbox/model_brief_power_port.go @@ -26,7 +26,7 @@ type BriefPowerPort struct { Device BriefDevice `json:"device"` Name string `json:"name"` Description *string `json:"description,omitempty"` - Cable NullableBriefCable `json:"cable"` + Cable NullableBriefCable `json:"cable,omitempty"` Occupied bool `json:"_occupied"` AdditionalProperties map[string]interface{} } @@ -37,14 +37,13 @@ type _BriefPowerPort BriefPowerPort // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBriefPowerPort(id int32, url string, display string, device BriefDevice, name string, cable NullableBriefCable, occupied bool) *BriefPowerPort { +func NewBriefPowerPort(id int32, url string, display string, device BriefDevice, name string, occupied bool) *BriefPowerPort { this := BriefPowerPort{} this.Id = id this.Url = url this.Display = display this.Device = device this.Name = name - this.Cable = cable this.Occupied = occupied return &this } @@ -214,18 +213,16 @@ func (o *BriefPowerPort) SetDescription(v string) { o.Description = &v } -// GetCable returns the Cable field value -// If the value is explicit nil, the zero value for BriefCable will be returned +// GetCable returns the Cable field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BriefPowerPort) GetCable() BriefCable { - if o == nil || o.Cable.Get() == nil { + if o == nil || IsNil(o.Cable.Get()) { var ret BriefCable return ret } - return *o.Cable.Get() } -// GetCableOk returns a tuple with the Cable field value +// GetCableOk returns a tuple with the Cable field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *BriefPowerPort) GetCableOk() (*BriefCable, bool) { @@ -235,11 +232,28 @@ func (o *BriefPowerPort) GetCableOk() (*BriefCable, bool) { return o.Cable.Get(), o.Cable.IsSet() } -// SetCable sets field value +// HasCable returns a boolean if a field has been set. +func (o *BriefPowerPort) HasCable() bool { + if o != nil && o.Cable.IsSet() { + return true + } + + return false +} + +// SetCable gets a reference to the given NullableBriefCable and assigns it to the Cable field. func (o *BriefPowerPort) SetCable(v BriefCable) { o.Cable.Set(&v) } +// SetCableNil sets the value for Cable to be an explicit nil +func (o *BriefPowerPort) SetCableNil() { + o.Cable.Set(nil) +} +// UnsetCable ensures that no value is present for Cable, not even an explicit nil +func (o *BriefPowerPort) UnsetCable() { + o.Cable.Unset() +} // GetOccupied returns the Occupied field value func (o *BriefPowerPort) GetOccupied() bool { @@ -284,7 +298,9 @@ func (o BriefPowerPort) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["cable"] = o.Cable.Get() + if o.Cable.IsSet() { + toSerialize["cable"] = o.Cable.Get() + } toSerialize["_occupied"] = o.Occupied for key, value := range o.AdditionalProperties { @@ -304,7 +320,6 @@ func (o *BriefPowerPort) UnmarshalJSON(data []byte) (err error) { "display", "device", "name", - "cable", "_occupied", } diff --git a/netbox/model_brief_region.go b/netbox/model_brief_region.go index 82073e6f8..23ffe6d23 100644 --- a/netbox/model_brief_region.go +++ b/netbox/model_brief_region.go @@ -26,7 +26,7 @@ type BriefRegion struct { Name string `json:"name"` Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` Description *string `json:"description,omitempty"` - SiteCount int32 `json:"site_count"` + SiteCount *int32 `json:"site_count,omitempty"` Depth int32 `json:"_depth"` AdditionalProperties map[string]interface{} } @@ -37,14 +37,13 @@ type _BriefRegion BriefRegion // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBriefRegion(id int32, url string, display string, name string, slug string, siteCount int32, depth int32) *BriefRegion { +func NewBriefRegion(id int32, url string, display string, name string, slug string, depth int32) *BriefRegion { this := BriefRegion{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.SiteCount = siteCount this.Depth = depth return &this } @@ -214,30 +213,37 @@ func (o *BriefRegion) SetDescription(v string) { o.Description = &v } -// GetSiteCount returns the SiteCount field value +// GetSiteCount returns the SiteCount field value if set, zero value otherwise. func (o *BriefRegion) GetSiteCount() int32 { - if o == nil { + if o == nil || IsNil(o.SiteCount) { var ret int32 return ret } - - return o.SiteCount + return *o.SiteCount } -// GetSiteCountOk returns a tuple with the SiteCount field value +// GetSiteCountOk returns a tuple with the SiteCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *BriefRegion) GetSiteCountOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.SiteCount) { return nil, false } - return &o.SiteCount, true + return o.SiteCount, true } -// SetSiteCount sets field value -func (o *BriefRegion) SetSiteCount(v int32) { - o.SiteCount = v +// HasSiteCount returns a boolean if a field has been set. +func (o *BriefRegion) HasSiteCount() bool { + if o != nil && !IsNil(o.SiteCount) { + return true + } + + return false } +// SetSiteCount gets a reference to the given int32 and assigns it to the SiteCount field. +func (o *BriefRegion) SetSiteCount(v int32) { + o.SiteCount = &v +} // GetDepth returns the Depth field value func (o *BriefRegion) GetDepth() int32 { @@ -282,7 +288,9 @@ func (o BriefRegion) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["site_count"] = o.SiteCount + if !IsNil(o.SiteCount) { + toSerialize["site_count"] = o.SiteCount + } toSerialize["_depth"] = o.Depth for key, value := range o.AdditionalProperties { @@ -302,7 +310,6 @@ func (o *BriefRegion) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "site_count", "_depth", } diff --git a/netbox/model_brief_site_group.go b/netbox/model_brief_site_group.go index 8bae77cd7..76bc549b6 100644 --- a/netbox/model_brief_site_group.go +++ b/netbox/model_brief_site_group.go @@ -26,7 +26,7 @@ type BriefSiteGroup struct { Name string `json:"name"` Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` Description *string `json:"description,omitempty"` - SiteCount int32 `json:"site_count"` + SiteCount *int32 `json:"site_count,omitempty"` Depth int32 `json:"_depth"` AdditionalProperties map[string]interface{} } @@ -37,14 +37,13 @@ type _BriefSiteGroup BriefSiteGroup // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewBriefSiteGroup(id int32, url string, display string, name string, slug string, siteCount int32, depth int32) *BriefSiteGroup { +func NewBriefSiteGroup(id int32, url string, display string, name string, slug string, depth int32) *BriefSiteGroup { this := BriefSiteGroup{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.SiteCount = siteCount this.Depth = depth return &this } @@ -214,30 +213,37 @@ func (o *BriefSiteGroup) SetDescription(v string) { o.Description = &v } -// GetSiteCount returns the SiteCount field value +// GetSiteCount returns the SiteCount field value if set, zero value otherwise. func (o *BriefSiteGroup) GetSiteCount() int32 { - if o == nil { + if o == nil || IsNil(o.SiteCount) { var ret int32 return ret } - - return o.SiteCount + return *o.SiteCount } -// GetSiteCountOk returns a tuple with the SiteCount field value +// GetSiteCountOk returns a tuple with the SiteCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *BriefSiteGroup) GetSiteCountOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.SiteCount) { return nil, false } - return &o.SiteCount, true + return o.SiteCount, true } -// SetSiteCount sets field value -func (o *BriefSiteGroup) SetSiteCount(v int32) { - o.SiteCount = v +// HasSiteCount returns a boolean if a field has been set. +func (o *BriefSiteGroup) HasSiteCount() bool { + if o != nil && !IsNil(o.SiteCount) { + return true + } + + return false } +// SetSiteCount gets a reference to the given int32 and assigns it to the SiteCount field. +func (o *BriefSiteGroup) SetSiteCount(v int32) { + o.SiteCount = &v +} // GetDepth returns the Depth field value func (o *BriefSiteGroup) GetDepth() int32 { @@ -282,7 +288,9 @@ func (o BriefSiteGroup) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["site_count"] = o.SiteCount + if !IsNil(o.SiteCount) { + toSerialize["site_count"] = o.SiteCount + } toSerialize["_depth"] = o.Depth for key, value := range o.AdditionalProperties { @@ -302,7 +310,6 @@ func (o *BriefSiteGroup) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "site_count", "_depth", } diff --git a/netbox/model_cable.go b/netbox/model_cable.go index 329bd76ce..2f92d7039 100644 --- a/netbox/model_cable.go +++ b/netbox/model_cable.go @@ -38,8 +38,8 @@ type Cable struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -49,13 +49,11 @@ type _Cable Cable // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCable(id int32, url string, display string, created NullableTime, lastUpdated NullableTime) *Cable { +func NewCable(id int32, url string, display string) *Cable { this := Cable{} this.Id = id this.Url = url this.Display = display - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -620,18 +618,16 @@ func (o *Cable) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Cable) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Cable) GetCreatedOk() (*time.Time, bool) { @@ -641,24 +637,39 @@ func (o *Cable) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Cable) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Cable) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Cable) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Cable) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Cable) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Cable) GetLastUpdatedOk() (*time.Time, bool) { @@ -668,11 +679,28 @@ func (o *Cable) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Cable) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Cable) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Cable) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Cable) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o Cable) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -729,8 +757,12 @@ func (o Cable) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -747,8 +779,6 @@ func (o *Cable) UnmarshalJSON(data []byte) (err error) { "id", "url", "display", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_cable_termination.go b/netbox/model_cable_termination.go index dfcfaf541..246544d67 100644 --- a/netbox/model_cable_termination.go +++ b/netbox/model_cable_termination.go @@ -28,9 +28,9 @@ type CableTermination struct { CableEnd End1 `json:"cable_end"` TerminationType string `json:"termination_type"` TerminationId int64 `json:"termination_id"` - Termination interface{} `json:"termination"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Termination interface{} `json:"termination,omitempty"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -40,7 +40,7 @@ type _CableTermination CableTermination // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCableTermination(id int32, url string, display string, cable int32, cableEnd End1, terminationType string, terminationId int64, termination interface{}, created NullableTime, lastUpdated NullableTime) *CableTermination { +func NewCableTermination(id int32, url string, display string, cable int32, cableEnd End1, terminationType string, terminationId int64) *CableTermination { this := CableTermination{} this.Id = id this.Url = url @@ -49,9 +49,6 @@ func NewCableTermination(id int32, url string, display string, cable int32, cabl this.CableEnd = cableEnd this.TerminationType = terminationType this.TerminationId = terminationId - this.Termination = termination - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -238,18 +235,16 @@ func (o *CableTermination) SetTerminationId(v int64) { } -// GetTermination returns the Termination field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetTermination returns the Termination field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CableTermination) GetTermination() interface{} { if o == nil { var ret interface{} return ret } - return o.Termination } -// GetTerminationOk returns a tuple with the Termination field value +// GetTerminationOk returns a tuple with the Termination field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CableTermination) GetTerminationOk() (*interface{}, bool) { @@ -259,24 +254,30 @@ func (o *CableTermination) GetTerminationOk() (*interface{}, bool) { return &o.Termination, true } -// SetTermination sets field value +// HasTermination returns a boolean if a field has been set. +func (o *CableTermination) HasTermination() bool { + if o != nil && !IsNil(o.Termination) { + return true + } + + return false +} + +// SetTermination gets a reference to the given interface{} and assigns it to the Termination field. func (o *CableTermination) SetTermination(v interface{}) { o.Termination = v } - -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CableTermination) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CableTermination) GetCreatedOk() (*time.Time, bool) { @@ -286,24 +287,39 @@ func (o *CableTermination) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *CableTermination) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *CableTermination) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *CableTermination) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *CableTermination) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CableTermination) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CableTermination) GetLastUpdatedOk() (*time.Time, bool) { @@ -313,11 +329,28 @@ func (o *CableTermination) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *CableTermination) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *CableTermination) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *CableTermination) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *CableTermination) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o CableTermination) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -339,8 +372,12 @@ func (o CableTermination) ToMap() (map[string]interface{}, error) { if o.Termination != nil { toSerialize["termination"] = o.Termination } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -361,9 +398,6 @@ func (o *CableTermination) UnmarshalJSON(data []byte) (err error) { "cable_end", "termination_type", "termination_id", - "termination", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_circuit.go b/netbox/model_circuit.go index fe6a6a3e1..96c0ce990 100644 --- a/netbox/model_circuit.go +++ b/netbox/model_circuit.go @@ -37,13 +37,13 @@ type Circuit struct { // Committed rate CommitRate NullableInt32 `json:"commit_rate,omitempty"` Description *string `json:"description,omitempty"` - TerminationA NullableCircuitCircuitTermination `json:"termination_a"` - TerminationZ NullableCircuitCircuitTermination `json:"termination_z"` + TerminationA NullableCircuitCircuitTermination `json:"termination_a,omitempty"` + TerminationZ NullableCircuitCircuitTermination `json:"termination_z,omitempty"` Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` Assignments []BriefCircuitGroupAssignmentSerializer `json:"assignments,omitempty"` AdditionalProperties map[string]interface{} } @@ -54,7 +54,7 @@ type _Circuit Circuit // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCircuit(id int32, url string, display string, cid string, provider BriefProvider, type_ BriefCircuitType, terminationA NullableCircuitCircuitTermination, terminationZ NullableCircuitCircuitTermination, created NullableTime, lastUpdated NullableTime) *Circuit { +func NewCircuit(id int32, url string, display string, cid string, provider BriefProvider, type_ BriefCircuitType) *Circuit { this := Circuit{} this.Id = id this.Url = url @@ -62,10 +62,6 @@ func NewCircuit(id int32, url string, display string, cid string, provider Brief this.Cid = cid this.Provider = provider this.Type = type_ - this.TerminationA = terminationA - this.TerminationZ = terminationZ - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -533,18 +529,16 @@ func (o *Circuit) SetDescription(v string) { o.Description = &v } -// GetTerminationA returns the TerminationA field value -// If the value is explicit nil, the zero value for CircuitCircuitTermination will be returned +// GetTerminationA returns the TerminationA field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Circuit) GetTerminationA() CircuitCircuitTermination { - if o == nil || o.TerminationA.Get() == nil { + if o == nil || IsNil(o.TerminationA.Get()) { var ret CircuitCircuitTermination return ret } - return *o.TerminationA.Get() } -// GetTerminationAOk returns a tuple with the TerminationA field value +// GetTerminationAOk returns a tuple with the TerminationA field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Circuit) GetTerminationAOk() (*CircuitCircuitTermination, bool) { @@ -554,24 +548,39 @@ func (o *Circuit) GetTerminationAOk() (*CircuitCircuitTermination, bool) { return o.TerminationA.Get(), o.TerminationA.IsSet() } -// SetTerminationA sets field value +// HasTerminationA returns a boolean if a field has been set. +func (o *Circuit) HasTerminationA() bool { + if o != nil && o.TerminationA.IsSet() { + return true + } + + return false +} + +// SetTerminationA gets a reference to the given NullableCircuitCircuitTermination and assigns it to the TerminationA field. func (o *Circuit) SetTerminationA(v CircuitCircuitTermination) { o.TerminationA.Set(&v) } +// SetTerminationANil sets the value for TerminationA to be an explicit nil +func (o *Circuit) SetTerminationANil() { + o.TerminationA.Set(nil) +} +// UnsetTerminationA ensures that no value is present for TerminationA, not even an explicit nil +func (o *Circuit) UnsetTerminationA() { + o.TerminationA.Unset() +} -// GetTerminationZ returns the TerminationZ field value -// If the value is explicit nil, the zero value for CircuitCircuitTermination will be returned +// GetTerminationZ returns the TerminationZ field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Circuit) GetTerminationZ() CircuitCircuitTermination { - if o == nil || o.TerminationZ.Get() == nil { + if o == nil || IsNil(o.TerminationZ.Get()) { var ret CircuitCircuitTermination return ret } - return *o.TerminationZ.Get() } -// GetTerminationZOk returns a tuple with the TerminationZ field value +// GetTerminationZOk returns a tuple with the TerminationZ field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Circuit) GetTerminationZOk() (*CircuitCircuitTermination, bool) { @@ -581,11 +590,28 @@ func (o *Circuit) GetTerminationZOk() (*CircuitCircuitTermination, bool) { return o.TerminationZ.Get(), o.TerminationZ.IsSet() } -// SetTerminationZ sets field value +// HasTerminationZ returns a boolean if a field has been set. +func (o *Circuit) HasTerminationZ() bool { + if o != nil && o.TerminationZ.IsSet() { + return true + } + + return false +} + +// SetTerminationZ gets a reference to the given NullableCircuitCircuitTermination and assigns it to the TerminationZ field. func (o *Circuit) SetTerminationZ(v CircuitCircuitTermination) { o.TerminationZ.Set(&v) } +// SetTerminationZNil sets the value for TerminationZ to be an explicit nil +func (o *Circuit) SetTerminationZNil() { + o.TerminationZ.Set(nil) +} +// UnsetTerminationZ ensures that no value is present for TerminationZ, not even an explicit nil +func (o *Circuit) UnsetTerminationZ() { + o.TerminationZ.Unset() +} // GetComments returns the Comments field value if set, zero value otherwise. func (o *Circuit) GetComments() string { @@ -683,18 +709,16 @@ func (o *Circuit) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Circuit) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Circuit) GetCreatedOk() (*time.Time, bool) { @@ -704,24 +728,39 @@ func (o *Circuit) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Circuit) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Circuit) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Circuit) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Circuit) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Circuit) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Circuit) GetLastUpdatedOk() (*time.Time, bool) { @@ -731,11 +770,28 @@ func (o *Circuit) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Circuit) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Circuit) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Circuit) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Circuit) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetAssignments returns the Assignments field value if set, zero value otherwise. func (o *Circuit) GetAssignments() []BriefCircuitGroupAssignmentSerializer { @@ -809,8 +865,12 @@ func (o Circuit) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["termination_a"] = o.TerminationA.Get() - toSerialize["termination_z"] = o.TerminationZ.Get() + if o.TerminationA.IsSet() { + toSerialize["termination_a"] = o.TerminationA.Get() + } + if o.TerminationZ.IsSet() { + toSerialize["termination_z"] = o.TerminationZ.Get() + } if !IsNil(o.Comments) { toSerialize["comments"] = o.Comments } @@ -820,8 +880,12 @@ func (o Circuit) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } if !IsNil(o.Assignments) { toSerialize["assignments"] = o.Assignments } @@ -844,10 +908,6 @@ func (o *Circuit) UnmarshalJSON(data []byte) (err error) { "cid", "provider", "type", - "termination_a", - "termination_z", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_circuit_circuit_termination.go b/netbox/model_circuit_circuit_termination.go index 8caba773f..e4e7da517 100644 --- a/netbox/model_circuit_circuit_termination.go +++ b/netbox/model_circuit_circuit_termination.go @@ -24,8 +24,8 @@ type CircuitCircuitTermination struct { Url string `json:"url"` DisplayUrl *string `json:"display_url,omitempty"` Display string `json:"display"` - Site NullableBriefSite `json:"site"` - ProviderNetwork NullableBriefProviderNetwork `json:"provider_network"` + Site NullableBriefSite `json:"site,omitempty"` + ProviderNetwork NullableBriefProviderNetwork `json:"provider_network,omitempty"` // Physical circuit speed PortSpeed NullableInt32 `json:"port_speed,omitempty"` // Upstream speed, if different from port speed @@ -42,13 +42,11 @@ type _CircuitCircuitTermination CircuitCircuitTermination // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCircuitCircuitTermination(id int32, url string, display string, site NullableBriefSite, providerNetwork NullableBriefProviderNetwork) *CircuitCircuitTermination { +func NewCircuitCircuitTermination(id int32, url string, display string) *CircuitCircuitTermination { this := CircuitCircuitTermination{} this.Id = id this.Url = url this.Display = display - this.Site = site - this.ProviderNetwork = providerNetwork return &this } @@ -167,18 +165,16 @@ func (o *CircuitCircuitTermination) SetDisplay(v string) { } -// GetSite returns the Site field value -// If the value is explicit nil, the zero value for BriefSite will be returned +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CircuitCircuitTermination) GetSite() BriefSite { - if o == nil || o.Site.Get() == nil { + if o == nil || IsNil(o.Site.Get()) { var ret BriefSite return ret } - return *o.Site.Get() } -// GetSiteOk returns a tuple with the Site field value +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CircuitCircuitTermination) GetSiteOk() (*BriefSite, bool) { @@ -188,24 +184,39 @@ func (o *CircuitCircuitTermination) GetSiteOk() (*BriefSite, bool) { return o.Site.Get(), o.Site.IsSet() } -// SetSite sets field value +// HasSite returns a boolean if a field has been set. +func (o *CircuitCircuitTermination) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableBriefSite and assigns it to the Site field. func (o *CircuitCircuitTermination) SetSite(v BriefSite) { o.Site.Set(&v) } +// SetSiteNil sets the value for Site to be an explicit nil +func (o *CircuitCircuitTermination) SetSiteNil() { + o.Site.Set(nil) +} +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *CircuitCircuitTermination) UnsetSite() { + o.Site.Unset() +} -// GetProviderNetwork returns the ProviderNetwork field value -// If the value is explicit nil, the zero value for BriefProviderNetwork will be returned +// GetProviderNetwork returns the ProviderNetwork field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CircuitCircuitTermination) GetProviderNetwork() BriefProviderNetwork { - if o == nil || o.ProviderNetwork.Get() == nil { + if o == nil || IsNil(o.ProviderNetwork.Get()) { var ret BriefProviderNetwork return ret } - return *o.ProviderNetwork.Get() } -// GetProviderNetworkOk returns a tuple with the ProviderNetwork field value +// GetProviderNetworkOk returns a tuple with the ProviderNetwork field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CircuitCircuitTermination) GetProviderNetworkOk() (*BriefProviderNetwork, bool) { @@ -215,11 +226,28 @@ func (o *CircuitCircuitTermination) GetProviderNetworkOk() (*BriefProviderNetwor return o.ProviderNetwork.Get(), o.ProviderNetwork.IsSet() } -// SetProviderNetwork sets field value +// HasProviderNetwork returns a boolean if a field has been set. +func (o *CircuitCircuitTermination) HasProviderNetwork() bool { + if o != nil && o.ProviderNetwork.IsSet() { + return true + } + + return false +} + +// SetProviderNetwork gets a reference to the given NullableBriefProviderNetwork and assigns it to the ProviderNetwork field. func (o *CircuitCircuitTermination) SetProviderNetwork(v BriefProviderNetwork) { o.ProviderNetwork.Set(&v) } +// SetProviderNetworkNil sets the value for ProviderNetwork to be an explicit nil +func (o *CircuitCircuitTermination) SetProviderNetworkNil() { + o.ProviderNetwork.Set(nil) +} +// UnsetProviderNetwork ensures that no value is present for ProviderNetwork, not even an explicit nil +func (o *CircuitCircuitTermination) UnsetProviderNetwork() { + o.ProviderNetwork.Unset() +} // GetPortSpeed returns the PortSpeed field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CircuitCircuitTermination) GetPortSpeed() int32 { @@ -385,8 +413,12 @@ func (o CircuitCircuitTermination) ToMap() (map[string]interface{}, error) { toSerialize["display_url"] = o.DisplayUrl } toSerialize["display"] = o.Display - toSerialize["site"] = o.Site.Get() - toSerialize["provider_network"] = o.ProviderNetwork.Get() + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if o.ProviderNetwork.IsSet() { + toSerialize["provider_network"] = o.ProviderNetwork.Get() + } if o.PortSpeed.IsSet() { toSerialize["port_speed"] = o.PortSpeed.Get() } @@ -415,8 +447,6 @@ func (o *CircuitCircuitTermination) UnmarshalJSON(data []byte) (err error) { "id", "url", "display", - "site", - "provider_network", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_circuit_circuit_termination_request.go b/netbox/model_circuit_circuit_termination_request.go index c575fb086..14ffd5679 100644 --- a/netbox/model_circuit_circuit_termination_request.go +++ b/netbox/model_circuit_circuit_termination_request.go @@ -12,7 +12,6 @@ package netbox import ( "encoding/json" - "fmt" ) // checks if the CircuitCircuitTerminationRequest type satisfies the MappedNullable interface at compile time @@ -20,8 +19,8 @@ var _ MappedNullable = &CircuitCircuitTerminationRequest{} // CircuitCircuitTerminationRequest Represents an object related through a ForeignKey field. On write, it accepts a primary key (PK) value or a dictionary of attributes which can be used to uniquely identify the related object. This class should be subclassed to return a full representation of the related object on read. type CircuitCircuitTerminationRequest struct { - Site NullableBriefSiteRequest `json:"site"` - ProviderNetwork NullableBriefProviderNetworkRequest `json:"provider_network"` + Site NullableBriefSiteRequest `json:"site,omitempty"` + ProviderNetwork NullableBriefProviderNetworkRequest `json:"provider_network,omitempty"` // Physical circuit speed PortSpeed NullableInt32 `json:"port_speed,omitempty"` // Upstream speed, if different from port speed @@ -38,10 +37,8 @@ type _CircuitCircuitTerminationRequest CircuitCircuitTerminationRequest // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCircuitCircuitTerminationRequest(site NullableBriefSiteRequest, providerNetwork NullableBriefProviderNetworkRequest) *CircuitCircuitTerminationRequest { +func NewCircuitCircuitTerminationRequest() *CircuitCircuitTerminationRequest { this := CircuitCircuitTerminationRequest{} - this.Site = site - this.ProviderNetwork = providerNetwork return &this } @@ -53,18 +50,16 @@ func NewCircuitCircuitTerminationRequestWithDefaults() *CircuitCircuitTerminatio return &this } -// GetSite returns the Site field value -// If the value is explicit nil, the zero value for BriefSiteRequest will be returned +// GetSite returns the Site field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CircuitCircuitTerminationRequest) GetSite() BriefSiteRequest { - if o == nil || o.Site.Get() == nil { + if o == nil || IsNil(o.Site.Get()) { var ret BriefSiteRequest return ret } - return *o.Site.Get() } -// GetSiteOk returns a tuple with the Site field value +// GetSiteOk returns a tuple with the Site field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CircuitCircuitTerminationRequest) GetSiteOk() (*BriefSiteRequest, bool) { @@ -74,24 +69,39 @@ func (o *CircuitCircuitTerminationRequest) GetSiteOk() (*BriefSiteRequest, bool) return o.Site.Get(), o.Site.IsSet() } -// SetSite sets field value +// HasSite returns a boolean if a field has been set. +func (o *CircuitCircuitTerminationRequest) HasSite() bool { + if o != nil && o.Site.IsSet() { + return true + } + + return false +} + +// SetSite gets a reference to the given NullableBriefSiteRequest and assigns it to the Site field. func (o *CircuitCircuitTerminationRequest) SetSite(v BriefSiteRequest) { o.Site.Set(&v) } +// SetSiteNil sets the value for Site to be an explicit nil +func (o *CircuitCircuitTerminationRequest) SetSiteNil() { + o.Site.Set(nil) +} +// UnsetSite ensures that no value is present for Site, not even an explicit nil +func (o *CircuitCircuitTerminationRequest) UnsetSite() { + o.Site.Unset() +} -// GetProviderNetwork returns the ProviderNetwork field value -// If the value is explicit nil, the zero value for BriefProviderNetworkRequest will be returned +// GetProviderNetwork returns the ProviderNetwork field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CircuitCircuitTerminationRequest) GetProviderNetwork() BriefProviderNetworkRequest { - if o == nil || o.ProviderNetwork.Get() == nil { + if o == nil || IsNil(o.ProviderNetwork.Get()) { var ret BriefProviderNetworkRequest return ret } - return *o.ProviderNetwork.Get() } -// GetProviderNetworkOk returns a tuple with the ProviderNetwork field value +// GetProviderNetworkOk returns a tuple with the ProviderNetwork field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CircuitCircuitTerminationRequest) GetProviderNetworkOk() (*BriefProviderNetworkRequest, bool) { @@ -101,11 +111,28 @@ func (o *CircuitCircuitTerminationRequest) GetProviderNetworkOk() (*BriefProvide return o.ProviderNetwork.Get(), o.ProviderNetwork.IsSet() } -// SetProviderNetwork sets field value +// HasProviderNetwork returns a boolean if a field has been set. +func (o *CircuitCircuitTerminationRequest) HasProviderNetwork() bool { + if o != nil && o.ProviderNetwork.IsSet() { + return true + } + + return false +} + +// SetProviderNetwork gets a reference to the given NullableBriefProviderNetworkRequest and assigns it to the ProviderNetwork field. func (o *CircuitCircuitTerminationRequest) SetProviderNetwork(v BriefProviderNetworkRequest) { o.ProviderNetwork.Set(&v) } +// SetProviderNetworkNil sets the value for ProviderNetwork to be an explicit nil +func (o *CircuitCircuitTerminationRequest) SetProviderNetworkNil() { + o.ProviderNetwork.Set(nil) +} +// UnsetProviderNetwork ensures that no value is present for ProviderNetwork, not even an explicit nil +func (o *CircuitCircuitTerminationRequest) UnsetProviderNetwork() { + o.ProviderNetwork.Unset() +} // GetPortSpeed returns the PortSpeed field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CircuitCircuitTerminationRequest) GetPortSpeed() int32 { @@ -265,8 +292,12 @@ func (o CircuitCircuitTerminationRequest) MarshalJSON() ([]byte, error) { func (o CircuitCircuitTerminationRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - toSerialize["site"] = o.Site.Get() - toSerialize["provider_network"] = o.ProviderNetwork.Get() + if o.Site.IsSet() { + toSerialize["site"] = o.Site.Get() + } + if o.ProviderNetwork.IsSet() { + toSerialize["provider_network"] = o.ProviderNetwork.Get() + } if o.PortSpeed.IsSet() { toSerialize["port_speed"] = o.PortSpeed.Get() } @@ -288,45 +319,6 @@ func (o CircuitCircuitTerminationRequest) ToMap() (map[string]interface{}, error } func (o *CircuitCircuitTerminationRequest) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "site", - "provider_network", - } - - // defaultValueFuncMap captures the default values for required properties. - // These values are used when required properties are missing from the payload. - defaultValueFuncMap := map[string]func() interface{} { - } - var defaultValueApplied bool - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err; - } - - for _, requiredProperty := range(requiredProperties) { - if value, exists := allProperties[requiredProperty]; !exists || value == "" { - if _, ok := defaultValueFuncMap[requiredProperty]; ok { - allProperties[requiredProperty] = defaultValueFuncMap[requiredProperty]() - defaultValueApplied = true - } - } - if value, exists := allProperties[requiredProperty]; !exists || value == ""{ - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - if defaultValueApplied { - data, err = json.Marshal(allProperties) - if err != nil{ - return err - } - } varCircuitCircuitTerminationRequest := _CircuitCircuitTerminationRequest{} err = json.Unmarshal(data, &varCircuitCircuitTerminationRequest) diff --git a/netbox/model_circuit_group.go b/netbox/model_circuit_group.go index 106d96b1c..058a9133b 100644 --- a/netbox/model_circuit_group.go +++ b/netbox/model_circuit_group.go @@ -31,8 +31,8 @@ type CircuitGroup struct { Tenant NullableBriefTenant `json:"tenant,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` CircuitCount int64 `json:"circuit_count"` AdditionalProperties map[string]interface{} } @@ -43,15 +43,13 @@ type _CircuitGroup CircuitGroup // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCircuitGroup(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, circuitCount int64) *CircuitGroup { +func NewCircuitGroup(id int32, url string, display string, name string, slug string, circuitCount int64) *CircuitGroup { this := CircuitGroup{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated this.CircuitCount = circuitCount return &this } @@ -359,18 +357,16 @@ func (o *CircuitGroup) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CircuitGroup) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CircuitGroup) GetCreatedOk() (*time.Time, bool) { @@ -380,24 +376,39 @@ func (o *CircuitGroup) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *CircuitGroup) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *CircuitGroup) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *CircuitGroup) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *CircuitGroup) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CircuitGroup) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CircuitGroup) GetLastUpdatedOk() (*time.Time, bool) { @@ -407,11 +418,28 @@ func (o *CircuitGroup) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *CircuitGroup) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *CircuitGroup) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *CircuitGroup) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *CircuitGroup) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetCircuitCount returns the CircuitCount field value func (o *CircuitGroup) GetCircuitCount() int64 { @@ -468,8 +496,12 @@ func (o CircuitGroup) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["circuit_count"] = o.CircuitCount for key, value := range o.AdditionalProperties { @@ -489,8 +521,6 @@ func (o *CircuitGroup) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", "circuit_count", } diff --git a/netbox/model_circuit_group_assignment.go b/netbox/model_circuit_group_assignment.go index 22b052e71..64f1f0400 100644 --- a/netbox/model_circuit_group_assignment.go +++ b/netbox/model_circuit_group_assignment.go @@ -29,8 +29,8 @@ type CircuitGroupAssignment struct { Circuit BriefCircuit `json:"circuit"` Priority *BriefCircuitGroupAssignmentSerializerPriority `json:"priority,omitempty"` Tags []NestedTag `json:"tags,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -40,15 +40,13 @@ type _CircuitGroupAssignment CircuitGroupAssignment // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCircuitGroupAssignment(id int32, url string, display string, group BriefCircuitGroup, circuit BriefCircuit, created NullableTime, lastUpdated NullableTime) *CircuitGroupAssignment { +func NewCircuitGroupAssignment(id int32, url string, display string, group BriefCircuitGroup, circuit BriefCircuit) *CircuitGroupAssignment { this := CircuitGroupAssignment{} this.Id = id this.Url = url this.Display = display this.Group = group this.Circuit = circuit - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -281,18 +279,16 @@ func (o *CircuitGroupAssignment) SetTags(v []NestedTag) { o.Tags = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CircuitGroupAssignment) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CircuitGroupAssignment) GetCreatedOk() (*time.Time, bool) { @@ -302,24 +298,39 @@ func (o *CircuitGroupAssignment) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *CircuitGroupAssignment) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *CircuitGroupAssignment) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *CircuitGroupAssignment) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *CircuitGroupAssignment) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CircuitGroupAssignment) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CircuitGroupAssignment) GetLastUpdatedOk() (*time.Time, bool) { @@ -329,11 +340,28 @@ func (o *CircuitGroupAssignment) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *CircuitGroupAssignment) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *CircuitGroupAssignment) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *CircuitGroupAssignment) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *CircuitGroupAssignment) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o CircuitGroupAssignment) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -359,8 +387,12 @@ func (o CircuitGroupAssignment) ToMap() (map[string]interface{}, error) { if !IsNil(o.Tags) { toSerialize["tags"] = o.Tags } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -379,8 +411,6 @@ func (o *CircuitGroupAssignment) UnmarshalJSON(data []byte) (err error) { "display", "group", "circuit", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_circuit_termination.go b/netbox/model_circuit_termination.go index 2aa05f649..679427959 100644 --- a/netbox/model_circuit_termination.go +++ b/netbox/model_circuit_termination.go @@ -40,15 +40,15 @@ type CircuitTermination struct { Description *string `json:"description,omitempty"` // Treat as if a cable is connected MarkConnected *bool `json:"mark_connected,omitempty"` - Cable NullableBriefCable `json:"cable"` + Cable NullableBriefCable `json:"cable,omitempty"` CableEnd string `json:"cable_end"` LinkPeers []interface{} `json:"link_peers"` // Return the type of the peer link terminations, or None. - LinkPeersType NullableString `json:"link_peers_type"` + LinkPeersType NullableString `json:"link_peers_type,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` Occupied bool `json:"_occupied"` AdditionalProperties map[string]interface{} } @@ -59,19 +59,15 @@ type _CircuitTermination CircuitTermination // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCircuitTermination(id int32, url string, display string, circuit BriefCircuit, termSide Termination1, cable NullableBriefCable, cableEnd string, linkPeers []interface{}, linkPeersType NullableString, created NullableTime, lastUpdated NullableTime, occupied bool) *CircuitTermination { +func NewCircuitTermination(id int32, url string, display string, circuit BriefCircuit, termSide Termination1, cableEnd string, linkPeers []interface{}, occupied bool) *CircuitTermination { this := CircuitTermination{} this.Id = id this.Url = url this.Display = display this.Circuit = circuit this.TermSide = termSide - this.Cable = cable this.CableEnd = cableEnd this.LinkPeers = linkPeers - this.LinkPeersType = linkPeersType - this.Created = created - this.LastUpdated = lastUpdated this.Occupied = occupied return &this } @@ -537,18 +533,16 @@ func (o *CircuitTermination) SetMarkConnected(v bool) { o.MarkConnected = &v } -// GetCable returns the Cable field value -// If the value is explicit nil, the zero value for BriefCable will be returned +// GetCable returns the Cable field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CircuitTermination) GetCable() BriefCable { - if o == nil || o.Cable.Get() == nil { + if o == nil || IsNil(o.Cable.Get()) { var ret BriefCable return ret } - return *o.Cable.Get() } -// GetCableOk returns a tuple with the Cable field value +// GetCableOk returns a tuple with the Cable field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CircuitTermination) GetCableOk() (*BriefCable, bool) { @@ -558,11 +552,28 @@ func (o *CircuitTermination) GetCableOk() (*BriefCable, bool) { return o.Cable.Get(), o.Cable.IsSet() } -// SetCable sets field value +// HasCable returns a boolean if a field has been set. +func (o *CircuitTermination) HasCable() bool { + if o != nil && o.Cable.IsSet() { + return true + } + + return false +} + +// SetCable gets a reference to the given NullableBriefCable and assigns it to the Cable field. func (o *CircuitTermination) SetCable(v BriefCable) { o.Cable.Set(&v) } +// SetCableNil sets the value for Cable to be an explicit nil +func (o *CircuitTermination) SetCableNil() { + o.Cable.Set(nil) +} +// UnsetCable ensures that no value is present for Cable, not even an explicit nil +func (o *CircuitTermination) UnsetCable() { + o.Cable.Unset() +} // GetCableEnd returns the CableEnd field value func (o *CircuitTermination) GetCableEnd() string { @@ -614,18 +625,16 @@ func (o *CircuitTermination) SetLinkPeers(v []interface{}) { } -// GetLinkPeersType returns the LinkPeersType field value -// If the value is explicit nil, the zero value for string will be returned +// GetLinkPeersType returns the LinkPeersType field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CircuitTermination) GetLinkPeersType() string { - if o == nil || o.LinkPeersType.Get() == nil { + if o == nil || IsNil(o.LinkPeersType.Get()) { var ret string return ret } - return *o.LinkPeersType.Get() } -// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value +// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CircuitTermination) GetLinkPeersTypeOk() (*string, bool) { @@ -635,11 +644,28 @@ func (o *CircuitTermination) GetLinkPeersTypeOk() (*string, bool) { return o.LinkPeersType.Get(), o.LinkPeersType.IsSet() } -// SetLinkPeersType sets field value +// HasLinkPeersType returns a boolean if a field has been set. +func (o *CircuitTermination) HasLinkPeersType() bool { + if o != nil && o.LinkPeersType.IsSet() { + return true + } + + return false +} + +// SetLinkPeersType gets a reference to the given NullableString and assigns it to the LinkPeersType field. func (o *CircuitTermination) SetLinkPeersType(v string) { o.LinkPeersType.Set(&v) } +// SetLinkPeersTypeNil sets the value for LinkPeersType to be an explicit nil +func (o *CircuitTermination) SetLinkPeersTypeNil() { + o.LinkPeersType.Set(nil) +} +// UnsetLinkPeersType ensures that no value is present for LinkPeersType, not even an explicit nil +func (o *CircuitTermination) UnsetLinkPeersType() { + o.LinkPeersType.Unset() +} // GetTags returns the Tags field value if set, zero value otherwise. func (o *CircuitTermination) GetTags() []NestedTag { @@ -705,18 +731,16 @@ func (o *CircuitTermination) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CircuitTermination) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CircuitTermination) GetCreatedOk() (*time.Time, bool) { @@ -726,24 +750,39 @@ func (o *CircuitTermination) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *CircuitTermination) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *CircuitTermination) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *CircuitTermination) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *CircuitTermination) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CircuitTermination) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CircuitTermination) GetLastUpdatedOk() (*time.Time, bool) { @@ -753,11 +792,28 @@ func (o *CircuitTermination) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *CircuitTermination) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *CircuitTermination) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *CircuitTermination) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *CircuitTermination) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetOccupied returns the Occupied field value func (o *CircuitTermination) GetOccupied() bool { @@ -826,18 +882,26 @@ func (o CircuitTermination) ToMap() (map[string]interface{}, error) { if !IsNil(o.MarkConnected) { toSerialize["mark_connected"] = o.MarkConnected } - toSerialize["cable"] = o.Cable.Get() + if o.Cable.IsSet() { + toSerialize["cable"] = o.Cable.Get() + } toSerialize["cable_end"] = o.CableEnd toSerialize["link_peers"] = o.LinkPeers - toSerialize["link_peers_type"] = o.LinkPeersType.Get() + if o.LinkPeersType.IsSet() { + toSerialize["link_peers_type"] = o.LinkPeersType.Get() + } if !IsNil(o.Tags) { toSerialize["tags"] = o.Tags } if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["_occupied"] = o.Occupied for key, value := range o.AdditionalProperties { @@ -857,12 +921,8 @@ func (o *CircuitTermination) UnmarshalJSON(data []byte) (err error) { "display", "circuit", "term_side", - "cable", "cable_end", "link_peers", - "link_peers_type", - "created", - "last_updated", "_occupied", } diff --git a/netbox/model_circuit_type.go b/netbox/model_circuit_type.go index ac30fb328..473cfe4de 100644 --- a/netbox/model_circuit_type.go +++ b/netbox/model_circuit_type.go @@ -31,8 +31,8 @@ type CircuitType struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` CircuitCount int64 `json:"circuit_count"` AdditionalProperties map[string]interface{} } @@ -43,15 +43,13 @@ type _CircuitType CircuitType // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCircuitType(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, circuitCount int64) *CircuitType { +func NewCircuitType(id int32, url string, display string, name string, slug string, circuitCount int64) *CircuitType { this := CircuitType{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated this.CircuitCount = circuitCount return &this } @@ -349,18 +347,16 @@ func (o *CircuitType) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CircuitType) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CircuitType) GetCreatedOk() (*time.Time, bool) { @@ -370,24 +366,39 @@ func (o *CircuitType) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *CircuitType) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *CircuitType) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *CircuitType) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *CircuitType) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CircuitType) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CircuitType) GetLastUpdatedOk() (*time.Time, bool) { @@ -397,11 +408,28 @@ func (o *CircuitType) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *CircuitType) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *CircuitType) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *CircuitType) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *CircuitType) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetCircuitCount returns the CircuitCount field value func (o *CircuitType) GetCircuitCount() int64 { @@ -458,8 +486,12 @@ func (o CircuitType) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["circuit_count"] = o.CircuitCount for key, value := range o.AdditionalProperties { @@ -479,8 +511,6 @@ func (o *CircuitType) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", "circuit_count", } diff --git a/netbox/model_cluster.go b/netbox/model_cluster.go index f4f5d9e0a..316b0d115 100644 --- a/netbox/model_cluster.go +++ b/netbox/model_cluster.go @@ -35,8 +35,8 @@ type Cluster struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` DeviceCount *int64 `json:"device_count,omitempty"` VirtualmachineCount *int64 `json:"virtualmachine_count,omitempty"` AdditionalProperties map[string]interface{} @@ -48,15 +48,13 @@ type _Cluster Cluster // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCluster(id int32, url string, display string, name string, type_ BriefClusterType, created NullableTime, lastUpdated NullableTime) *Cluster { +func NewCluster(id int32, url string, display string, name string, type_ BriefClusterType) *Cluster { this := Cluster{} this.Id = id this.Url = url this.Display = display this.Name = name this.Type = type_ - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -511,18 +509,16 @@ func (o *Cluster) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Cluster) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Cluster) GetCreatedOk() (*time.Time, bool) { @@ -532,24 +528,39 @@ func (o *Cluster) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Cluster) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Cluster) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Cluster) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Cluster) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Cluster) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Cluster) GetLastUpdatedOk() (*time.Time, bool) { @@ -559,11 +570,28 @@ func (o *Cluster) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Cluster) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Cluster) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Cluster) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Cluster) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetDeviceCount returns the DeviceCount field value if set, zero value otherwise. func (o *Cluster) GetDeviceCount() int64 { @@ -671,8 +699,12 @@ func (o Cluster) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } if !IsNil(o.DeviceCount) { toSerialize["device_count"] = o.DeviceCount } @@ -697,8 +729,6 @@ func (o *Cluster) UnmarshalJSON(data []byte) (err error) { "display", "name", "type", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_cluster_group.go b/netbox/model_cluster_group.go index a44555d44..0611d32f3 100644 --- a/netbox/model_cluster_group.go +++ b/netbox/model_cluster_group.go @@ -30,8 +30,8 @@ type ClusterGroup struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` ClusterCount *int64 `json:"cluster_count,omitempty"` AdditionalProperties map[string]interface{} } @@ -42,15 +42,13 @@ type _ClusterGroup ClusterGroup // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewClusterGroup(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime) *ClusterGroup { +func NewClusterGroup(id int32, url string, display string, name string, slug string) *ClusterGroup { this := ClusterGroup{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -315,18 +313,16 @@ func (o *ClusterGroup) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ClusterGroup) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ClusterGroup) GetCreatedOk() (*time.Time, bool) { @@ -336,24 +332,39 @@ func (o *ClusterGroup) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ClusterGroup) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ClusterGroup) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ClusterGroup) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ClusterGroup) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ClusterGroup) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ClusterGroup) GetLastUpdatedOk() (*time.Time, bool) { @@ -363,11 +374,28 @@ func (o *ClusterGroup) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ClusterGroup) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ClusterGroup) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ClusterGroup) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ClusterGroup) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetClusterCount returns the ClusterCount field value if set, zero value otherwise. func (o *ClusterGroup) GetClusterCount() int64 { @@ -428,8 +456,12 @@ func (o ClusterGroup) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } if !IsNil(o.ClusterCount) { toSerialize["cluster_count"] = o.ClusterCount } @@ -451,8 +483,6 @@ func (o *ClusterGroup) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_cluster_type.go b/netbox/model_cluster_type.go index 3c78cdea7..6d6cf5963 100644 --- a/netbox/model_cluster_type.go +++ b/netbox/model_cluster_type.go @@ -30,8 +30,8 @@ type ClusterType struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` ClusterCount *int64 `json:"cluster_count,omitempty"` AdditionalProperties map[string]interface{} } @@ -42,15 +42,13 @@ type _ClusterType ClusterType // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewClusterType(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime) *ClusterType { +func NewClusterType(id int32, url string, display string, name string, slug string) *ClusterType { this := ClusterType{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -315,18 +313,16 @@ func (o *ClusterType) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ClusterType) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ClusterType) GetCreatedOk() (*time.Time, bool) { @@ -336,24 +332,39 @@ func (o *ClusterType) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ClusterType) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ClusterType) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ClusterType) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ClusterType) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ClusterType) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ClusterType) GetLastUpdatedOk() (*time.Time, bool) { @@ -363,11 +374,28 @@ func (o *ClusterType) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ClusterType) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ClusterType) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ClusterType) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ClusterType) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetClusterCount returns the ClusterCount field value if set, zero value otherwise. func (o *ClusterType) GetClusterCount() int64 { @@ -428,8 +456,12 @@ func (o ClusterType) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } if !IsNil(o.ClusterCount) { toSerialize["cluster_count"] = o.ClusterCount } @@ -451,8 +483,6 @@ func (o *ClusterType) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_config_context.go b/netbox/model_config_context.go index 864adc235..711def546 100644 --- a/netbox/model_config_context.go +++ b/netbox/model_config_context.go @@ -46,10 +46,10 @@ type ConfigContext struct { // Path to remote file (relative to data source root) DataPath string `json:"data_path"` DataFile BriefDataFile `json:"data_file"` - DataSynced NullableTime `json:"data_synced"` + DataSynced NullableTime `json:"data_synced,omitempty"` Data interface{} `json:"data"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -59,7 +59,7 @@ type _ConfigContext ConfigContext // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewConfigContext(id int32, url string, display string, name string, dataPath string, dataFile BriefDataFile, dataSynced NullableTime, data interface{}, created NullableTime, lastUpdated NullableTime) *ConfigContext { +func NewConfigContext(id int32, url string, display string, name string, dataPath string, dataFile BriefDataFile, data interface{}) *ConfigContext { this := ConfigContext{} this.Id = id this.Url = url @@ -67,10 +67,7 @@ func NewConfigContext(id int32, url string, display string, name string, dataPat this.Name = name this.DataPath = dataPath this.DataFile = dataFile - this.DataSynced = dataSynced this.Data = data - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -808,18 +805,16 @@ func (o *ConfigContext) SetDataFile(v BriefDataFile) { } -// GetDataSynced returns the DataSynced field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetDataSynced returns the DataSynced field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConfigContext) GetDataSynced() time.Time { - if o == nil || o.DataSynced.Get() == nil { + if o == nil || IsNil(o.DataSynced.Get()) { var ret time.Time return ret } - return *o.DataSynced.Get() } -// GetDataSyncedOk returns a tuple with the DataSynced field value +// GetDataSyncedOk returns a tuple with the DataSynced field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConfigContext) GetDataSyncedOk() (*time.Time, bool) { @@ -829,11 +824,28 @@ func (o *ConfigContext) GetDataSyncedOk() (*time.Time, bool) { return o.DataSynced.Get(), o.DataSynced.IsSet() } -// SetDataSynced sets field value +// HasDataSynced returns a boolean if a field has been set. +func (o *ConfigContext) HasDataSynced() bool { + if o != nil && o.DataSynced.IsSet() { + return true + } + + return false +} + +// SetDataSynced gets a reference to the given NullableTime and assigns it to the DataSynced field. func (o *ConfigContext) SetDataSynced(v time.Time) { o.DataSynced.Set(&v) } +// SetDataSyncedNil sets the value for DataSynced to be an explicit nil +func (o *ConfigContext) SetDataSyncedNil() { + o.DataSynced.Set(nil) +} +// UnsetDataSynced ensures that no value is present for DataSynced, not even an explicit nil +func (o *ConfigContext) UnsetDataSynced() { + o.DataSynced.Unset() +} // GetData returns the Data field value // If the value is explicit nil, the zero value for interface{} will be returned @@ -862,18 +874,16 @@ func (o *ConfigContext) SetData(v interface{}) { } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConfigContext) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConfigContext) GetCreatedOk() (*time.Time, bool) { @@ -883,24 +893,39 @@ func (o *ConfigContext) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ConfigContext) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ConfigContext) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ConfigContext) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ConfigContext) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConfigContext) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConfigContext) GetLastUpdatedOk() (*time.Time, bool) { @@ -910,11 +935,28 @@ func (o *ConfigContext) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ConfigContext) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ConfigContext) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ConfigContext) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ConfigContext) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o ConfigContext) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -986,12 +1028,18 @@ func (o ConfigContext) ToMap() (map[string]interface{}, error) { } toSerialize["data_path"] = o.DataPath toSerialize["data_file"] = o.DataFile - toSerialize["data_synced"] = o.DataSynced.Get() + if o.DataSynced.IsSet() { + toSerialize["data_synced"] = o.DataSynced.Get() + } if o.Data != nil { toSerialize["data"] = o.Data } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -1011,10 +1059,7 @@ func (o *ConfigContext) UnmarshalJSON(data []byte) (err error) { "name", "data_path", "data_file", - "data_synced", "data", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_config_template.go b/netbox/model_config_template.go index 1561c5425..0adfe7890 100644 --- a/netbox/model_config_template.go +++ b/netbox/model_config_template.go @@ -35,10 +35,10 @@ type ConfigTemplate struct { // Path to remote file (relative to data source root) DataPath string `json:"data_path"` DataFile *BriefDataFile `json:"data_file,omitempty"` - DataSynced NullableTime `json:"data_synced"` + DataSynced NullableTime `json:"data_synced,omitempty"` Tags []NestedTag `json:"tags,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -48,7 +48,7 @@ type _ConfigTemplate ConfigTemplate // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewConfigTemplate(id int32, url string, display string, name string, templateCode string, dataPath string, dataSynced NullableTime, created NullableTime, lastUpdated NullableTime) *ConfigTemplate { +func NewConfigTemplate(id int32, url string, display string, name string, templateCode string, dataPath string) *ConfigTemplate { this := ConfigTemplate{} this.Id = id this.Url = url @@ -56,9 +56,6 @@ func NewConfigTemplate(id int32, url string, display string, name string, templa this.Name = name this.TemplateCode = templateCode this.DataPath = dataPath - this.DataSynced = dataSynced - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -381,18 +378,16 @@ func (o *ConfigTemplate) SetDataFile(v BriefDataFile) { o.DataFile = &v } -// GetDataSynced returns the DataSynced field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetDataSynced returns the DataSynced field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConfigTemplate) GetDataSynced() time.Time { - if o == nil || o.DataSynced.Get() == nil { + if o == nil || IsNil(o.DataSynced.Get()) { var ret time.Time return ret } - return *o.DataSynced.Get() } -// GetDataSyncedOk returns a tuple with the DataSynced field value +// GetDataSyncedOk returns a tuple with the DataSynced field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConfigTemplate) GetDataSyncedOk() (*time.Time, bool) { @@ -402,11 +397,28 @@ func (o *ConfigTemplate) GetDataSyncedOk() (*time.Time, bool) { return o.DataSynced.Get(), o.DataSynced.IsSet() } -// SetDataSynced sets field value +// HasDataSynced returns a boolean if a field has been set. +func (o *ConfigTemplate) HasDataSynced() bool { + if o != nil && o.DataSynced.IsSet() { + return true + } + + return false +} + +// SetDataSynced gets a reference to the given NullableTime and assigns it to the DataSynced field. func (o *ConfigTemplate) SetDataSynced(v time.Time) { o.DataSynced.Set(&v) } +// SetDataSyncedNil sets the value for DataSynced to be an explicit nil +func (o *ConfigTemplate) SetDataSyncedNil() { + o.DataSynced.Set(nil) +} +// UnsetDataSynced ensures that no value is present for DataSynced, not even an explicit nil +func (o *ConfigTemplate) UnsetDataSynced() { + o.DataSynced.Unset() +} // GetTags returns the Tags field value if set, zero value otherwise. func (o *ConfigTemplate) GetTags() []NestedTag { @@ -440,18 +452,16 @@ func (o *ConfigTemplate) SetTags(v []NestedTag) { o.Tags = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConfigTemplate) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConfigTemplate) GetCreatedOk() (*time.Time, bool) { @@ -461,24 +471,39 @@ func (o *ConfigTemplate) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ConfigTemplate) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ConfigTemplate) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ConfigTemplate) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ConfigTemplate) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConfigTemplate) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConfigTemplate) GetLastUpdatedOk() (*time.Time, bool) { @@ -488,11 +513,28 @@ func (o *ConfigTemplate) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ConfigTemplate) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ConfigTemplate) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ConfigTemplate) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ConfigTemplate) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o ConfigTemplate) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -525,12 +567,18 @@ func (o ConfigTemplate) ToMap() (map[string]interface{}, error) { if !IsNil(o.DataFile) { toSerialize["data_file"] = o.DataFile } - toSerialize["data_synced"] = o.DataSynced.Get() + if o.DataSynced.IsSet() { + toSerialize["data_synced"] = o.DataSynced.Get() + } if !IsNil(o.Tags) { toSerialize["tags"] = o.Tags } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -550,9 +598,6 @@ func (o *ConfigTemplate) UnmarshalJSON(data []byte) (err error) { "name", "template_code", "data_path", - "data_synced", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_console_port.go b/netbox/model_console_port.go index cd5c7ac92..2188267e2 100644 --- a/netbox/model_console_port.go +++ b/netbox/model_console_port.go @@ -35,18 +35,18 @@ type ConsolePort struct { Description *string `json:"description,omitempty"` // Treat as if a cable is connected MarkConnected *bool `json:"mark_connected,omitempty"` - Cable NullableBriefCable `json:"cable"` + Cable NullableBriefCable `json:"cable,omitempty"` CableEnd string `json:"cable_end"` LinkPeers []interface{} `json:"link_peers"` // Return the type of the peer link terminations, or None. - LinkPeersType NullableString `json:"link_peers_type"` - ConnectedEndpoints []interface{} `json:"connected_endpoints"` - ConnectedEndpointsType NullableString `json:"connected_endpoints_type"` + LinkPeersType NullableString `json:"link_peers_type,omitempty"` + ConnectedEndpoints []interface{} `json:"connected_endpoints,omitempty"` + ConnectedEndpointsType NullableString `json:"connected_endpoints_type,omitempty"` ConnectedEndpointsReachable bool `json:"connected_endpoints_reachable"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` Occupied bool `json:"_occupied"` AdditionalProperties map[string]interface{} } @@ -57,22 +57,16 @@ type _ConsolePort ConsolePort // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewConsolePort(id int32, url string, display string, device BriefDevice, name string, cable NullableBriefCable, cableEnd string, linkPeers []interface{}, linkPeersType NullableString, connectedEndpoints []interface{}, connectedEndpointsType NullableString, connectedEndpointsReachable bool, created NullableTime, lastUpdated NullableTime, occupied bool) *ConsolePort { +func NewConsolePort(id int32, url string, display string, device BriefDevice, name string, cableEnd string, linkPeers []interface{}, connectedEndpointsReachable bool, occupied bool) *ConsolePort { this := ConsolePort{} this.Id = id this.Url = url this.Display = display this.Device = device this.Name = name - this.Cable = cable this.CableEnd = cableEnd this.LinkPeers = linkPeers - this.LinkPeersType = linkPeersType - this.ConnectedEndpoints = connectedEndpoints - this.ConnectedEndpointsType = connectedEndpointsType this.ConnectedEndpointsReachable = connectedEndpointsReachable - this.Created = created - this.LastUpdated = lastUpdated this.Occupied = occupied return &this } @@ -454,18 +448,16 @@ func (o *ConsolePort) SetMarkConnected(v bool) { o.MarkConnected = &v } -// GetCable returns the Cable field value -// If the value is explicit nil, the zero value for BriefCable will be returned +// GetCable returns the Cable field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsolePort) GetCable() BriefCable { - if o == nil || o.Cable.Get() == nil { + if o == nil || IsNil(o.Cable.Get()) { var ret BriefCable return ret } - return *o.Cable.Get() } -// GetCableOk returns a tuple with the Cable field value +// GetCableOk returns a tuple with the Cable field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConsolePort) GetCableOk() (*BriefCable, bool) { @@ -475,11 +467,28 @@ func (o *ConsolePort) GetCableOk() (*BriefCable, bool) { return o.Cable.Get(), o.Cable.IsSet() } -// SetCable sets field value +// HasCable returns a boolean if a field has been set. +func (o *ConsolePort) HasCable() bool { + if o != nil && o.Cable.IsSet() { + return true + } + + return false +} + +// SetCable gets a reference to the given NullableBriefCable and assigns it to the Cable field. func (o *ConsolePort) SetCable(v BriefCable) { o.Cable.Set(&v) } +// SetCableNil sets the value for Cable to be an explicit nil +func (o *ConsolePort) SetCableNil() { + o.Cable.Set(nil) +} +// UnsetCable ensures that no value is present for Cable, not even an explicit nil +func (o *ConsolePort) UnsetCable() { + o.Cable.Unset() +} // GetCableEnd returns the CableEnd field value func (o *ConsolePort) GetCableEnd() string { @@ -531,18 +540,16 @@ func (o *ConsolePort) SetLinkPeers(v []interface{}) { } -// GetLinkPeersType returns the LinkPeersType field value -// If the value is explicit nil, the zero value for string will be returned +// GetLinkPeersType returns the LinkPeersType field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsolePort) GetLinkPeersType() string { - if o == nil || o.LinkPeersType.Get() == nil { + if o == nil || IsNil(o.LinkPeersType.Get()) { var ret string return ret } - return *o.LinkPeersType.Get() } -// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value +// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConsolePort) GetLinkPeersTypeOk() (*string, bool) { @@ -552,24 +559,39 @@ func (o *ConsolePort) GetLinkPeersTypeOk() (*string, bool) { return o.LinkPeersType.Get(), o.LinkPeersType.IsSet() } -// SetLinkPeersType sets field value +// HasLinkPeersType returns a boolean if a field has been set. +func (o *ConsolePort) HasLinkPeersType() bool { + if o != nil && o.LinkPeersType.IsSet() { + return true + } + + return false +} + +// SetLinkPeersType gets a reference to the given NullableString and assigns it to the LinkPeersType field. func (o *ConsolePort) SetLinkPeersType(v string) { o.LinkPeersType.Set(&v) } +// SetLinkPeersTypeNil sets the value for LinkPeersType to be an explicit nil +func (o *ConsolePort) SetLinkPeersTypeNil() { + o.LinkPeersType.Set(nil) +} +// UnsetLinkPeersType ensures that no value is present for LinkPeersType, not even an explicit nil +func (o *ConsolePort) UnsetLinkPeersType() { + o.LinkPeersType.Unset() +} -// GetConnectedEndpoints returns the ConnectedEndpoints field value -// If the value is explicit nil, the zero value for []interface{} will be returned +// GetConnectedEndpoints returns the ConnectedEndpoints field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsolePort) GetConnectedEndpoints() []interface{} { if o == nil { var ret []interface{} return ret } - return o.ConnectedEndpoints } -// GetConnectedEndpointsOk returns a tuple with the ConnectedEndpoints field value +// GetConnectedEndpointsOk returns a tuple with the ConnectedEndpoints field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConsolePort) GetConnectedEndpointsOk() ([]interface{}, bool) { @@ -579,24 +601,30 @@ func (o *ConsolePort) GetConnectedEndpointsOk() ([]interface{}, bool) { return o.ConnectedEndpoints, true } -// SetConnectedEndpoints sets field value +// HasConnectedEndpoints returns a boolean if a field has been set. +func (o *ConsolePort) HasConnectedEndpoints() bool { + if o != nil && !IsNil(o.ConnectedEndpoints) { + return true + } + + return false +} + +// SetConnectedEndpoints gets a reference to the given []interface{} and assigns it to the ConnectedEndpoints field. func (o *ConsolePort) SetConnectedEndpoints(v []interface{}) { o.ConnectedEndpoints = v } - -// GetConnectedEndpointsType returns the ConnectedEndpointsType field value -// If the value is explicit nil, the zero value for string will be returned +// GetConnectedEndpointsType returns the ConnectedEndpointsType field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsolePort) GetConnectedEndpointsType() string { - if o == nil || o.ConnectedEndpointsType.Get() == nil { + if o == nil || IsNil(o.ConnectedEndpointsType.Get()) { var ret string return ret } - return *o.ConnectedEndpointsType.Get() } -// GetConnectedEndpointsTypeOk returns a tuple with the ConnectedEndpointsType field value +// GetConnectedEndpointsTypeOk returns a tuple with the ConnectedEndpointsType field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConsolePort) GetConnectedEndpointsTypeOk() (*string, bool) { @@ -606,11 +634,28 @@ func (o *ConsolePort) GetConnectedEndpointsTypeOk() (*string, bool) { return o.ConnectedEndpointsType.Get(), o.ConnectedEndpointsType.IsSet() } -// SetConnectedEndpointsType sets field value +// HasConnectedEndpointsType returns a boolean if a field has been set. +func (o *ConsolePort) HasConnectedEndpointsType() bool { + if o != nil && o.ConnectedEndpointsType.IsSet() { + return true + } + + return false +} + +// SetConnectedEndpointsType gets a reference to the given NullableString and assigns it to the ConnectedEndpointsType field. func (o *ConsolePort) SetConnectedEndpointsType(v string) { o.ConnectedEndpointsType.Set(&v) } +// SetConnectedEndpointsTypeNil sets the value for ConnectedEndpointsType to be an explicit nil +func (o *ConsolePort) SetConnectedEndpointsTypeNil() { + o.ConnectedEndpointsType.Set(nil) +} +// UnsetConnectedEndpointsType ensures that no value is present for ConnectedEndpointsType, not even an explicit nil +func (o *ConsolePort) UnsetConnectedEndpointsType() { + o.ConnectedEndpointsType.Unset() +} // GetConnectedEndpointsReachable returns the ConnectedEndpointsReachable field value func (o *ConsolePort) GetConnectedEndpointsReachable() bool { @@ -701,18 +746,16 @@ func (o *ConsolePort) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsolePort) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConsolePort) GetCreatedOk() (*time.Time, bool) { @@ -722,24 +765,39 @@ func (o *ConsolePort) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ConsolePort) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ConsolePort) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ConsolePort) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ConsolePort) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsolePort) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConsolePort) GetLastUpdatedOk() (*time.Time, bool) { @@ -749,11 +807,28 @@ func (o *ConsolePort) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ConsolePort) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ConsolePort) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ConsolePort) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ConsolePort) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetOccupied returns the Occupied field value func (o *ConsolePort) GetOccupied() bool { @@ -816,14 +891,20 @@ func (o ConsolePort) ToMap() (map[string]interface{}, error) { if !IsNil(o.MarkConnected) { toSerialize["mark_connected"] = o.MarkConnected } - toSerialize["cable"] = o.Cable.Get() + if o.Cable.IsSet() { + toSerialize["cable"] = o.Cable.Get() + } toSerialize["cable_end"] = o.CableEnd toSerialize["link_peers"] = o.LinkPeers - toSerialize["link_peers_type"] = o.LinkPeersType.Get() + if o.LinkPeersType.IsSet() { + toSerialize["link_peers_type"] = o.LinkPeersType.Get() + } if o.ConnectedEndpoints != nil { toSerialize["connected_endpoints"] = o.ConnectedEndpoints } - toSerialize["connected_endpoints_type"] = o.ConnectedEndpointsType.Get() + if o.ConnectedEndpointsType.IsSet() { + toSerialize["connected_endpoints_type"] = o.ConnectedEndpointsType.Get() + } toSerialize["connected_endpoints_reachable"] = o.ConnectedEndpointsReachable if !IsNil(o.Tags) { toSerialize["tags"] = o.Tags @@ -831,8 +912,12 @@ func (o ConsolePort) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["_occupied"] = o.Occupied for key, value := range o.AdditionalProperties { @@ -852,15 +937,9 @@ func (o *ConsolePort) UnmarshalJSON(data []byte) (err error) { "display", "device", "name", - "cable", "cable_end", "link_peers", - "link_peers_type", - "connected_endpoints", - "connected_endpoints_type", "connected_endpoints_reachable", - "created", - "last_updated", "_occupied", } diff --git a/netbox/model_console_port_template.go b/netbox/model_console_port_template.go index 296d2faac..4c8a440c0 100644 --- a/netbox/model_console_port_template.go +++ b/netbox/model_console_port_template.go @@ -32,8 +32,8 @@ type ConsolePortTemplate struct { Label *string `json:"label,omitempty"` Type *ConsolePortType `json:"type,omitempty"` Description *string `json:"description,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -43,14 +43,12 @@ type _ConsolePortTemplate ConsolePortTemplate // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewConsolePortTemplate(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime) *ConsolePortTemplate { +func NewConsolePortTemplate(id int32, url string, display string, name string) *ConsolePortTemplate { this := ConsolePortTemplate{} this.Id = id this.Url = url this.Display = display this.Name = name - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -342,18 +340,16 @@ func (o *ConsolePortTemplate) SetDescription(v string) { o.Description = &v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsolePortTemplate) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConsolePortTemplate) GetCreatedOk() (*time.Time, bool) { @@ -363,24 +359,39 @@ func (o *ConsolePortTemplate) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ConsolePortTemplate) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ConsolePortTemplate) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ConsolePortTemplate) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ConsolePortTemplate) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsolePortTemplate) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConsolePortTemplate) GetLastUpdatedOk() (*time.Time, bool) { @@ -390,11 +401,28 @@ func (o *ConsolePortTemplate) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ConsolePortTemplate) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ConsolePortTemplate) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ConsolePortTemplate) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ConsolePortTemplate) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o ConsolePortTemplate) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -425,8 +453,12 @@ func (o ConsolePortTemplate) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -444,8 +476,6 @@ func (o *ConsolePortTemplate) UnmarshalJSON(data []byte) (err error) { "url", "display", "name", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_console_server_port.go b/netbox/model_console_server_port.go index 3b26cc8e5..46a3ea5f0 100644 --- a/netbox/model_console_server_port.go +++ b/netbox/model_console_server_port.go @@ -35,18 +35,18 @@ type ConsoleServerPort struct { Description *string `json:"description,omitempty"` // Treat as if a cable is connected MarkConnected *bool `json:"mark_connected,omitempty"` - Cable NullableBriefCable `json:"cable"` + Cable NullableBriefCable `json:"cable,omitempty"` CableEnd string `json:"cable_end"` LinkPeers []interface{} `json:"link_peers"` // Return the type of the peer link terminations, or None. - LinkPeersType NullableString `json:"link_peers_type"` - ConnectedEndpoints []interface{} `json:"connected_endpoints"` - ConnectedEndpointsType NullableString `json:"connected_endpoints_type"` + LinkPeersType NullableString `json:"link_peers_type,omitempty"` + ConnectedEndpoints []interface{} `json:"connected_endpoints,omitempty"` + ConnectedEndpointsType NullableString `json:"connected_endpoints_type,omitempty"` ConnectedEndpointsReachable bool `json:"connected_endpoints_reachable"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` Occupied bool `json:"_occupied"` AdditionalProperties map[string]interface{} } @@ -57,22 +57,16 @@ type _ConsoleServerPort ConsoleServerPort // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewConsoleServerPort(id int32, url string, display string, device BriefDevice, name string, cable NullableBriefCable, cableEnd string, linkPeers []interface{}, linkPeersType NullableString, connectedEndpoints []interface{}, connectedEndpointsType NullableString, connectedEndpointsReachable bool, created NullableTime, lastUpdated NullableTime, occupied bool) *ConsoleServerPort { +func NewConsoleServerPort(id int32, url string, display string, device BriefDevice, name string, cableEnd string, linkPeers []interface{}, connectedEndpointsReachable bool, occupied bool) *ConsoleServerPort { this := ConsoleServerPort{} this.Id = id this.Url = url this.Display = display this.Device = device this.Name = name - this.Cable = cable this.CableEnd = cableEnd this.LinkPeers = linkPeers - this.LinkPeersType = linkPeersType - this.ConnectedEndpoints = connectedEndpoints - this.ConnectedEndpointsType = connectedEndpointsType this.ConnectedEndpointsReachable = connectedEndpointsReachable - this.Created = created - this.LastUpdated = lastUpdated this.Occupied = occupied return &this } @@ -454,18 +448,16 @@ func (o *ConsoleServerPort) SetMarkConnected(v bool) { o.MarkConnected = &v } -// GetCable returns the Cable field value -// If the value is explicit nil, the zero value for BriefCable will be returned +// GetCable returns the Cable field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsoleServerPort) GetCable() BriefCable { - if o == nil || o.Cable.Get() == nil { + if o == nil || IsNil(o.Cable.Get()) { var ret BriefCable return ret } - return *o.Cable.Get() } -// GetCableOk returns a tuple with the Cable field value +// GetCableOk returns a tuple with the Cable field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConsoleServerPort) GetCableOk() (*BriefCable, bool) { @@ -475,11 +467,28 @@ func (o *ConsoleServerPort) GetCableOk() (*BriefCable, bool) { return o.Cable.Get(), o.Cable.IsSet() } -// SetCable sets field value +// HasCable returns a boolean if a field has been set. +func (o *ConsoleServerPort) HasCable() bool { + if o != nil && o.Cable.IsSet() { + return true + } + + return false +} + +// SetCable gets a reference to the given NullableBriefCable and assigns it to the Cable field. func (o *ConsoleServerPort) SetCable(v BriefCable) { o.Cable.Set(&v) } +// SetCableNil sets the value for Cable to be an explicit nil +func (o *ConsoleServerPort) SetCableNil() { + o.Cable.Set(nil) +} +// UnsetCable ensures that no value is present for Cable, not even an explicit nil +func (o *ConsoleServerPort) UnsetCable() { + o.Cable.Unset() +} // GetCableEnd returns the CableEnd field value func (o *ConsoleServerPort) GetCableEnd() string { @@ -531,18 +540,16 @@ func (o *ConsoleServerPort) SetLinkPeers(v []interface{}) { } -// GetLinkPeersType returns the LinkPeersType field value -// If the value is explicit nil, the zero value for string will be returned +// GetLinkPeersType returns the LinkPeersType field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsoleServerPort) GetLinkPeersType() string { - if o == nil || o.LinkPeersType.Get() == nil { + if o == nil || IsNil(o.LinkPeersType.Get()) { var ret string return ret } - return *o.LinkPeersType.Get() } -// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value +// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConsoleServerPort) GetLinkPeersTypeOk() (*string, bool) { @@ -552,24 +559,39 @@ func (o *ConsoleServerPort) GetLinkPeersTypeOk() (*string, bool) { return o.LinkPeersType.Get(), o.LinkPeersType.IsSet() } -// SetLinkPeersType sets field value +// HasLinkPeersType returns a boolean if a field has been set. +func (o *ConsoleServerPort) HasLinkPeersType() bool { + if o != nil && o.LinkPeersType.IsSet() { + return true + } + + return false +} + +// SetLinkPeersType gets a reference to the given NullableString and assigns it to the LinkPeersType field. func (o *ConsoleServerPort) SetLinkPeersType(v string) { o.LinkPeersType.Set(&v) } +// SetLinkPeersTypeNil sets the value for LinkPeersType to be an explicit nil +func (o *ConsoleServerPort) SetLinkPeersTypeNil() { + o.LinkPeersType.Set(nil) +} +// UnsetLinkPeersType ensures that no value is present for LinkPeersType, not even an explicit nil +func (o *ConsoleServerPort) UnsetLinkPeersType() { + o.LinkPeersType.Unset() +} -// GetConnectedEndpoints returns the ConnectedEndpoints field value -// If the value is explicit nil, the zero value for []interface{} will be returned +// GetConnectedEndpoints returns the ConnectedEndpoints field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsoleServerPort) GetConnectedEndpoints() []interface{} { if o == nil { var ret []interface{} return ret } - return o.ConnectedEndpoints } -// GetConnectedEndpointsOk returns a tuple with the ConnectedEndpoints field value +// GetConnectedEndpointsOk returns a tuple with the ConnectedEndpoints field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConsoleServerPort) GetConnectedEndpointsOk() ([]interface{}, bool) { @@ -579,24 +601,30 @@ func (o *ConsoleServerPort) GetConnectedEndpointsOk() ([]interface{}, bool) { return o.ConnectedEndpoints, true } -// SetConnectedEndpoints sets field value +// HasConnectedEndpoints returns a boolean if a field has been set. +func (o *ConsoleServerPort) HasConnectedEndpoints() bool { + if o != nil && !IsNil(o.ConnectedEndpoints) { + return true + } + + return false +} + +// SetConnectedEndpoints gets a reference to the given []interface{} and assigns it to the ConnectedEndpoints field. func (o *ConsoleServerPort) SetConnectedEndpoints(v []interface{}) { o.ConnectedEndpoints = v } - -// GetConnectedEndpointsType returns the ConnectedEndpointsType field value -// If the value is explicit nil, the zero value for string will be returned +// GetConnectedEndpointsType returns the ConnectedEndpointsType field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsoleServerPort) GetConnectedEndpointsType() string { - if o == nil || o.ConnectedEndpointsType.Get() == nil { + if o == nil || IsNil(o.ConnectedEndpointsType.Get()) { var ret string return ret } - return *o.ConnectedEndpointsType.Get() } -// GetConnectedEndpointsTypeOk returns a tuple with the ConnectedEndpointsType field value +// GetConnectedEndpointsTypeOk returns a tuple with the ConnectedEndpointsType field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConsoleServerPort) GetConnectedEndpointsTypeOk() (*string, bool) { @@ -606,11 +634,28 @@ func (o *ConsoleServerPort) GetConnectedEndpointsTypeOk() (*string, bool) { return o.ConnectedEndpointsType.Get(), o.ConnectedEndpointsType.IsSet() } -// SetConnectedEndpointsType sets field value +// HasConnectedEndpointsType returns a boolean if a field has been set. +func (o *ConsoleServerPort) HasConnectedEndpointsType() bool { + if o != nil && o.ConnectedEndpointsType.IsSet() { + return true + } + + return false +} + +// SetConnectedEndpointsType gets a reference to the given NullableString and assigns it to the ConnectedEndpointsType field. func (o *ConsoleServerPort) SetConnectedEndpointsType(v string) { o.ConnectedEndpointsType.Set(&v) } +// SetConnectedEndpointsTypeNil sets the value for ConnectedEndpointsType to be an explicit nil +func (o *ConsoleServerPort) SetConnectedEndpointsTypeNil() { + o.ConnectedEndpointsType.Set(nil) +} +// UnsetConnectedEndpointsType ensures that no value is present for ConnectedEndpointsType, not even an explicit nil +func (o *ConsoleServerPort) UnsetConnectedEndpointsType() { + o.ConnectedEndpointsType.Unset() +} // GetConnectedEndpointsReachable returns the ConnectedEndpointsReachable field value func (o *ConsoleServerPort) GetConnectedEndpointsReachable() bool { @@ -701,18 +746,16 @@ func (o *ConsoleServerPort) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsoleServerPort) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConsoleServerPort) GetCreatedOk() (*time.Time, bool) { @@ -722,24 +765,39 @@ func (o *ConsoleServerPort) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ConsoleServerPort) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ConsoleServerPort) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ConsoleServerPort) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ConsoleServerPort) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsoleServerPort) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConsoleServerPort) GetLastUpdatedOk() (*time.Time, bool) { @@ -749,11 +807,28 @@ func (o *ConsoleServerPort) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ConsoleServerPort) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ConsoleServerPort) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ConsoleServerPort) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ConsoleServerPort) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetOccupied returns the Occupied field value func (o *ConsoleServerPort) GetOccupied() bool { @@ -816,14 +891,20 @@ func (o ConsoleServerPort) ToMap() (map[string]interface{}, error) { if !IsNil(o.MarkConnected) { toSerialize["mark_connected"] = o.MarkConnected } - toSerialize["cable"] = o.Cable.Get() + if o.Cable.IsSet() { + toSerialize["cable"] = o.Cable.Get() + } toSerialize["cable_end"] = o.CableEnd toSerialize["link_peers"] = o.LinkPeers - toSerialize["link_peers_type"] = o.LinkPeersType.Get() + if o.LinkPeersType.IsSet() { + toSerialize["link_peers_type"] = o.LinkPeersType.Get() + } if o.ConnectedEndpoints != nil { toSerialize["connected_endpoints"] = o.ConnectedEndpoints } - toSerialize["connected_endpoints_type"] = o.ConnectedEndpointsType.Get() + if o.ConnectedEndpointsType.IsSet() { + toSerialize["connected_endpoints_type"] = o.ConnectedEndpointsType.Get() + } toSerialize["connected_endpoints_reachable"] = o.ConnectedEndpointsReachable if !IsNil(o.Tags) { toSerialize["tags"] = o.Tags @@ -831,8 +912,12 @@ func (o ConsoleServerPort) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["_occupied"] = o.Occupied for key, value := range o.AdditionalProperties { @@ -852,15 +937,9 @@ func (o *ConsoleServerPort) UnmarshalJSON(data []byte) (err error) { "display", "device", "name", - "cable", "cable_end", "link_peers", - "link_peers_type", - "connected_endpoints", - "connected_endpoints_type", "connected_endpoints_reachable", - "created", - "last_updated", "_occupied", } diff --git a/netbox/model_console_server_port_template.go b/netbox/model_console_server_port_template.go index f523cc5b1..8ea45827f 100644 --- a/netbox/model_console_server_port_template.go +++ b/netbox/model_console_server_port_template.go @@ -32,8 +32,8 @@ type ConsoleServerPortTemplate struct { Label *string `json:"label,omitempty"` Type *ConsolePortType `json:"type,omitempty"` Description *string `json:"description,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -43,14 +43,12 @@ type _ConsoleServerPortTemplate ConsoleServerPortTemplate // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewConsoleServerPortTemplate(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime) *ConsoleServerPortTemplate { +func NewConsoleServerPortTemplate(id int32, url string, display string, name string) *ConsoleServerPortTemplate { this := ConsoleServerPortTemplate{} this.Id = id this.Url = url this.Display = display this.Name = name - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -342,18 +340,16 @@ func (o *ConsoleServerPortTemplate) SetDescription(v string) { o.Description = &v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsoleServerPortTemplate) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConsoleServerPortTemplate) GetCreatedOk() (*time.Time, bool) { @@ -363,24 +359,39 @@ func (o *ConsoleServerPortTemplate) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ConsoleServerPortTemplate) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ConsoleServerPortTemplate) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ConsoleServerPortTemplate) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ConsoleServerPortTemplate) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConsoleServerPortTemplate) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConsoleServerPortTemplate) GetLastUpdatedOk() (*time.Time, bool) { @@ -390,11 +401,28 @@ func (o *ConsoleServerPortTemplate) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ConsoleServerPortTemplate) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ConsoleServerPortTemplate) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ConsoleServerPortTemplate) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ConsoleServerPortTemplate) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o ConsoleServerPortTemplate) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -425,8 +453,12 @@ func (o ConsoleServerPortTemplate) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -444,8 +476,6 @@ func (o *ConsoleServerPortTemplate) UnmarshalJSON(data []byte) (err error) { "url", "display", "name", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_contact.go b/netbox/model_contact.go index e4766e6bc..06e4041ed 100644 --- a/netbox/model_contact.go +++ b/netbox/model_contact.go @@ -36,8 +36,8 @@ type Contact struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -47,14 +47,12 @@ type _Contact Contact // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewContact(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime) *Contact { +func NewContact(id int32, url string, display string, name string) *Contact { this := Contact{} this.Id = id this.Url = url this.Display = display this.Name = name - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -528,18 +526,16 @@ func (o *Contact) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Contact) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Contact) GetCreatedOk() (*time.Time, bool) { @@ -549,24 +545,39 @@ func (o *Contact) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Contact) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Contact) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Contact) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Contact) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Contact) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Contact) GetLastUpdatedOk() (*time.Time, bool) { @@ -576,11 +587,28 @@ func (o *Contact) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Contact) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Contact) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Contact) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Contact) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o Contact) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -629,8 +657,12 @@ func (o Contact) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -648,8 +680,6 @@ func (o *Contact) UnmarshalJSON(data []byte) (err error) { "url", "display", "name", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_contact_assignment.go b/netbox/model_contact_assignment.go index a38e37b55..0a8bdcfd6 100644 --- a/netbox/model_contact_assignment.go +++ b/netbox/model_contact_assignment.go @@ -32,8 +32,8 @@ type ContactAssignment struct { Priority *BriefCircuitGroupAssignmentSerializerPriority `json:"priority,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -43,7 +43,7 @@ type _ContactAssignment ContactAssignment // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewContactAssignment(id int32, url string, display string, objectType string, objectId int64, object map[string]interface{}, contact BriefContact, created NullableTime, lastUpdated NullableTime) *ContactAssignment { +func NewContactAssignment(id int32, url string, display string, objectType string, objectId int64, object map[string]interface{}, contact BriefContact) *ContactAssignment { this := ContactAssignment{} this.Id = id this.Url = url @@ -52,8 +52,6 @@ func NewContactAssignment(id int32, url string, display string, objectType strin this.ObjectId = objectId this.Object = object this.Contact = contact - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -378,18 +376,16 @@ func (o *ContactAssignment) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ContactAssignment) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ContactAssignment) GetCreatedOk() (*time.Time, bool) { @@ -399,24 +395,39 @@ func (o *ContactAssignment) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ContactAssignment) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ContactAssignment) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ContactAssignment) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ContactAssignment) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ContactAssignment) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ContactAssignment) GetLastUpdatedOk() (*time.Time, bool) { @@ -426,11 +437,28 @@ func (o *ContactAssignment) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ContactAssignment) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ContactAssignment) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ContactAssignment) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ContactAssignment) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o ContactAssignment) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -461,8 +489,12 @@ func (o ContactAssignment) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -483,8 +515,6 @@ func (o *ContactAssignment) UnmarshalJSON(data []byte) (err error) { "object_id", "object", "contact", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_contact_group.go b/netbox/model_contact_group.go index b7b2cf46e..e71ca43a2 100644 --- a/netbox/model_contact_group.go +++ b/netbox/model_contact_group.go @@ -31,8 +31,8 @@ type ContactGroup struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` ContactCount int32 `json:"contact_count"` Depth int32 `json:"_depth"` AdditionalProperties map[string]interface{} @@ -44,15 +44,13 @@ type _ContactGroup ContactGroup // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewContactGroup(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, contactCount int32, depth int32) *ContactGroup { +func NewContactGroup(id int32, url string, display string, name string, slug string, contactCount int32, depth int32) *ContactGroup { this := ContactGroup{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated this.ContactCount = contactCount this.Depth = depth return &this @@ -361,18 +359,16 @@ func (o *ContactGroup) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ContactGroup) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ContactGroup) GetCreatedOk() (*time.Time, bool) { @@ -382,24 +378,39 @@ func (o *ContactGroup) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ContactGroup) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ContactGroup) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ContactGroup) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ContactGroup) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ContactGroup) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ContactGroup) GetLastUpdatedOk() (*time.Time, bool) { @@ -409,11 +420,28 @@ func (o *ContactGroup) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ContactGroup) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ContactGroup) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ContactGroup) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ContactGroup) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetContactCount returns the ContactCount field value func (o *ContactGroup) GetContactCount() int32 { @@ -495,8 +523,12 @@ func (o ContactGroup) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["contact_count"] = o.ContactCount toSerialize["_depth"] = o.Depth @@ -517,8 +549,6 @@ func (o *ContactGroup) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", "contact_count", "_depth", } diff --git a/netbox/model_contact_role.go b/netbox/model_contact_role.go index a859068d4..8b1de042d 100644 --- a/netbox/model_contact_role.go +++ b/netbox/model_contact_role.go @@ -30,8 +30,8 @@ type ContactRole struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -41,15 +41,13 @@ type _ContactRole ContactRole // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewContactRole(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime) *ContactRole { +func NewContactRole(id int32, url string, display string, name string, slug string) *ContactRole { this := ContactRole{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -314,18 +312,16 @@ func (o *ContactRole) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ContactRole) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ContactRole) GetCreatedOk() (*time.Time, bool) { @@ -335,24 +331,39 @@ func (o *ContactRole) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ContactRole) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ContactRole) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ContactRole) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ContactRole) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ContactRole) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ContactRole) GetLastUpdatedOk() (*time.Time, bool) { @@ -362,11 +373,28 @@ func (o *ContactRole) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ContactRole) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ContactRole) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ContactRole) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ContactRole) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o ContactRole) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -395,8 +423,12 @@ func (o ContactRole) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -415,8 +447,6 @@ func (o *ContactRole) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_custom_field.go b/netbox/model_custom_field.go index 7ce444059..10f183430 100644 --- a/netbox/model_custom_field.go +++ b/netbox/model_custom_field.go @@ -61,8 +61,8 @@ type CustomField struct { ValidationRegex *string `json:"validation_regex,omitempty"` ChoiceSet NullableBriefCustomFieldChoiceSet `json:"choice_set,omitempty"` Comments *string `json:"comments,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -72,7 +72,7 @@ type _CustomField CustomField // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCustomField(id int32, url string, display string, objectTypes []string, type_ CustomFieldType, dataType string, name string, created NullableTime, lastUpdated NullableTime) *CustomField { +func NewCustomField(id int32, url string, display string, objectTypes []string, type_ CustomFieldType, dataType string, name string) *CustomField { this := CustomField{} this.Id = id this.Url = url @@ -81,8 +81,6 @@ func NewCustomField(id int32, url string, display string, objectTypes []string, this.Type = type_ this.DataType = dataType this.Name = name - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -951,18 +949,16 @@ func (o *CustomField) SetComments(v string) { o.Comments = &v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CustomField) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CustomField) GetCreatedOk() (*time.Time, bool) { @@ -972,24 +968,39 @@ func (o *CustomField) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *CustomField) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *CustomField) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *CustomField) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *CustomField) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CustomField) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CustomField) GetLastUpdatedOk() (*time.Time, bool) { @@ -999,11 +1010,28 @@ func (o *CustomField) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *CustomField) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *CustomField) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *CustomField) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *CustomField) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o CustomField) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -1082,8 +1110,12 @@ func (o CustomField) ToMap() (map[string]interface{}, error) { if !IsNil(o.Comments) { toSerialize["comments"] = o.Comments } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -1104,8 +1136,6 @@ func (o *CustomField) UnmarshalJSON(data []byte) (err error) { "type", "data_type", "name", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_custom_field_choice_set.go b/netbox/model_custom_field_choice_set.go index 0b860641c..cd2f7638c 100644 --- a/netbox/model_custom_field_choice_set.go +++ b/netbox/model_custom_field_choice_set.go @@ -32,8 +32,8 @@ type CustomFieldChoiceSet struct { // Choices are automatically ordered alphabetically OrderAlphabetically *bool `json:"order_alphabetically,omitempty"` ChoicesCount string `json:"choices_count"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -43,7 +43,7 @@ type _CustomFieldChoiceSet CustomFieldChoiceSet // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCustomFieldChoiceSet(id int32, url string, display string, name string, extraChoices [][]interface{}, choicesCount string, created NullableTime, lastUpdated NullableTime) *CustomFieldChoiceSet { +func NewCustomFieldChoiceSet(id int32, url string, display string, name string, extraChoices [][]interface{}, choicesCount string) *CustomFieldChoiceSet { this := CustomFieldChoiceSet{} this.Id = id this.Url = url @@ -51,8 +51,6 @@ func NewCustomFieldChoiceSet(id int32, url string, display string, name string, this.Name = name this.ExtraChoices = extraChoices this.ChoicesCount = choicesCount - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -342,18 +340,16 @@ func (o *CustomFieldChoiceSet) SetChoicesCount(v string) { } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CustomFieldChoiceSet) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CustomFieldChoiceSet) GetCreatedOk() (*time.Time, bool) { @@ -363,24 +359,39 @@ func (o *CustomFieldChoiceSet) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *CustomFieldChoiceSet) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *CustomFieldChoiceSet) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *CustomFieldChoiceSet) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *CustomFieldChoiceSet) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CustomFieldChoiceSet) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CustomFieldChoiceSet) GetLastUpdatedOk() (*time.Time, bool) { @@ -390,11 +401,28 @@ func (o *CustomFieldChoiceSet) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *CustomFieldChoiceSet) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *CustomFieldChoiceSet) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *CustomFieldChoiceSet) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *CustomFieldChoiceSet) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o CustomFieldChoiceSet) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -424,8 +452,12 @@ func (o CustomFieldChoiceSet) ToMap() (map[string]interface{}, error) { toSerialize["order_alphabetically"] = o.OrderAlphabetically } toSerialize["choices_count"] = o.ChoicesCount - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -445,8 +477,6 @@ func (o *CustomFieldChoiceSet) UnmarshalJSON(data []byte) (err error) { "name", "extra_choices", "choices_count", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_custom_link.go b/netbox/model_custom_link.go index a057fbbed..f7247a7f6 100644 --- a/netbox/model_custom_link.go +++ b/netbox/model_custom_link.go @@ -38,8 +38,8 @@ type CustomLink struct { ButtonClass *CustomLinkButtonClass `json:"button_class,omitempty"` // Force link to open in a new window NewWindow *bool `json:"new_window,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -49,7 +49,7 @@ type _CustomLink CustomLink // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewCustomLink(id int32, url string, display string, objectTypes []string, name string, linkText string, linkUrl string, created NullableTime, lastUpdated NullableTime) *CustomLink { +func NewCustomLink(id int32, url string, display string, objectTypes []string, name string, linkText string, linkUrl string) *CustomLink { this := CustomLink{} this.Id = id this.Url = url @@ -58,8 +58,6 @@ func NewCustomLink(id int32, url string, display string, objectTypes []string, n this.Name = name this.LinkText = linkText this.LinkUrl = linkUrl - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -438,18 +436,16 @@ func (o *CustomLink) SetNewWindow(v bool) { o.NewWindow = &v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CustomLink) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CustomLink) GetCreatedOk() (*time.Time, bool) { @@ -459,24 +455,39 @@ func (o *CustomLink) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *CustomLink) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *CustomLink) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *CustomLink) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *CustomLink) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *CustomLink) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *CustomLink) GetLastUpdatedOk() (*time.Time, bool) { @@ -486,11 +497,28 @@ func (o *CustomLink) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *CustomLink) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *CustomLink) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *CustomLink) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *CustomLink) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o CustomLink) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -527,8 +555,12 @@ func (o CustomLink) ToMap() (map[string]interface{}, error) { if !IsNil(o.NewWindow) { toSerialize["new_window"] = o.NewWindow } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -549,8 +581,6 @@ func (o *CustomLink) UnmarshalJSON(data []byte) (err error) { "name", "link_text", "link_url", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_data_source.go b/netbox/model_data_source.go index c574b6036..46b94d281 100644 --- a/netbox/model_data_source.go +++ b/netbox/model_data_source.go @@ -36,9 +36,9 @@ type DataSource struct { IgnoreRules *string `json:"ignore_rules,omitempty"` Comments *string `json:"comments,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` - LastSynced NullableTime `json:"last_synced"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` + LastSynced NullableTime `json:"last_synced,omitempty"` FileCount int64 `json:"file_count"` AdditionalProperties map[string]interface{} } @@ -49,7 +49,7 @@ type _DataSource DataSource // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewDataSource(id int32, url string, display string, name string, type_ DataSourceType, sourceUrl string, status DataSourceStatus, created NullableTime, lastUpdated NullableTime, lastSynced NullableTime, fileCount int64) *DataSource { +func NewDataSource(id int32, url string, display string, name string, type_ DataSourceType, sourceUrl string, status DataSourceStatus, fileCount int64) *DataSource { this := DataSource{} this.Id = id this.Url = url @@ -58,9 +58,6 @@ func NewDataSource(id int32, url string, display string, name string, type_ Data this.Type = type_ this.SourceUrl = sourceUrl this.Status = status - this.Created = created - this.LastUpdated = lastUpdated - this.LastSynced = lastSynced this.FileCount = fileCount return &this } @@ -473,18 +470,16 @@ func (o *DataSource) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DataSource) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DataSource) GetCreatedOk() (*time.Time, bool) { @@ -494,24 +489,39 @@ func (o *DataSource) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *DataSource) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *DataSource) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *DataSource) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *DataSource) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DataSource) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DataSource) GetLastUpdatedOk() (*time.Time, bool) { @@ -521,24 +531,39 @@ func (o *DataSource) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *DataSource) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *DataSource) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *DataSource) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *DataSource) UnsetLastUpdated() { + o.LastUpdated.Unset() +} -// GetLastSynced returns the LastSynced field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastSynced returns the LastSynced field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DataSource) GetLastSynced() time.Time { - if o == nil || o.LastSynced.Get() == nil { + if o == nil || IsNil(o.LastSynced.Get()) { var ret time.Time return ret } - return *o.LastSynced.Get() } -// GetLastSyncedOk returns a tuple with the LastSynced field value +// GetLastSyncedOk returns a tuple with the LastSynced field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DataSource) GetLastSyncedOk() (*time.Time, bool) { @@ -548,11 +573,28 @@ func (o *DataSource) GetLastSyncedOk() (*time.Time, bool) { return o.LastSynced.Get(), o.LastSynced.IsSet() } -// SetLastSynced sets field value +// HasLastSynced returns a boolean if a field has been set. +func (o *DataSource) HasLastSynced() bool { + if o != nil && o.LastSynced.IsSet() { + return true + } + + return false +} + +// SetLastSynced gets a reference to the given NullableTime and assigns it to the LastSynced field. func (o *DataSource) SetLastSynced(v time.Time) { o.LastSynced.Set(&v) } +// SetLastSyncedNil sets the value for LastSynced to be an explicit nil +func (o *DataSource) SetLastSyncedNil() { + o.LastSynced.Set(nil) +} +// UnsetLastSynced ensures that no value is present for LastSynced, not even an explicit nil +func (o *DataSource) UnsetLastSynced() { + o.LastSynced.Unset() +} // GetFileCount returns the FileCount field value func (o *DataSource) GetFileCount() int64 { @@ -617,9 +659,15 @@ func (o DataSource) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() - toSerialize["last_synced"] = o.LastSynced.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } + if o.LastSynced.IsSet() { + toSerialize["last_synced"] = o.LastSynced.Get() + } toSerialize["file_count"] = o.FileCount for key, value := range o.AdditionalProperties { @@ -641,9 +689,6 @@ func (o *DataSource) UnmarshalJSON(data []byte) (err error) { "type", "source_url", "status", - "created", - "last_updated", - "last_synced", "file_count", } diff --git a/netbox/model_device_bay.go b/netbox/model_device_bay.go index 55c2bb2de..ab35ce183 100644 --- a/netbox/model_device_bay.go +++ b/netbox/model_device_bay.go @@ -33,8 +33,8 @@ type DeviceBay struct { InstalledDevice NullableBriefDevice `json:"installed_device,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -44,15 +44,13 @@ type _DeviceBay DeviceBay // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewDeviceBay(id int32, url string, display string, device BriefDevice, name string, created NullableTime, lastUpdated NullableTime) *DeviceBay { +func NewDeviceBay(id int32, url string, display string, device BriefDevice, name string) *DeviceBay { this := DeviceBay{} this.Id = id this.Url = url this.Display = display this.Device = device this.Name = name - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -391,18 +389,16 @@ func (o *DeviceBay) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DeviceBay) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DeviceBay) GetCreatedOk() (*time.Time, bool) { @@ -412,24 +408,39 @@ func (o *DeviceBay) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *DeviceBay) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *DeviceBay) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *DeviceBay) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *DeviceBay) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DeviceBay) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DeviceBay) GetLastUpdatedOk() (*time.Time, bool) { @@ -439,11 +450,28 @@ func (o *DeviceBay) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *DeviceBay) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *DeviceBay) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *DeviceBay) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *DeviceBay) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o DeviceBay) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -478,8 +506,12 @@ func (o DeviceBay) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -498,8 +530,6 @@ func (o *DeviceBay) UnmarshalJSON(data []byte) (err error) { "display", "device", "name", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_device_bay_template.go b/netbox/model_device_bay_template.go index 09934caf3..a5eacf8b9 100644 --- a/netbox/model_device_bay_template.go +++ b/netbox/model_device_bay_template.go @@ -30,8 +30,8 @@ type DeviceBayTemplate struct { // Physical label Label *string `json:"label,omitempty"` Description *string `json:"description,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -41,15 +41,13 @@ type _DeviceBayTemplate DeviceBayTemplate // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewDeviceBayTemplate(id int32, url string, display string, deviceType BriefDeviceType, name string, created NullableTime, lastUpdated NullableTime) *DeviceBayTemplate { +func NewDeviceBayTemplate(id int32, url string, display string, deviceType BriefDeviceType, name string) *DeviceBayTemplate { this := DeviceBayTemplate{} this.Id = id this.Url = url this.Display = display this.DeviceType = deviceType this.Name = name - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -250,18 +248,16 @@ func (o *DeviceBayTemplate) SetDescription(v string) { o.Description = &v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DeviceBayTemplate) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DeviceBayTemplate) GetCreatedOk() (*time.Time, bool) { @@ -271,24 +267,39 @@ func (o *DeviceBayTemplate) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *DeviceBayTemplate) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *DeviceBayTemplate) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *DeviceBayTemplate) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *DeviceBayTemplate) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DeviceBayTemplate) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DeviceBayTemplate) GetLastUpdatedOk() (*time.Time, bool) { @@ -298,11 +309,28 @@ func (o *DeviceBayTemplate) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *DeviceBayTemplate) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *DeviceBayTemplate) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *DeviceBayTemplate) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *DeviceBayTemplate) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o DeviceBayTemplate) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -325,8 +353,12 @@ func (o DeviceBayTemplate) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -345,8 +377,6 @@ func (o *DeviceBayTemplate) UnmarshalJSON(data []byte) (err error) { "display", "device_type", "name", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_device_role.go b/netbox/model_device_role.go index 832383d5f..203fdf008 100644 --- a/netbox/model_device_role.go +++ b/netbox/model_device_role.go @@ -34,8 +34,8 @@ type DeviceRole struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` DeviceCount *int64 `json:"device_count,omitempty"` VirtualmachineCount *int64 `json:"virtualmachine_count,omitempty"` AdditionalProperties map[string]interface{} @@ -47,15 +47,13 @@ type _DeviceRole DeviceRole // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewDeviceRole(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime) *DeviceRole { +func NewDeviceRole(id int32, url string, display string, name string, slug string) *DeviceRole { this := DeviceRole{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -426,18 +424,16 @@ func (o *DeviceRole) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DeviceRole) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DeviceRole) GetCreatedOk() (*time.Time, bool) { @@ -447,24 +443,39 @@ func (o *DeviceRole) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *DeviceRole) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *DeviceRole) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *DeviceRole) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *DeviceRole) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DeviceRole) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DeviceRole) GetLastUpdatedOk() (*time.Time, bool) { @@ -474,11 +485,28 @@ func (o *DeviceRole) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *DeviceRole) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *DeviceRole) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *DeviceRole) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *DeviceRole) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetDeviceCount returns the DeviceCount field value if set, zero value otherwise. func (o *DeviceRole) GetDeviceCount() int64 { @@ -580,8 +608,12 @@ func (o DeviceRole) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } if !IsNil(o.DeviceCount) { toSerialize["device_count"] = o.DeviceCount } @@ -606,8 +638,6 @@ func (o *DeviceRole) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_device_type.go b/netbox/model_device_type.go index fead2a29f..d83172f78 100644 --- a/netbox/model_device_type.go +++ b/netbox/model_device_type.go @@ -46,8 +46,8 @@ type DeviceType struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` DeviceCount *int64 `json:"device_count,omitempty"` ConsolePortTemplateCount int32 `json:"console_port_template_count"` ConsoleServerPortTemplateCount int32 `json:"console_server_port_template_count"` @@ -68,7 +68,7 @@ type _DeviceType DeviceType // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewDeviceType(id int32, url string, display string, manufacturer BriefManufacturer, model string, slug string, created NullableTime, lastUpdated NullableTime, consolePortTemplateCount int32, consoleServerPortTemplateCount int32, powerPortTemplateCount int32, powerOutletTemplateCount int32, interfaceTemplateCount int32, frontPortTemplateCount int32, rearPortTemplateCount int32, deviceBayTemplateCount int32, moduleBayTemplateCount int32, inventoryItemTemplateCount int32) *DeviceType { +func NewDeviceType(id int32, url string, display string, manufacturer BriefManufacturer, model string, slug string, consolePortTemplateCount int32, consoleServerPortTemplateCount int32, powerPortTemplateCount int32, powerOutletTemplateCount int32, interfaceTemplateCount int32, frontPortTemplateCount int32, rearPortTemplateCount int32, deviceBayTemplateCount int32, moduleBayTemplateCount int32, inventoryItemTemplateCount int32) *DeviceType { this := DeviceType{} this.Id = id this.Url = url @@ -78,8 +78,6 @@ func NewDeviceType(id int32, url string, display string, manufacturer BriefManuf this.Slug = slug var uHeight float64 = 1.0 this.UHeight = &uHeight - this.Created = created - this.LastUpdated = lastUpdated this.ConsolePortTemplateCount = consolePortTemplateCount this.ConsoleServerPortTemplateCount = consoleServerPortTemplateCount this.PowerPortTemplateCount = powerPortTemplateCount @@ -835,18 +833,16 @@ func (o *DeviceType) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DeviceType) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DeviceType) GetCreatedOk() (*time.Time, bool) { @@ -856,24 +852,39 @@ func (o *DeviceType) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *DeviceType) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *DeviceType) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *DeviceType) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *DeviceType) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DeviceType) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DeviceType) GetLastUpdatedOk() (*time.Time, bool) { @@ -883,11 +894,28 @@ func (o *DeviceType) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *DeviceType) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *DeviceType) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *DeviceType) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *DeviceType) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetDeviceCount returns the DeviceCount field value if set, zero value otherwise. func (o *DeviceType) GetDeviceCount() int64 { @@ -1235,8 +1263,12 @@ func (o DeviceType) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } if !IsNil(o.DeviceCount) { toSerialize["device_count"] = o.DeviceCount } @@ -1269,8 +1301,6 @@ func (o *DeviceType) UnmarshalJSON(data []byte) (err error) { "manufacturer", "model", "slug", - "created", - "last_updated", "console_port_template_count", "console_server_port_template_count", "power_port_template_count", diff --git a/netbox/model_device_with_config_context.go b/netbox/model_device_with_config_context.go index d12a1759d..678bfd160 100644 --- a/netbox/model_device_with_config_context.go +++ b/netbox/model_device_with_config_context.go @@ -43,10 +43,10 @@ type DeviceWithConfigContext struct { Latitude NullableFloat64 `json:"latitude,omitempty"` // GPS coordinate in decimal format (xx.yyyyyy) Longitude NullableFloat64 `json:"longitude,omitempty"` - ParentDevice NullableNestedDevice `json:"parent_device"` + ParentDevice NullableNestedDevice `json:"parent_device,omitempty"` Status *DeviceStatus `json:"status,omitempty"` Airflow *DeviceAirflow `json:"airflow,omitempty"` - PrimaryIp NullableBriefIPAddress `json:"primary_ip"` + PrimaryIp NullableBriefIPAddress `json:"primary_ip,omitempty"` PrimaryIp4 NullableBriefIPAddress `json:"primary_ip4,omitempty"` PrimaryIp6 NullableBriefIPAddress `json:"primary_ip6,omitempty"` OobIp NullableBriefIPAddress `json:"oob_ip,omitempty"` @@ -58,13 +58,13 @@ type DeviceWithConfigContext struct { Description *string `json:"description,omitempty"` Comments *string `json:"comments,omitempty"` ConfigTemplate NullableBriefConfigTemplate `json:"config_template,omitempty"` - ConfigContext interface{} `json:"config_context"` + ConfigContext interface{} `json:"config_context,omitempty"` // Local config context data takes precedence over source contexts in the final rendered config context LocalContextData interface{} `json:"local_context_data,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` ConsolePortCount int32 `json:"console_port_count"` ConsoleServerPortCount int32 `json:"console_server_port_count"` PowerPortCount int32 `json:"power_port_count"` @@ -84,7 +84,7 @@ type _DeviceWithConfigContext DeviceWithConfigContext // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewDeviceWithConfigContext(id int32, url string, display string, deviceType BriefDeviceType, role BriefDeviceRole, site BriefSite, parentDevice NullableNestedDevice, primaryIp NullableBriefIPAddress, configContext interface{}, created NullableTime, lastUpdated NullableTime, consolePortCount int32, consoleServerPortCount int32, powerPortCount int32, powerOutletCount int32, interfaceCount int32, frontPortCount int32, rearPortCount int32, deviceBayCount int32, moduleBayCount int32, inventoryItemCount int32) *DeviceWithConfigContext { +func NewDeviceWithConfigContext(id int32, url string, display string, deviceType BriefDeviceType, role BriefDeviceRole, site BriefSite, consolePortCount int32, consoleServerPortCount int32, powerPortCount int32, powerOutletCount int32, interfaceCount int32, frontPortCount int32, rearPortCount int32, deviceBayCount int32, moduleBayCount int32, inventoryItemCount int32) *DeviceWithConfigContext { this := DeviceWithConfigContext{} this.Id = id this.Url = url @@ -92,11 +92,6 @@ func NewDeviceWithConfigContext(id int32, url string, display string, deviceType this.DeviceType = deviceType this.Role = role this.Site = site - this.ParentDevice = parentDevice - this.PrimaryIp = primaryIp - this.ConfigContext = configContext - this.Created = created - this.LastUpdated = lastUpdated this.ConsolePortCount = consolePortCount this.ConsoleServerPortCount = consoleServerPortCount this.PowerPortCount = powerPortCount @@ -742,18 +737,16 @@ func (o *DeviceWithConfigContext) UnsetLongitude() { o.Longitude.Unset() } -// GetParentDevice returns the ParentDevice field value -// If the value is explicit nil, the zero value for NestedDevice will be returned +// GetParentDevice returns the ParentDevice field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DeviceWithConfigContext) GetParentDevice() NestedDevice { - if o == nil || o.ParentDevice.Get() == nil { + if o == nil || IsNil(o.ParentDevice.Get()) { var ret NestedDevice return ret } - return *o.ParentDevice.Get() } -// GetParentDeviceOk returns a tuple with the ParentDevice field value +// GetParentDeviceOk returns a tuple with the ParentDevice field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DeviceWithConfigContext) GetParentDeviceOk() (*NestedDevice, bool) { @@ -763,11 +756,28 @@ func (o *DeviceWithConfigContext) GetParentDeviceOk() (*NestedDevice, bool) { return o.ParentDevice.Get(), o.ParentDevice.IsSet() } -// SetParentDevice sets field value +// HasParentDevice returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasParentDevice() bool { + if o != nil && o.ParentDevice.IsSet() { + return true + } + + return false +} + +// SetParentDevice gets a reference to the given NullableNestedDevice and assigns it to the ParentDevice field. func (o *DeviceWithConfigContext) SetParentDevice(v NestedDevice) { o.ParentDevice.Set(&v) } +// SetParentDeviceNil sets the value for ParentDevice to be an explicit nil +func (o *DeviceWithConfigContext) SetParentDeviceNil() { + o.ParentDevice.Set(nil) +} +// UnsetParentDevice ensures that no value is present for ParentDevice, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetParentDevice() { + o.ParentDevice.Unset() +} // GetStatus returns the Status field value if set, zero value otherwise. func (o *DeviceWithConfigContext) GetStatus() DeviceStatus { @@ -833,18 +843,16 @@ func (o *DeviceWithConfigContext) SetAirflow(v DeviceAirflow) { o.Airflow = &v } -// GetPrimaryIp returns the PrimaryIp field value -// If the value is explicit nil, the zero value for BriefIPAddress will be returned +// GetPrimaryIp returns the PrimaryIp field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DeviceWithConfigContext) GetPrimaryIp() BriefIPAddress { - if o == nil || o.PrimaryIp.Get() == nil { + if o == nil || IsNil(o.PrimaryIp.Get()) { var ret BriefIPAddress return ret } - return *o.PrimaryIp.Get() } -// GetPrimaryIpOk returns a tuple with the PrimaryIp field value +// GetPrimaryIpOk returns a tuple with the PrimaryIp field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DeviceWithConfigContext) GetPrimaryIpOk() (*BriefIPAddress, bool) { @@ -854,11 +862,28 @@ func (o *DeviceWithConfigContext) GetPrimaryIpOk() (*BriefIPAddress, bool) { return o.PrimaryIp.Get(), o.PrimaryIp.IsSet() } -// SetPrimaryIp sets field value +// HasPrimaryIp returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasPrimaryIp() bool { + if o != nil && o.PrimaryIp.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp gets a reference to the given NullableBriefIPAddress and assigns it to the PrimaryIp field. func (o *DeviceWithConfigContext) SetPrimaryIp(v BriefIPAddress) { o.PrimaryIp.Set(&v) } +// SetPrimaryIpNil sets the value for PrimaryIp to be an explicit nil +func (o *DeviceWithConfigContext) SetPrimaryIpNil() { + o.PrimaryIp.Set(nil) +} +// UnsetPrimaryIp ensures that no value is present for PrimaryIp, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetPrimaryIp() { + o.PrimaryIp.Unset() +} // GetPrimaryIp4 returns the PrimaryIp4 field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DeviceWithConfigContext) GetPrimaryIp4() BriefIPAddress { @@ -1260,18 +1285,16 @@ func (o *DeviceWithConfigContext) UnsetConfigTemplate() { o.ConfigTemplate.Unset() } -// GetConfigContext returns the ConfigContext field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetConfigContext returns the ConfigContext field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DeviceWithConfigContext) GetConfigContext() interface{} { if o == nil { var ret interface{} return ret } - return o.ConfigContext } -// GetConfigContextOk returns a tuple with the ConfigContext field value +// GetConfigContextOk returns a tuple with the ConfigContext field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DeviceWithConfigContext) GetConfigContextOk() (*interface{}, bool) { @@ -1281,12 +1304,20 @@ func (o *DeviceWithConfigContext) GetConfigContextOk() (*interface{}, bool) { return &o.ConfigContext, true } -// SetConfigContext sets field value +// HasConfigContext returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasConfigContext() bool { + if o != nil && !IsNil(o.ConfigContext) { + return true + } + + return false +} + +// SetConfigContext gets a reference to the given interface{} and assigns it to the ConfigContext field. func (o *DeviceWithConfigContext) SetConfigContext(v interface{}) { o.ConfigContext = v } - // GetLocalContextData returns the LocalContextData field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DeviceWithConfigContext) GetLocalContextData() interface{} { if o == nil { @@ -1384,18 +1415,16 @@ func (o *DeviceWithConfigContext) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DeviceWithConfigContext) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DeviceWithConfigContext) GetCreatedOk() (*time.Time, bool) { @@ -1405,24 +1434,39 @@ func (o *DeviceWithConfigContext) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *DeviceWithConfigContext) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *DeviceWithConfigContext) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DeviceWithConfigContext) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DeviceWithConfigContext) GetLastUpdatedOk() (*time.Time, bool) { @@ -1432,11 +1476,28 @@ func (o *DeviceWithConfigContext) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *DeviceWithConfigContext) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *DeviceWithConfigContext) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *DeviceWithConfigContext) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *DeviceWithConfigContext) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetConsolePortCount returns the ConsolePortCount field value func (o *DeviceWithConfigContext) GetConsolePortCount() int32 { @@ -1740,14 +1801,18 @@ func (o DeviceWithConfigContext) ToMap() (map[string]interface{}, error) { if o.Longitude.IsSet() { toSerialize["longitude"] = o.Longitude.Get() } - toSerialize["parent_device"] = o.ParentDevice.Get() + if o.ParentDevice.IsSet() { + toSerialize["parent_device"] = o.ParentDevice.Get() + } if !IsNil(o.Status) { toSerialize["status"] = o.Status } if !IsNil(o.Airflow) { toSerialize["airflow"] = o.Airflow } - toSerialize["primary_ip"] = o.PrimaryIp.Get() + if o.PrimaryIp.IsSet() { + toSerialize["primary_ip"] = o.PrimaryIp.Get() + } if o.PrimaryIp4.IsSet() { toSerialize["primary_ip4"] = o.PrimaryIp4.Get() } @@ -1790,8 +1855,12 @@ func (o DeviceWithConfigContext) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["console_port_count"] = o.ConsolePortCount toSerialize["console_server_port_count"] = o.ConsoleServerPortCount toSerialize["power_port_count"] = o.PowerPortCount @@ -1821,11 +1890,6 @@ func (o *DeviceWithConfigContext) UnmarshalJSON(data []byte) (err error) { "device_type", "role", "site", - "parent_device", - "primary_ip", - "config_context", - "created", - "last_updated", "console_port_count", "console_server_port_count", "power_port_count", diff --git a/netbox/model_event_rule.go b/netbox/model_event_rule.go index 169d5b868..74e07185b 100644 --- a/netbox/model_event_rule.go +++ b/netbox/model_event_rule.go @@ -39,8 +39,8 @@ type EventRule struct { Description *string `json:"description,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` Tags []NestedTag `json:"tags,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -50,7 +50,7 @@ type _EventRule EventRule // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewEventRule(id int32, url string, display string, objectTypes []string, name string, eventTypes []EventRuleEventTypesInner, actionType EventRuleActionType, actionObjectType string, actionObject map[string]interface{}, created NullableTime, lastUpdated NullableTime) *EventRule { +func NewEventRule(id int32, url string, display string, objectTypes []string, name string, eventTypes []EventRuleEventTypesInner, actionType EventRuleActionType, actionObjectType string, actionObject map[string]interface{}) *EventRule { this := EventRule{} this.Id = id this.Url = url @@ -61,8 +61,6 @@ func NewEventRule(id int32, url string, display string, objectTypes []string, na this.ActionType = actionType this.ActionObjectType = actionObjectType this.ActionObject = actionObject - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -534,18 +532,16 @@ func (o *EventRule) SetTags(v []NestedTag) { o.Tags = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EventRule) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *EventRule) GetCreatedOk() (*time.Time, bool) { @@ -555,24 +551,39 @@ func (o *EventRule) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *EventRule) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *EventRule) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *EventRule) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *EventRule) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *EventRule) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *EventRule) GetLastUpdatedOk() (*time.Time, bool) { @@ -582,11 +593,28 @@ func (o *EventRule) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *EventRule) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *EventRule) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *EventRule) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *EventRule) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o EventRule) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -628,8 +656,12 @@ func (o EventRule) ToMap() (map[string]interface{}, error) { if !IsNil(o.Tags) { toSerialize["tags"] = o.Tags } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -652,8 +684,6 @@ func (o *EventRule) UnmarshalJSON(data []byte) (err error) { "action_type", "action_object_type", "action_object", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_export_template.go b/netbox/model_export_template.go index 79d33f56a..66bc95e78 100644 --- a/netbox/model_export_template.go +++ b/netbox/model_export_template.go @@ -40,9 +40,9 @@ type ExportTemplate struct { // Path to remote file (relative to data source root) DataPath string `json:"data_path"` DataFile BriefDataFile `json:"data_file"` - DataSynced NullableTime `json:"data_synced"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + DataSynced NullableTime `json:"data_synced,omitempty"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -52,7 +52,7 @@ type _ExportTemplate ExportTemplate // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewExportTemplate(id int32, url string, display string, objectTypes []string, name string, templateCode string, dataPath string, dataFile BriefDataFile, dataSynced NullableTime, created NullableTime, lastUpdated NullableTime) *ExportTemplate { +func NewExportTemplate(id int32, url string, display string, objectTypes []string, name string, templateCode string, dataPath string, dataFile BriefDataFile) *ExportTemplate { this := ExportTemplate{} this.Id = id this.Url = url @@ -62,9 +62,6 @@ func NewExportTemplate(id int32, url string, display string, objectTypes []strin this.TemplateCode = templateCode this.DataPath = dataPath this.DataFile = dataFile - this.DataSynced = dataSynced - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -468,18 +465,16 @@ func (o *ExportTemplate) SetDataFile(v BriefDataFile) { } -// GetDataSynced returns the DataSynced field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetDataSynced returns the DataSynced field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ExportTemplate) GetDataSynced() time.Time { - if o == nil || o.DataSynced.Get() == nil { + if o == nil || IsNil(o.DataSynced.Get()) { var ret time.Time return ret } - return *o.DataSynced.Get() } -// GetDataSyncedOk returns a tuple with the DataSynced field value +// GetDataSyncedOk returns a tuple with the DataSynced field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ExportTemplate) GetDataSyncedOk() (*time.Time, bool) { @@ -489,24 +484,39 @@ func (o *ExportTemplate) GetDataSyncedOk() (*time.Time, bool) { return o.DataSynced.Get(), o.DataSynced.IsSet() } -// SetDataSynced sets field value +// HasDataSynced returns a boolean if a field has been set. +func (o *ExportTemplate) HasDataSynced() bool { + if o != nil && o.DataSynced.IsSet() { + return true + } + + return false +} + +// SetDataSynced gets a reference to the given NullableTime and assigns it to the DataSynced field. func (o *ExportTemplate) SetDataSynced(v time.Time) { o.DataSynced.Set(&v) } +// SetDataSyncedNil sets the value for DataSynced to be an explicit nil +func (o *ExportTemplate) SetDataSyncedNil() { + o.DataSynced.Set(nil) +} +// UnsetDataSynced ensures that no value is present for DataSynced, not even an explicit nil +func (o *ExportTemplate) UnsetDataSynced() { + o.DataSynced.Unset() +} -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ExportTemplate) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ExportTemplate) GetCreatedOk() (*time.Time, bool) { @@ -516,24 +526,39 @@ func (o *ExportTemplate) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ExportTemplate) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ExportTemplate) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ExportTemplate) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ExportTemplate) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ExportTemplate) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ExportTemplate) GetLastUpdatedOk() (*time.Time, bool) { @@ -543,11 +568,28 @@ func (o *ExportTemplate) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ExportTemplate) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ExportTemplate) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ExportTemplate) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ExportTemplate) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o ExportTemplate) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -585,9 +627,15 @@ func (o ExportTemplate) ToMap() (map[string]interface{}, error) { } toSerialize["data_path"] = o.DataPath toSerialize["data_file"] = o.DataFile - toSerialize["data_synced"] = o.DataSynced.Get() - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.DataSynced.IsSet() { + toSerialize["data_synced"] = o.DataSynced.Get() + } + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -609,9 +657,6 @@ func (o *ExportTemplate) UnmarshalJSON(data []byte) (err error) { "template_code", "data_path", "data_file", - "data_synced", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_fhrp_group.go b/netbox/model_fhrp_group.go index 5f18bdf90..dc6c1cb01 100644 --- a/netbox/model_fhrp_group.go +++ b/netbox/model_fhrp_group.go @@ -34,8 +34,8 @@ type FHRPGroup struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` IpAddresses []BriefIPAddress `json:"ip_addresses"` AdditionalProperties map[string]interface{} } @@ -46,15 +46,13 @@ type _FHRPGroup FHRPGroup // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewFHRPGroup(id int32, url string, display string, protocol BriefFHRPGroupProtocol, groupId int32, created NullableTime, lastUpdated NullableTime, ipAddresses []BriefIPAddress) *FHRPGroup { +func NewFHRPGroup(id int32, url string, display string, protocol BriefFHRPGroupProtocol, groupId int32, ipAddresses []BriefIPAddress) *FHRPGroup { this := FHRPGroup{} this.Id = id this.Url = url this.Display = display this.Protocol = protocol this.GroupId = groupId - this.Created = created - this.LastUpdated = lastUpdated this.IpAddresses = ipAddresses return &this } @@ -448,18 +446,16 @@ func (o *FHRPGroup) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *FHRPGroup) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *FHRPGroup) GetCreatedOk() (*time.Time, bool) { @@ -469,24 +465,39 @@ func (o *FHRPGroup) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *FHRPGroup) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *FHRPGroup) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *FHRPGroup) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *FHRPGroup) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *FHRPGroup) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *FHRPGroup) GetLastUpdatedOk() (*time.Time, bool) { @@ -496,11 +507,28 @@ func (o *FHRPGroup) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *FHRPGroup) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *FHRPGroup) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *FHRPGroup) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *FHRPGroup) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetIpAddresses returns the IpAddresses field value func (o *FHRPGroup) GetIpAddresses() []BriefIPAddress { @@ -566,8 +594,12 @@ func (o FHRPGroup) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["ip_addresses"] = o.IpAddresses for key, value := range o.AdditionalProperties { @@ -587,8 +619,6 @@ func (o *FHRPGroup) UnmarshalJSON(data []byte) (err error) { "display", "protocol", "group_id", - "created", - "last_updated", "ip_addresses", } diff --git a/netbox/model_fhrp_group_assignment.go b/netbox/model_fhrp_group_assignment.go index f46100065..bcc40c88c 100644 --- a/netbox/model_fhrp_group_assignment.go +++ b/netbox/model_fhrp_group_assignment.go @@ -27,10 +27,10 @@ type FHRPGroupAssignment struct { Group BriefFHRPGroup `json:"group"` InterfaceType string `json:"interface_type"` InterfaceId int64 `json:"interface_id"` - Interface interface{} `json:"interface"` + Interface interface{} `json:"interface,omitempty"` Priority int32 `json:"priority"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -40,7 +40,7 @@ type _FHRPGroupAssignment FHRPGroupAssignment // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewFHRPGroupAssignment(id int32, url string, display string, group BriefFHRPGroup, interfaceType string, interfaceId int64, interface_ interface{}, priority int32, created NullableTime, lastUpdated NullableTime) *FHRPGroupAssignment { +func NewFHRPGroupAssignment(id int32, url string, display string, group BriefFHRPGroup, interfaceType string, interfaceId int64, priority int32) *FHRPGroupAssignment { this := FHRPGroupAssignment{} this.Id = id this.Url = url @@ -48,10 +48,7 @@ func NewFHRPGroupAssignment(id int32, url string, display string, group BriefFHR this.Group = group this.InterfaceType = interfaceType this.InterfaceId = interfaceId - this.Interface = interface_ this.Priority = priority - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -213,18 +210,16 @@ func (o *FHRPGroupAssignment) SetInterfaceId(v int64) { } -// GetInterface returns the Interface field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetInterface returns the Interface field value if set, zero value otherwise (both if not set or set to explicit null). func (o *FHRPGroupAssignment) GetInterface() interface{} { if o == nil { var ret interface{} return ret } - return o.Interface } -// GetInterfaceOk returns a tuple with the Interface field value +// GetInterfaceOk returns a tuple with the Interface field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *FHRPGroupAssignment) GetInterfaceOk() (*interface{}, bool) { @@ -234,12 +229,20 @@ func (o *FHRPGroupAssignment) GetInterfaceOk() (*interface{}, bool) { return &o.Interface, true } -// SetInterface sets field value +// HasInterface returns a boolean if a field has been set. +func (o *FHRPGroupAssignment) HasInterface() bool { + if o != nil && !IsNil(o.Interface) { + return true + } + + return false +} + +// SetInterface gets a reference to the given interface{} and assigns it to the Interface field. func (o *FHRPGroupAssignment) SetInterface(v interface{}) { o.Interface = v } - // GetPriority returns the Priority field value func (o *FHRPGroupAssignment) GetPriority() int32 { if o == nil { @@ -265,18 +268,16 @@ func (o *FHRPGroupAssignment) SetPriority(v int32) { } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *FHRPGroupAssignment) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *FHRPGroupAssignment) GetCreatedOk() (*time.Time, bool) { @@ -286,24 +287,39 @@ func (o *FHRPGroupAssignment) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *FHRPGroupAssignment) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *FHRPGroupAssignment) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *FHRPGroupAssignment) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *FHRPGroupAssignment) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *FHRPGroupAssignment) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *FHRPGroupAssignment) GetLastUpdatedOk() (*time.Time, bool) { @@ -313,11 +329,28 @@ func (o *FHRPGroupAssignment) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *FHRPGroupAssignment) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *FHRPGroupAssignment) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *FHRPGroupAssignment) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *FHRPGroupAssignment) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o FHRPGroupAssignment) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -339,8 +372,12 @@ func (o FHRPGroupAssignment) ToMap() (map[string]interface{}, error) { toSerialize["interface"] = o.Interface } toSerialize["priority"] = o.Priority - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -360,10 +397,7 @@ func (o *FHRPGroupAssignment) UnmarshalJSON(data []byte) (err error) { "group", "interface_type", "interface_id", - "interface", "priority", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_front_port.go b/netbox/model_front_port.go index 125925734..b9fa3c69d 100644 --- a/netbox/model_front_port.go +++ b/netbox/model_front_port.go @@ -38,15 +38,15 @@ type FrontPort struct { Description *string `json:"description,omitempty"` // Treat as if a cable is connected MarkConnected *bool `json:"mark_connected,omitempty"` - Cable NullableBriefCable `json:"cable"` + Cable NullableBriefCable `json:"cable,omitempty"` CableEnd string `json:"cable_end"` LinkPeers []interface{} `json:"link_peers"` // Return the type of the peer link terminations, or None. - LinkPeersType NullableString `json:"link_peers_type"` + LinkPeersType NullableString `json:"link_peers_type,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` Occupied bool `json:"_occupied"` AdditionalProperties map[string]interface{} } @@ -57,7 +57,7 @@ type _FrontPort FrontPort // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewFrontPort(id int32, url string, display string, device BriefDevice, name string, type_ FrontPortType, rearPort FrontPortRearPort, cable NullableBriefCable, cableEnd string, linkPeers []interface{}, linkPeersType NullableString, created NullableTime, lastUpdated NullableTime, occupied bool) *FrontPort { +func NewFrontPort(id int32, url string, display string, device BriefDevice, name string, type_ FrontPortType, rearPort FrontPortRearPort, cableEnd string, linkPeers []interface{}, occupied bool) *FrontPort { this := FrontPort{} this.Id = id this.Url = url @@ -68,12 +68,8 @@ func NewFrontPort(id int32, url string, display string, device BriefDevice, name this.RearPort = rearPort var rearPortPosition int32 = 1 this.RearPortPosition = &rearPortPosition - this.Cable = cable this.CableEnd = cableEnd this.LinkPeers = linkPeers - this.LinkPeersType = linkPeersType - this.Created = created - this.LastUpdated = lastUpdated this.Occupied = occupied return &this } @@ -497,18 +493,16 @@ func (o *FrontPort) SetMarkConnected(v bool) { o.MarkConnected = &v } -// GetCable returns the Cable field value -// If the value is explicit nil, the zero value for BriefCable will be returned +// GetCable returns the Cable field value if set, zero value otherwise (both if not set or set to explicit null). func (o *FrontPort) GetCable() BriefCable { - if o == nil || o.Cable.Get() == nil { + if o == nil || IsNil(o.Cable.Get()) { var ret BriefCable return ret } - return *o.Cable.Get() } -// GetCableOk returns a tuple with the Cable field value +// GetCableOk returns a tuple with the Cable field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *FrontPort) GetCableOk() (*BriefCable, bool) { @@ -518,11 +512,28 @@ func (o *FrontPort) GetCableOk() (*BriefCable, bool) { return o.Cable.Get(), o.Cable.IsSet() } -// SetCable sets field value +// HasCable returns a boolean if a field has been set. +func (o *FrontPort) HasCable() bool { + if o != nil && o.Cable.IsSet() { + return true + } + + return false +} + +// SetCable gets a reference to the given NullableBriefCable and assigns it to the Cable field. func (o *FrontPort) SetCable(v BriefCable) { o.Cable.Set(&v) } +// SetCableNil sets the value for Cable to be an explicit nil +func (o *FrontPort) SetCableNil() { + o.Cable.Set(nil) +} +// UnsetCable ensures that no value is present for Cable, not even an explicit nil +func (o *FrontPort) UnsetCable() { + o.Cable.Unset() +} // GetCableEnd returns the CableEnd field value func (o *FrontPort) GetCableEnd() string { @@ -574,18 +585,16 @@ func (o *FrontPort) SetLinkPeers(v []interface{}) { } -// GetLinkPeersType returns the LinkPeersType field value -// If the value is explicit nil, the zero value for string will be returned +// GetLinkPeersType returns the LinkPeersType field value if set, zero value otherwise (both if not set or set to explicit null). func (o *FrontPort) GetLinkPeersType() string { - if o == nil || o.LinkPeersType.Get() == nil { + if o == nil || IsNil(o.LinkPeersType.Get()) { var ret string return ret } - return *o.LinkPeersType.Get() } -// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value +// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *FrontPort) GetLinkPeersTypeOk() (*string, bool) { @@ -595,11 +604,28 @@ func (o *FrontPort) GetLinkPeersTypeOk() (*string, bool) { return o.LinkPeersType.Get(), o.LinkPeersType.IsSet() } -// SetLinkPeersType sets field value +// HasLinkPeersType returns a boolean if a field has been set. +func (o *FrontPort) HasLinkPeersType() bool { + if o != nil && o.LinkPeersType.IsSet() { + return true + } + + return false +} + +// SetLinkPeersType gets a reference to the given NullableString and assigns it to the LinkPeersType field. func (o *FrontPort) SetLinkPeersType(v string) { o.LinkPeersType.Set(&v) } +// SetLinkPeersTypeNil sets the value for LinkPeersType to be an explicit nil +func (o *FrontPort) SetLinkPeersTypeNil() { + o.LinkPeersType.Set(nil) +} +// UnsetLinkPeersType ensures that no value is present for LinkPeersType, not even an explicit nil +func (o *FrontPort) UnsetLinkPeersType() { + o.LinkPeersType.Unset() +} // GetTags returns the Tags field value if set, zero value otherwise. func (o *FrontPort) GetTags() []NestedTag { @@ -665,18 +691,16 @@ func (o *FrontPort) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *FrontPort) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *FrontPort) GetCreatedOk() (*time.Time, bool) { @@ -686,24 +710,39 @@ func (o *FrontPort) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *FrontPort) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *FrontPort) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *FrontPort) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *FrontPort) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *FrontPort) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *FrontPort) GetLastUpdatedOk() (*time.Time, bool) { @@ -713,11 +752,28 @@ func (o *FrontPort) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *FrontPort) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *FrontPort) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *FrontPort) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *FrontPort) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetOccupied returns the Occupied field value func (o *FrontPort) GetOccupied() bool { @@ -782,18 +838,26 @@ func (o FrontPort) ToMap() (map[string]interface{}, error) { if !IsNil(o.MarkConnected) { toSerialize["mark_connected"] = o.MarkConnected } - toSerialize["cable"] = o.Cable.Get() + if o.Cable.IsSet() { + toSerialize["cable"] = o.Cable.Get() + } toSerialize["cable_end"] = o.CableEnd toSerialize["link_peers"] = o.LinkPeers - toSerialize["link_peers_type"] = o.LinkPeersType.Get() + if o.LinkPeersType.IsSet() { + toSerialize["link_peers_type"] = o.LinkPeersType.Get() + } if !IsNil(o.Tags) { toSerialize["tags"] = o.Tags } if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["_occupied"] = o.Occupied for key, value := range o.AdditionalProperties { @@ -815,12 +879,8 @@ func (o *FrontPort) UnmarshalJSON(data []byte) (err error) { "name", "type", "rear_port", - "cable", "cable_end", "link_peers", - "link_peers_type", - "created", - "last_updated", "_occupied", } diff --git a/netbox/model_front_port_template.go b/netbox/model_front_port_template.go index f92372825..fad39a925 100644 --- a/netbox/model_front_port_template.go +++ b/netbox/model_front_port_template.go @@ -35,8 +35,8 @@ type FrontPortTemplate struct { RearPort BriefRearPortTemplate `json:"rear_port"` RearPortPosition *int32 `json:"rear_port_position,omitempty"` Description *string `json:"description,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -46,7 +46,7 @@ type _FrontPortTemplate FrontPortTemplate // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewFrontPortTemplate(id int32, url string, display string, name string, type_ FrontPortType, rearPort BriefRearPortTemplate, created NullableTime, lastUpdated NullableTime) *FrontPortTemplate { +func NewFrontPortTemplate(id int32, url string, display string, name string, type_ FrontPortType, rearPort BriefRearPortTemplate) *FrontPortTemplate { this := FrontPortTemplate{} this.Id = id this.Url = url @@ -56,8 +56,6 @@ func NewFrontPortTemplate(id int32, url string, display string, name string, typ this.RearPort = rearPort var rearPortPosition int32 = 1 this.RearPortPosition = &rearPortPosition - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -433,18 +431,16 @@ func (o *FrontPortTemplate) SetDescription(v string) { o.Description = &v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *FrontPortTemplate) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *FrontPortTemplate) GetCreatedOk() (*time.Time, bool) { @@ -454,24 +450,39 @@ func (o *FrontPortTemplate) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *FrontPortTemplate) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *FrontPortTemplate) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *FrontPortTemplate) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *FrontPortTemplate) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *FrontPortTemplate) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *FrontPortTemplate) GetLastUpdatedOk() (*time.Time, bool) { @@ -481,11 +492,28 @@ func (o *FrontPortTemplate) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *FrontPortTemplate) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *FrontPortTemplate) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *FrontPortTemplate) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *FrontPortTemplate) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o FrontPortTemplate) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -521,8 +549,12 @@ func (o FrontPortTemplate) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -542,8 +574,6 @@ func (o *FrontPortTemplate) UnmarshalJSON(data []byte) (err error) { "name", "type", "rear_port", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_generic_object.go b/netbox/model_generic_object.go index 04fba21d8..779466ca8 100644 --- a/netbox/model_generic_object.go +++ b/netbox/model_generic_object.go @@ -22,7 +22,7 @@ var _ MappedNullable = &GenericObject{} type GenericObject struct { ObjectType string `json:"object_type"` ObjectId int32 `json:"object_id"` - Object interface{} `json:"object"` + Object interface{} `json:"object,omitempty"` AdditionalProperties map[string]interface{} } @@ -32,11 +32,10 @@ type _GenericObject GenericObject // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewGenericObject(objectType string, objectId int32, object interface{}) *GenericObject { +func NewGenericObject(objectType string, objectId int32) *GenericObject { this := GenericObject{} this.ObjectType = objectType this.ObjectId = objectId - this.Object = object return &this } @@ -98,18 +97,16 @@ func (o *GenericObject) SetObjectId(v int32) { } -// GetObject returns the Object field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetObject returns the Object field value if set, zero value otherwise (both if not set or set to explicit null). func (o *GenericObject) GetObject() interface{} { if o == nil { var ret interface{} return ret } - return o.Object } -// GetObjectOk returns a tuple with the Object field value +// GetObjectOk returns a tuple with the Object field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *GenericObject) GetObjectOk() (*interface{}, bool) { @@ -119,12 +116,20 @@ func (o *GenericObject) GetObjectOk() (*interface{}, bool) { return &o.Object, true } -// SetObject sets field value +// HasObject returns a boolean if a field has been set. +func (o *GenericObject) HasObject() bool { + if o != nil && !IsNil(o.Object) { + return true + } + + return false +} + +// SetObject gets a reference to the given interface{} and assigns it to the Object field. func (o *GenericObject) SetObject(v interface{}) { o.Object = v } - func (o GenericObject) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { @@ -155,7 +160,6 @@ func (o *GenericObject) UnmarshalJSON(data []byte) (err error) { requiredProperties := []string{ "object_type", "object_id", - "object", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_ike_policy.go b/netbox/model_ike_policy.go index fa1ec4a40..1a7d119fb 100644 --- a/netbox/model_ike_policy.go +++ b/netbox/model_ike_policy.go @@ -34,8 +34,8 @@ type IKEPolicy struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -45,15 +45,13 @@ type _IKEPolicy IKEPolicy // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewIKEPolicy(id int32, url string, display string, name string, version IKEPolicyVersion, created NullableTime, lastUpdated NullableTime) *IKEPolicy { +func NewIKEPolicy(id int32, url string, display string, name string, version IKEPolicyVersion) *IKEPolicy { this := IKEPolicy{} this.Id = id this.Url = url this.Display = display this.Name = name this.Version = version - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -446,18 +444,16 @@ func (o *IKEPolicy) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *IKEPolicy) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *IKEPolicy) GetCreatedOk() (*time.Time, bool) { @@ -467,24 +463,39 @@ func (o *IKEPolicy) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *IKEPolicy) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *IKEPolicy) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *IKEPolicy) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *IKEPolicy) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *IKEPolicy) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *IKEPolicy) GetLastUpdatedOk() (*time.Time, bool) { @@ -494,11 +505,28 @@ func (o *IKEPolicy) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *IKEPolicy) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *IKEPolicy) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *IKEPolicy) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *IKEPolicy) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o IKEPolicy) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -539,8 +567,12 @@ func (o IKEPolicy) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -559,8 +591,6 @@ func (o *IKEPolicy) UnmarshalJSON(data []byte) (err error) { "display", "name", "version", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_ike_proposal.go b/netbox/model_ike_proposal.go index 4236b0993..398ce2a88 100644 --- a/netbox/model_ike_proposal.go +++ b/netbox/model_ike_proposal.go @@ -36,8 +36,8 @@ type IKEProposal struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -47,7 +47,7 @@ type _IKEProposal IKEProposal // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewIKEProposal(id int32, url string, display string, name string, authenticationMethod IKEProposalAuthenticationMethod, encryptionAlgorithm IKEProposalEncryptionAlgorithm, group IKEProposalGroup, created NullableTime, lastUpdated NullableTime) *IKEProposal { +func NewIKEProposal(id int32, url string, display string, name string, authenticationMethod IKEProposalAuthenticationMethod, encryptionAlgorithm IKEProposalEncryptionAlgorithm, group IKEProposalGroup) *IKEProposal { this := IKEProposal{} this.Id = id this.Url = url @@ -56,8 +56,6 @@ func NewIKEProposal(id int32, url string, display string, name string, authentic this.AuthenticationMethod = authenticationMethod this.EncryptionAlgorithm = encryptionAlgorithm this.Group = group - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -478,18 +476,16 @@ func (o *IKEProposal) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *IKEProposal) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *IKEProposal) GetCreatedOk() (*time.Time, bool) { @@ -499,24 +495,39 @@ func (o *IKEProposal) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *IKEProposal) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *IKEProposal) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *IKEProposal) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *IKEProposal) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *IKEProposal) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *IKEProposal) GetLastUpdatedOk() (*time.Time, bool) { @@ -526,11 +537,28 @@ func (o *IKEProposal) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *IKEProposal) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *IKEProposal) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *IKEProposal) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *IKEProposal) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o IKEProposal) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -570,8 +598,12 @@ func (o IKEProposal) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -592,8 +624,6 @@ func (o *IKEProposal) UnmarshalJSON(data []byte) (err error) { "authentication_method", "encryption_algorithm", "group", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_image_attachment.go b/netbox/model_image_attachment.go index 42fe4057e..86772f8cd 100644 --- a/netbox/model_image_attachment.go +++ b/netbox/model_image_attachment.go @@ -26,13 +26,13 @@ type ImageAttachment struct { Display string `json:"display"` ObjectType string `json:"object_type"` ObjectId int64 `json:"object_id"` - Parent interface{} `json:"parent"` + Parent interface{} `json:"parent,omitempty"` Name *string `json:"name,omitempty"` Image string `json:"image"` ImageHeight int32 `json:"image_height"` ImageWidth int32 `json:"image_width"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -42,19 +42,16 @@ type _ImageAttachment ImageAttachment // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewImageAttachment(id int32, url string, display string, objectType string, objectId int64, parent interface{}, image string, imageHeight int32, imageWidth int32, created NullableTime, lastUpdated NullableTime) *ImageAttachment { +func NewImageAttachment(id int32, url string, display string, objectType string, objectId int64, image string, imageHeight int32, imageWidth int32) *ImageAttachment { this := ImageAttachment{} this.Id = id this.Url = url this.Display = display this.ObjectType = objectType this.ObjectId = objectId - this.Parent = parent this.Image = image this.ImageHeight = imageHeight this.ImageWidth = imageWidth - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -191,18 +188,16 @@ func (o *ImageAttachment) SetObjectId(v int64) { } -// GetParent returns the Parent field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ImageAttachment) GetParent() interface{} { if o == nil { var ret interface{} return ret } - return o.Parent } -// GetParentOk returns a tuple with the Parent field value +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ImageAttachment) GetParentOk() (*interface{}, bool) { @@ -212,12 +207,20 @@ func (o *ImageAttachment) GetParentOk() (*interface{}, bool) { return &o.Parent, true } -// SetParent sets field value +// HasParent returns a boolean if a field has been set. +func (o *ImageAttachment) HasParent() bool { + if o != nil && !IsNil(o.Parent) { + return true + } + + return false +} + +// SetParent gets a reference to the given interface{} and assigns it to the Parent field. func (o *ImageAttachment) SetParent(v interface{}) { o.Parent = v } - // GetName returns the Name field value if set, zero value otherwise. func (o *ImageAttachment) GetName() string { if o == nil || IsNil(o.Name) { @@ -325,18 +328,16 @@ func (o *ImageAttachment) SetImageWidth(v int32) { } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ImageAttachment) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ImageAttachment) GetCreatedOk() (*time.Time, bool) { @@ -346,24 +347,39 @@ func (o *ImageAttachment) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ImageAttachment) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ImageAttachment) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ImageAttachment) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ImageAttachment) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ImageAttachment) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ImageAttachment) GetLastUpdatedOk() (*time.Time, bool) { @@ -373,11 +389,28 @@ func (o *ImageAttachment) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ImageAttachment) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ImageAttachment) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ImageAttachment) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ImageAttachment) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o ImageAttachment) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -403,8 +436,12 @@ func (o ImageAttachment) ToMap() (map[string]interface{}, error) { toSerialize["image"] = o.Image toSerialize["image_height"] = o.ImageHeight toSerialize["image_width"] = o.ImageWidth - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -423,12 +460,9 @@ func (o *ImageAttachment) UnmarshalJSON(data []byte) (err error) { "display", "object_type", "object_id", - "parent", "image", "image_height", "image_width", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_interface.go b/netbox/model_interface.go index 8bd313c6a..aab075c42 100644 --- a/netbox/model_interface.go +++ b/netbox/model_interface.go @@ -58,22 +58,22 @@ type Interface struct { TaggedVlans []VLAN `json:"tagged_vlans,omitempty"` // Treat as if a cable is connected MarkConnected *bool `json:"mark_connected,omitempty"` - Cable NullableBriefCable `json:"cable"` + Cable NullableBriefCable `json:"cable,omitempty"` CableEnd string `json:"cable_end"` - WirelessLink NullableNestedWirelessLink `json:"wireless_link"` + WirelessLink NullableNestedWirelessLink `json:"wireless_link,omitempty"` LinkPeers []interface{} `json:"link_peers"` // Return the type of the peer link terminations, or None. - LinkPeersType NullableString `json:"link_peers_type"` + LinkPeersType NullableString `json:"link_peers_type,omitempty"` WirelessLans []WirelessLAN `json:"wireless_lans,omitempty"` Vrf NullableBriefVRF `json:"vrf,omitempty"` - L2vpnTermination NullableBriefL2VPNTermination `json:"l2vpn_termination"` - ConnectedEndpoints []interface{} `json:"connected_endpoints"` - ConnectedEndpointsType NullableString `json:"connected_endpoints_type"` + L2vpnTermination NullableBriefL2VPNTermination `json:"l2vpn_termination,omitempty"` + ConnectedEndpoints []interface{} `json:"connected_endpoints,omitempty"` + ConnectedEndpointsType NullableString `json:"connected_endpoints_type,omitempty"` ConnectedEndpointsReachable bool `json:"connected_endpoints_reachable"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` CountIpaddresses int32 `json:"count_ipaddresses"` CountFhrpGroups int32 `json:"count_fhrp_groups"` Occupied bool `json:"_occupied"` @@ -86,7 +86,7 @@ type _Interface Interface // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInterface(id int32, url string, display string, device BriefDevice, name string, type_ InterfaceType, cable NullableBriefCable, cableEnd string, wirelessLink NullableNestedWirelessLink, linkPeers []interface{}, linkPeersType NullableString, l2vpnTermination NullableBriefL2VPNTermination, connectedEndpoints []interface{}, connectedEndpointsType NullableString, connectedEndpointsReachable bool, created NullableTime, lastUpdated NullableTime, countIpaddresses int32, countFhrpGroups int32, occupied bool) *Interface { +func NewInterface(id int32, url string, display string, device BriefDevice, name string, type_ InterfaceType, cableEnd string, linkPeers []interface{}, connectedEndpointsReachable bool, countIpaddresses int32, countFhrpGroups int32, occupied bool) *Interface { this := Interface{} this.Id = id this.Url = url @@ -94,17 +94,9 @@ func NewInterface(id int32, url string, display string, device BriefDevice, name this.Device = device this.Name = name this.Type = type_ - this.Cable = cable this.CableEnd = cableEnd - this.WirelessLink = wirelessLink this.LinkPeers = linkPeers - this.LinkPeersType = linkPeersType - this.L2vpnTermination = l2vpnTermination - this.ConnectedEndpoints = connectedEndpoints - this.ConnectedEndpointsType = connectedEndpointsType this.ConnectedEndpointsReachable = connectedEndpointsReachable - this.Created = created - this.LastUpdated = lastUpdated this.CountIpaddresses = countIpaddresses this.CountFhrpGroups = countFhrpGroups this.Occupied = occupied @@ -1231,18 +1223,16 @@ func (o *Interface) SetMarkConnected(v bool) { o.MarkConnected = &v } -// GetCable returns the Cable field value -// If the value is explicit nil, the zero value for BriefCable will be returned +// GetCable returns the Cable field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Interface) GetCable() BriefCable { - if o == nil || o.Cable.Get() == nil { + if o == nil || IsNil(o.Cable.Get()) { var ret BriefCable return ret } - return *o.Cable.Get() } -// GetCableOk returns a tuple with the Cable field value +// GetCableOk returns a tuple with the Cable field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Interface) GetCableOk() (*BriefCable, bool) { @@ -1252,11 +1242,28 @@ func (o *Interface) GetCableOk() (*BriefCable, bool) { return o.Cable.Get(), o.Cable.IsSet() } -// SetCable sets field value +// HasCable returns a boolean if a field has been set. +func (o *Interface) HasCable() bool { + if o != nil && o.Cable.IsSet() { + return true + } + + return false +} + +// SetCable gets a reference to the given NullableBriefCable and assigns it to the Cable field. func (o *Interface) SetCable(v BriefCable) { o.Cable.Set(&v) } +// SetCableNil sets the value for Cable to be an explicit nil +func (o *Interface) SetCableNil() { + o.Cable.Set(nil) +} +// UnsetCable ensures that no value is present for Cable, not even an explicit nil +func (o *Interface) UnsetCable() { + o.Cable.Unset() +} // GetCableEnd returns the CableEnd field value func (o *Interface) GetCableEnd() string { @@ -1283,18 +1290,16 @@ func (o *Interface) SetCableEnd(v string) { } -// GetWirelessLink returns the WirelessLink field value -// If the value is explicit nil, the zero value for NestedWirelessLink will be returned +// GetWirelessLink returns the WirelessLink field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Interface) GetWirelessLink() NestedWirelessLink { - if o == nil || o.WirelessLink.Get() == nil { + if o == nil || IsNil(o.WirelessLink.Get()) { var ret NestedWirelessLink return ret } - return *o.WirelessLink.Get() } -// GetWirelessLinkOk returns a tuple with the WirelessLink field value +// GetWirelessLinkOk returns a tuple with the WirelessLink field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Interface) GetWirelessLinkOk() (*NestedWirelessLink, bool) { @@ -1304,11 +1309,28 @@ func (o *Interface) GetWirelessLinkOk() (*NestedWirelessLink, bool) { return o.WirelessLink.Get(), o.WirelessLink.IsSet() } -// SetWirelessLink sets field value +// HasWirelessLink returns a boolean if a field has been set. +func (o *Interface) HasWirelessLink() bool { + if o != nil && o.WirelessLink.IsSet() { + return true + } + + return false +} + +// SetWirelessLink gets a reference to the given NullableNestedWirelessLink and assigns it to the WirelessLink field. func (o *Interface) SetWirelessLink(v NestedWirelessLink) { o.WirelessLink.Set(&v) } +// SetWirelessLinkNil sets the value for WirelessLink to be an explicit nil +func (o *Interface) SetWirelessLinkNil() { + o.WirelessLink.Set(nil) +} +// UnsetWirelessLink ensures that no value is present for WirelessLink, not even an explicit nil +func (o *Interface) UnsetWirelessLink() { + o.WirelessLink.Unset() +} // GetLinkPeers returns the LinkPeers field value func (o *Interface) GetLinkPeers() []interface{} { @@ -1335,18 +1357,16 @@ func (o *Interface) SetLinkPeers(v []interface{}) { } -// GetLinkPeersType returns the LinkPeersType field value -// If the value is explicit nil, the zero value for string will be returned +// GetLinkPeersType returns the LinkPeersType field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Interface) GetLinkPeersType() string { - if o == nil || o.LinkPeersType.Get() == nil { + if o == nil || IsNil(o.LinkPeersType.Get()) { var ret string return ret } - return *o.LinkPeersType.Get() } -// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value +// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Interface) GetLinkPeersTypeOk() (*string, bool) { @@ -1356,11 +1376,28 @@ func (o *Interface) GetLinkPeersTypeOk() (*string, bool) { return o.LinkPeersType.Get(), o.LinkPeersType.IsSet() } -// SetLinkPeersType sets field value +// HasLinkPeersType returns a boolean if a field has been set. +func (o *Interface) HasLinkPeersType() bool { + if o != nil && o.LinkPeersType.IsSet() { + return true + } + + return false +} + +// SetLinkPeersType gets a reference to the given NullableString and assigns it to the LinkPeersType field. func (o *Interface) SetLinkPeersType(v string) { o.LinkPeersType.Set(&v) } +// SetLinkPeersTypeNil sets the value for LinkPeersType to be an explicit nil +func (o *Interface) SetLinkPeersTypeNil() { + o.LinkPeersType.Set(nil) +} +// UnsetLinkPeersType ensures that no value is present for LinkPeersType, not even an explicit nil +func (o *Interface) UnsetLinkPeersType() { + o.LinkPeersType.Unset() +} // GetWirelessLans returns the WirelessLans field value if set, zero value otherwise. func (o *Interface) GetWirelessLans() []WirelessLAN { @@ -1436,18 +1473,16 @@ func (o *Interface) UnsetVrf() { o.Vrf.Unset() } -// GetL2vpnTermination returns the L2vpnTermination field value -// If the value is explicit nil, the zero value for BriefL2VPNTermination will be returned +// GetL2vpnTermination returns the L2vpnTermination field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Interface) GetL2vpnTermination() BriefL2VPNTermination { - if o == nil || o.L2vpnTermination.Get() == nil { + if o == nil || IsNil(o.L2vpnTermination.Get()) { var ret BriefL2VPNTermination return ret } - return *o.L2vpnTermination.Get() } -// GetL2vpnTerminationOk returns a tuple with the L2vpnTermination field value +// GetL2vpnTerminationOk returns a tuple with the L2vpnTermination field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Interface) GetL2vpnTerminationOk() (*BriefL2VPNTermination, bool) { @@ -1457,24 +1492,39 @@ func (o *Interface) GetL2vpnTerminationOk() (*BriefL2VPNTermination, bool) { return o.L2vpnTermination.Get(), o.L2vpnTermination.IsSet() } -// SetL2vpnTermination sets field value +// HasL2vpnTermination returns a boolean if a field has been set. +func (o *Interface) HasL2vpnTermination() bool { + if o != nil && o.L2vpnTermination.IsSet() { + return true + } + + return false +} + +// SetL2vpnTermination gets a reference to the given NullableBriefL2VPNTermination and assigns it to the L2vpnTermination field. func (o *Interface) SetL2vpnTermination(v BriefL2VPNTermination) { o.L2vpnTermination.Set(&v) } +// SetL2vpnTerminationNil sets the value for L2vpnTermination to be an explicit nil +func (o *Interface) SetL2vpnTerminationNil() { + o.L2vpnTermination.Set(nil) +} +// UnsetL2vpnTermination ensures that no value is present for L2vpnTermination, not even an explicit nil +func (o *Interface) UnsetL2vpnTermination() { + o.L2vpnTermination.Unset() +} -// GetConnectedEndpoints returns the ConnectedEndpoints field value -// If the value is explicit nil, the zero value for []interface{} will be returned +// GetConnectedEndpoints returns the ConnectedEndpoints field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Interface) GetConnectedEndpoints() []interface{} { if o == nil { var ret []interface{} return ret } - return o.ConnectedEndpoints } -// GetConnectedEndpointsOk returns a tuple with the ConnectedEndpoints field value +// GetConnectedEndpointsOk returns a tuple with the ConnectedEndpoints field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Interface) GetConnectedEndpointsOk() ([]interface{}, bool) { @@ -1484,24 +1534,30 @@ func (o *Interface) GetConnectedEndpointsOk() ([]interface{}, bool) { return o.ConnectedEndpoints, true } -// SetConnectedEndpoints sets field value +// HasConnectedEndpoints returns a boolean if a field has been set. +func (o *Interface) HasConnectedEndpoints() bool { + if o != nil && !IsNil(o.ConnectedEndpoints) { + return true + } + + return false +} + +// SetConnectedEndpoints gets a reference to the given []interface{} and assigns it to the ConnectedEndpoints field. func (o *Interface) SetConnectedEndpoints(v []interface{}) { o.ConnectedEndpoints = v } - -// GetConnectedEndpointsType returns the ConnectedEndpointsType field value -// If the value is explicit nil, the zero value for string will be returned +// GetConnectedEndpointsType returns the ConnectedEndpointsType field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Interface) GetConnectedEndpointsType() string { - if o == nil || o.ConnectedEndpointsType.Get() == nil { + if o == nil || IsNil(o.ConnectedEndpointsType.Get()) { var ret string return ret } - return *o.ConnectedEndpointsType.Get() } -// GetConnectedEndpointsTypeOk returns a tuple with the ConnectedEndpointsType field value +// GetConnectedEndpointsTypeOk returns a tuple with the ConnectedEndpointsType field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Interface) GetConnectedEndpointsTypeOk() (*string, bool) { @@ -1511,11 +1567,28 @@ func (o *Interface) GetConnectedEndpointsTypeOk() (*string, bool) { return o.ConnectedEndpointsType.Get(), o.ConnectedEndpointsType.IsSet() } -// SetConnectedEndpointsType sets field value +// HasConnectedEndpointsType returns a boolean if a field has been set. +func (o *Interface) HasConnectedEndpointsType() bool { + if o != nil && o.ConnectedEndpointsType.IsSet() { + return true + } + + return false +} + +// SetConnectedEndpointsType gets a reference to the given NullableString and assigns it to the ConnectedEndpointsType field. func (o *Interface) SetConnectedEndpointsType(v string) { o.ConnectedEndpointsType.Set(&v) } +// SetConnectedEndpointsTypeNil sets the value for ConnectedEndpointsType to be an explicit nil +func (o *Interface) SetConnectedEndpointsTypeNil() { + o.ConnectedEndpointsType.Set(nil) +} +// UnsetConnectedEndpointsType ensures that no value is present for ConnectedEndpointsType, not even an explicit nil +func (o *Interface) UnsetConnectedEndpointsType() { + o.ConnectedEndpointsType.Unset() +} // GetConnectedEndpointsReachable returns the ConnectedEndpointsReachable field value func (o *Interface) GetConnectedEndpointsReachable() bool { @@ -1606,18 +1679,16 @@ func (o *Interface) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Interface) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Interface) GetCreatedOk() (*time.Time, bool) { @@ -1627,24 +1698,39 @@ func (o *Interface) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Interface) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Interface) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Interface) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Interface) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Interface) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Interface) GetLastUpdatedOk() (*time.Time, bool) { @@ -1654,11 +1740,28 @@ func (o *Interface) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Interface) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Interface) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Interface) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Interface) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetCountIpaddresses returns the CountIpaddresses field value func (o *Interface) GetCountIpaddresses() int32 { @@ -1829,22 +1932,32 @@ func (o Interface) ToMap() (map[string]interface{}, error) { if !IsNil(o.MarkConnected) { toSerialize["mark_connected"] = o.MarkConnected } - toSerialize["cable"] = o.Cable.Get() + if o.Cable.IsSet() { + toSerialize["cable"] = o.Cable.Get() + } toSerialize["cable_end"] = o.CableEnd - toSerialize["wireless_link"] = o.WirelessLink.Get() + if o.WirelessLink.IsSet() { + toSerialize["wireless_link"] = o.WirelessLink.Get() + } toSerialize["link_peers"] = o.LinkPeers - toSerialize["link_peers_type"] = o.LinkPeersType.Get() + if o.LinkPeersType.IsSet() { + toSerialize["link_peers_type"] = o.LinkPeersType.Get() + } if !IsNil(o.WirelessLans) { toSerialize["wireless_lans"] = o.WirelessLans } if o.Vrf.IsSet() { toSerialize["vrf"] = o.Vrf.Get() } - toSerialize["l2vpn_termination"] = o.L2vpnTermination.Get() + if o.L2vpnTermination.IsSet() { + toSerialize["l2vpn_termination"] = o.L2vpnTermination.Get() + } if o.ConnectedEndpoints != nil { toSerialize["connected_endpoints"] = o.ConnectedEndpoints } - toSerialize["connected_endpoints_type"] = o.ConnectedEndpointsType.Get() + if o.ConnectedEndpointsType.IsSet() { + toSerialize["connected_endpoints_type"] = o.ConnectedEndpointsType.Get() + } toSerialize["connected_endpoints_reachable"] = o.ConnectedEndpointsReachable if !IsNil(o.Tags) { toSerialize["tags"] = o.Tags @@ -1852,8 +1965,12 @@ func (o Interface) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["count_ipaddresses"] = o.CountIpaddresses toSerialize["count_fhrp_groups"] = o.CountFhrpGroups toSerialize["_occupied"] = o.Occupied @@ -1876,17 +1993,9 @@ func (o *Interface) UnmarshalJSON(data []byte) (err error) { "device", "name", "type", - "cable", "cable_end", - "wireless_link", "link_peers", - "link_peers_type", - "l2vpn_termination", - "connected_endpoints", - "connected_endpoints_type", "connected_endpoints_reachable", - "created", - "last_updated", "count_ipaddresses", "count_fhrp_groups", "_occupied", diff --git a/netbox/model_interface_template.go b/netbox/model_interface_template.go index 6d5d55948..f1e2f97fd 100644 --- a/netbox/model_interface_template.go +++ b/netbox/model_interface_template.go @@ -38,8 +38,8 @@ type InterfaceTemplate struct { PoeMode NullableInterfaceTemplatePoeMode `json:"poe_mode,omitempty"` PoeType NullableInterfaceTemplatePoeType `json:"poe_type,omitempty"` RfRole NullableInterfaceTemplateRfRole `json:"rf_role,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -49,15 +49,13 @@ type _InterfaceTemplate InterfaceTemplate // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInterfaceTemplate(id int32, url string, display string, name string, type_ InterfaceType, created NullableTime, lastUpdated NullableTime) *InterfaceTemplate { +func NewInterfaceTemplate(id int32, url string, display string, name string, type_ InterfaceType) *InterfaceTemplate { this := InterfaceTemplate{} this.Id = id this.Url = url this.Display = display this.Name = name this.Type = type_ - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -574,18 +572,16 @@ func (o *InterfaceTemplate) UnsetRfRole() { o.RfRole.Unset() } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *InterfaceTemplate) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *InterfaceTemplate) GetCreatedOk() (*time.Time, bool) { @@ -595,24 +591,39 @@ func (o *InterfaceTemplate) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *InterfaceTemplate) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *InterfaceTemplate) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *InterfaceTemplate) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *InterfaceTemplate) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *InterfaceTemplate) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *InterfaceTemplate) GetLastUpdatedOk() (*time.Time, bool) { @@ -622,11 +633,28 @@ func (o *InterfaceTemplate) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *InterfaceTemplate) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *InterfaceTemplate) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *InterfaceTemplate) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *InterfaceTemplate) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o InterfaceTemplate) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -673,8 +701,12 @@ func (o InterfaceTemplate) ToMap() (map[string]interface{}, error) { if o.RfRole.IsSet() { toSerialize["rf_role"] = o.RfRole.Get() } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -693,8 +725,6 @@ func (o *InterfaceTemplate) UnmarshalJSON(data []byte) (err error) { "display", "name", "type", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_inventory_item.go b/netbox/model_inventory_item.go index d5b93bf20..6e9210a96 100644 --- a/netbox/model_inventory_item.go +++ b/netbox/model_inventory_item.go @@ -42,11 +42,11 @@ type InventoryItem struct { Description *string `json:"description,omitempty"` ComponentType NullableString `json:"component_type,omitempty"` ComponentId NullableInt64 `json:"component_id,omitempty"` - Component interface{} `json:"component"` + Component interface{} `json:"component,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` Depth int32 `json:"_depth"` AdditionalProperties map[string]interface{} } @@ -57,16 +57,13 @@ type _InventoryItem InventoryItem // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInventoryItem(id int32, url string, display string, device BriefDevice, name string, component interface{}, created NullableTime, lastUpdated NullableTime, depth int32) *InventoryItem { +func NewInventoryItem(id int32, url string, display string, device BriefDevice, name string, depth int32) *InventoryItem { this := InventoryItem{} this.Id = id this.Url = url this.Display = display this.Device = device this.Name = name - this.Component = component - this.Created = created - this.LastUpdated = lastUpdated this.Depth = depth return &this } @@ -648,18 +645,16 @@ func (o *InventoryItem) UnsetComponentId() { o.ComponentId.Unset() } -// GetComponent returns the Component field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetComponent returns the Component field value if set, zero value otherwise (both if not set or set to explicit null). func (o *InventoryItem) GetComponent() interface{} { if o == nil { var ret interface{} return ret } - return o.Component } -// GetComponentOk returns a tuple with the Component field value +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *InventoryItem) GetComponentOk() (*interface{}, bool) { @@ -669,12 +664,20 @@ func (o *InventoryItem) GetComponentOk() (*interface{}, bool) { return &o.Component, true } -// SetComponent sets field value +// HasComponent returns a boolean if a field has been set. +func (o *InventoryItem) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given interface{} and assigns it to the Component field. func (o *InventoryItem) SetComponent(v interface{}) { o.Component = v } - // GetTags returns the Tags field value if set, zero value otherwise. func (o *InventoryItem) GetTags() []NestedTag { if o == nil || IsNil(o.Tags) { @@ -739,18 +742,16 @@ func (o *InventoryItem) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *InventoryItem) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *InventoryItem) GetCreatedOk() (*time.Time, bool) { @@ -760,24 +761,39 @@ func (o *InventoryItem) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *InventoryItem) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *InventoryItem) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *InventoryItem) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *InventoryItem) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *InventoryItem) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *InventoryItem) GetLastUpdatedOk() (*time.Time, bool) { @@ -787,11 +803,28 @@ func (o *InventoryItem) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *InventoryItem) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *InventoryItem) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *InventoryItem) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *InventoryItem) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetDepth returns the Depth field value func (o *InventoryItem) GetDepth() int32 { @@ -878,8 +911,12 @@ func (o InventoryItem) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["_depth"] = o.Depth for key, value := range o.AdditionalProperties { @@ -899,9 +936,6 @@ func (o *InventoryItem) UnmarshalJSON(data []byte) (err error) { "display", "device", "name", - "component", - "created", - "last_updated", "_depth", } diff --git a/netbox/model_inventory_item_role.go b/netbox/model_inventory_item_role.go index e7f3d5023..40081aae7 100644 --- a/netbox/model_inventory_item_role.go +++ b/netbox/model_inventory_item_role.go @@ -31,8 +31,8 @@ type InventoryItemRole struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` InventoryitemCount int64 `json:"inventoryitem_count"` AdditionalProperties map[string]interface{} } @@ -43,15 +43,13 @@ type _InventoryItemRole InventoryItemRole // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInventoryItemRole(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, inventoryitemCount int64) *InventoryItemRole { +func NewInventoryItemRole(id int32, url string, display string, name string, slug string, inventoryitemCount int64) *InventoryItemRole { this := InventoryItemRole{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated this.InventoryitemCount = inventoryitemCount return &this } @@ -349,18 +347,16 @@ func (o *InventoryItemRole) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *InventoryItemRole) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *InventoryItemRole) GetCreatedOk() (*time.Time, bool) { @@ -370,24 +366,39 @@ func (o *InventoryItemRole) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *InventoryItemRole) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *InventoryItemRole) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *InventoryItemRole) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *InventoryItemRole) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *InventoryItemRole) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *InventoryItemRole) GetLastUpdatedOk() (*time.Time, bool) { @@ -397,11 +408,28 @@ func (o *InventoryItemRole) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *InventoryItemRole) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *InventoryItemRole) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *InventoryItemRole) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *InventoryItemRole) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetInventoryitemCount returns the InventoryitemCount field value func (o *InventoryItemRole) GetInventoryitemCount() int64 { @@ -458,8 +486,12 @@ func (o InventoryItemRole) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["inventoryitem_count"] = o.InventoryitemCount for key, value := range o.AdditionalProperties { @@ -479,8 +511,6 @@ func (o *InventoryItemRole) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", "inventoryitem_count", } diff --git a/netbox/model_inventory_item_template.go b/netbox/model_inventory_item_template.go index bd1c02c9b..17b158ca4 100644 --- a/netbox/model_inventory_item_template.go +++ b/netbox/model_inventory_item_template.go @@ -37,9 +37,9 @@ type InventoryItemTemplate struct { Description *string `json:"description,omitempty"` ComponentType NullableString `json:"component_type,omitempty"` ComponentId NullableInt64 `json:"component_id,omitempty"` - Component interface{} `json:"component"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Component interface{} `json:"component,omitempty"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` Depth int32 `json:"_depth"` AdditionalProperties map[string]interface{} } @@ -50,16 +50,13 @@ type _InventoryItemTemplate InventoryItemTemplate // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInventoryItemTemplate(id int32, url string, display string, deviceType BriefDeviceType, name string, component interface{}, created NullableTime, lastUpdated NullableTime, depth int32) *InventoryItemTemplate { +func NewInventoryItemTemplate(id int32, url string, display string, deviceType BriefDeviceType, name string, depth int32) *InventoryItemTemplate { this := InventoryItemTemplate{} this.Id = id this.Url = url this.Display = display this.DeviceType = deviceType this.Name = name - this.Component = component - this.Created = created - this.LastUpdated = lastUpdated this.Depth = depth return &this } @@ -503,18 +500,16 @@ func (o *InventoryItemTemplate) UnsetComponentId() { o.ComponentId.Unset() } -// GetComponent returns the Component field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetComponent returns the Component field value if set, zero value otherwise (both if not set or set to explicit null). func (o *InventoryItemTemplate) GetComponent() interface{} { if o == nil { var ret interface{} return ret } - return o.Component } -// GetComponentOk returns a tuple with the Component field value +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *InventoryItemTemplate) GetComponentOk() (*interface{}, bool) { @@ -524,24 +519,30 @@ func (o *InventoryItemTemplate) GetComponentOk() (*interface{}, bool) { return &o.Component, true } -// SetComponent sets field value +// HasComponent returns a boolean if a field has been set. +func (o *InventoryItemTemplate) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given interface{} and assigns it to the Component field. func (o *InventoryItemTemplate) SetComponent(v interface{}) { o.Component = v } - -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *InventoryItemTemplate) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *InventoryItemTemplate) GetCreatedOk() (*time.Time, bool) { @@ -551,24 +552,39 @@ func (o *InventoryItemTemplate) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *InventoryItemTemplate) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *InventoryItemTemplate) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *InventoryItemTemplate) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *InventoryItemTemplate) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *InventoryItemTemplate) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *InventoryItemTemplate) GetLastUpdatedOk() (*time.Time, bool) { @@ -578,11 +594,28 @@ func (o *InventoryItemTemplate) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *InventoryItemTemplate) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *InventoryItemTemplate) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *InventoryItemTemplate) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *InventoryItemTemplate) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetDepth returns the Depth field value func (o *InventoryItemTemplate) GetDepth() int32 { @@ -651,8 +684,12 @@ func (o InventoryItemTemplate) ToMap() (map[string]interface{}, error) { if o.Component != nil { toSerialize["component"] = o.Component } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["_depth"] = o.Depth for key, value := range o.AdditionalProperties { @@ -672,9 +709,6 @@ func (o *InventoryItemTemplate) UnmarshalJSON(data []byte) (err error) { "display", "device_type", "name", - "component", - "created", - "last_updated", "_depth", } diff --git a/netbox/model_ip_address.go b/netbox/model_ip_address.go index 63f60b248..3efca8875 100644 --- a/netbox/model_ip_address.go +++ b/netbox/model_ip_address.go @@ -33,7 +33,7 @@ type IPAddress struct { Role *IPAddressRole `json:"role,omitempty"` AssignedObjectType NullableString `json:"assigned_object_type,omitempty"` AssignedObjectId NullableInt64 `json:"assigned_object_id,omitempty"` - AssignedObject interface{} `json:"assigned_object"` + AssignedObject interface{} `json:"assigned_object,omitempty"` NatInside NullableNestedIPAddress `json:"nat_inside,omitempty"` NatOutside []NestedIPAddress `json:"nat_outside"` // Hostname or FQDN (not case-sensitive) @@ -42,8 +42,8 @@ type IPAddress struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -53,17 +53,14 @@ type _IPAddress IPAddress // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewIPAddress(id int32, url string, display string, family AggregateFamily, address string, assignedObject interface{}, natOutside []NestedIPAddress, created NullableTime, lastUpdated NullableTime) *IPAddress { +func NewIPAddress(id int32, url string, display string, family AggregateFamily, address string, natOutside []NestedIPAddress) *IPAddress { this := IPAddress{} this.Id = id this.Url = url this.Display = display this.Family = family this.Address = address - this.AssignedObject = assignedObject this.NatOutside = natOutside - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -464,18 +461,16 @@ func (o *IPAddress) UnsetAssignedObjectId() { o.AssignedObjectId.Unset() } -// GetAssignedObject returns the AssignedObject field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetAssignedObject returns the AssignedObject field value if set, zero value otherwise (both if not set or set to explicit null). func (o *IPAddress) GetAssignedObject() interface{} { if o == nil { var ret interface{} return ret } - return o.AssignedObject } -// GetAssignedObjectOk returns a tuple with the AssignedObject field value +// GetAssignedObjectOk returns a tuple with the AssignedObject field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *IPAddress) GetAssignedObjectOk() (*interface{}, bool) { @@ -485,12 +480,20 @@ func (o *IPAddress) GetAssignedObjectOk() (*interface{}, bool) { return &o.AssignedObject, true } -// SetAssignedObject sets field value +// HasAssignedObject returns a boolean if a field has been set. +func (o *IPAddress) HasAssignedObject() bool { + if o != nil && !IsNil(o.AssignedObject) { + return true + } + + return false +} + +// SetAssignedObject gets a reference to the given interface{} and assigns it to the AssignedObject field. func (o *IPAddress) SetAssignedObject(v interface{}) { o.AssignedObject = v } - // GetNatInside returns the NatInside field value if set, zero value otherwise (both if not set or set to explicit null). func (o *IPAddress) GetNatInside() NestedIPAddress { if o == nil || IsNil(o.NatInside.Get()) { @@ -718,18 +721,16 @@ func (o *IPAddress) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *IPAddress) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *IPAddress) GetCreatedOk() (*time.Time, bool) { @@ -739,24 +740,39 @@ func (o *IPAddress) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *IPAddress) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *IPAddress) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *IPAddress) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *IPAddress) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *IPAddress) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *IPAddress) GetLastUpdatedOk() (*time.Time, bool) { @@ -766,11 +782,28 @@ func (o *IPAddress) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *IPAddress) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *IPAddress) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *IPAddress) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *IPAddress) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o IPAddress) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -830,8 +863,12 @@ func (o IPAddress) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -850,10 +887,7 @@ func (o *IPAddress) UnmarshalJSON(data []byte) (err error) { "display", "family", "address", - "assigned_object", "nat_outside", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_ip_range.go b/netbox/model_ip_range.go index d4f45cd9f..222814e7c 100644 --- a/netbox/model_ip_range.go +++ b/netbox/model_ip_range.go @@ -37,8 +37,8 @@ type IPRange struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` // Treat as fully utilized MarkUtilized *bool `json:"mark_utilized,omitempty"` AdditionalProperties map[string]interface{} @@ -50,7 +50,7 @@ type _IPRange IPRange // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewIPRange(id int32, url string, display string, family AggregateFamily, startAddress string, endAddress string, size int32, created NullableTime, lastUpdated NullableTime) *IPRange { +func NewIPRange(id int32, url string, display string, family AggregateFamily, startAddress string, endAddress string, size int32) *IPRange { this := IPRange{} this.Id = id this.Url = url @@ -59,8 +59,6 @@ func NewIPRange(id int32, url string, display string, family AggregateFamily, st this.StartAddress = startAddress this.EndAddress = endAddress this.Size = size - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -565,18 +563,16 @@ func (o *IPRange) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *IPRange) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *IPRange) GetCreatedOk() (*time.Time, bool) { @@ -586,24 +582,39 @@ func (o *IPRange) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *IPRange) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *IPRange) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *IPRange) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *IPRange) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *IPRange) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *IPRange) GetLastUpdatedOk() (*time.Time, bool) { @@ -613,11 +624,28 @@ func (o *IPRange) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *IPRange) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *IPRange) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *IPRange) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *IPRange) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetMarkUtilized returns the MarkUtilized field value if set, zero value otherwise. func (o *IPRange) GetMarkUtilized() bool { @@ -695,8 +723,12 @@ func (o IPRange) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } if !IsNil(o.MarkUtilized) { toSerialize["mark_utilized"] = o.MarkUtilized } @@ -720,8 +752,6 @@ func (o *IPRange) UnmarshalJSON(data []byte) (err error) { "start_address", "end_address", "size", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_ip_sec_policy.go b/netbox/model_ip_sec_policy.go index c6814c7c0..a65c7ec66 100644 --- a/netbox/model_ip_sec_policy.go +++ b/netbox/model_ip_sec_policy.go @@ -32,8 +32,8 @@ type IPSecPolicy struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -43,14 +43,12 @@ type _IPSecPolicy IPSecPolicy // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewIPSecPolicy(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime) *IPSecPolicy { +func NewIPSecPolicy(id int32, url string, display string, name string) *IPSecPolicy { this := IPSecPolicy{} this.Id = id this.Url = url this.Display = display this.Name = name - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -386,18 +384,16 @@ func (o *IPSecPolicy) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *IPSecPolicy) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *IPSecPolicy) GetCreatedOk() (*time.Time, bool) { @@ -407,24 +403,39 @@ func (o *IPSecPolicy) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *IPSecPolicy) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *IPSecPolicy) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *IPSecPolicy) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *IPSecPolicy) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *IPSecPolicy) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *IPSecPolicy) GetLastUpdatedOk() (*time.Time, bool) { @@ -434,11 +445,28 @@ func (o *IPSecPolicy) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *IPSecPolicy) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *IPSecPolicy) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *IPSecPolicy) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *IPSecPolicy) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o IPSecPolicy) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -475,8 +503,12 @@ func (o IPSecPolicy) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -494,8 +526,6 @@ func (o *IPSecPolicy) UnmarshalJSON(data []byte) (err error) { "url", "display", "name", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_ip_sec_profile.go b/netbox/model_ip_sec_profile.go index aae16ad2e..013cb814b 100644 --- a/netbox/model_ip_sec_profile.go +++ b/netbox/model_ip_sec_profile.go @@ -33,8 +33,8 @@ type IPSecProfile struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -44,7 +44,7 @@ type _IPSecProfile IPSecProfile // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewIPSecProfile(id int32, url string, display string, name string, mode IPSecProfileMode, ikePolicy BriefIKEPolicy, ipsecPolicy BriefIPSecPolicy, created NullableTime, lastUpdated NullableTime) *IPSecProfile { +func NewIPSecProfile(id int32, url string, display string, name string, mode IPSecProfileMode, ikePolicy BriefIKEPolicy, ipsecPolicy BriefIPSecPolicy) *IPSecProfile { this := IPSecProfile{} this.Id = id this.Url = url @@ -53,8 +53,6 @@ func NewIPSecProfile(id int32, url string, display string, name string, mode IPS this.Mode = mode this.IkePolicy = ikePolicy this.IpsecPolicy = ipsecPolicy - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -401,18 +399,16 @@ func (o *IPSecProfile) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *IPSecProfile) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *IPSecProfile) GetCreatedOk() (*time.Time, bool) { @@ -422,24 +418,39 @@ func (o *IPSecProfile) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *IPSecProfile) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *IPSecProfile) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *IPSecProfile) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *IPSecProfile) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *IPSecProfile) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *IPSecProfile) GetLastUpdatedOk() (*time.Time, bool) { @@ -449,11 +460,28 @@ func (o *IPSecProfile) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *IPSecProfile) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *IPSecProfile) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *IPSecProfile) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *IPSecProfile) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o IPSecProfile) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -487,8 +515,12 @@ func (o IPSecProfile) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -509,8 +541,6 @@ func (o *IPSecProfile) UnmarshalJSON(data []byte) (err error) { "mode", "ike_policy", "ipsec_policy", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_ip_sec_proposal.go b/netbox/model_ip_sec_proposal.go index 79e850a45..1f3304f42 100644 --- a/netbox/model_ip_sec_proposal.go +++ b/netbox/model_ip_sec_proposal.go @@ -36,8 +36,8 @@ type IPSecProposal struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -47,7 +47,7 @@ type _IPSecProposal IPSecProposal // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewIPSecProposal(id int32, url string, display string, name string, encryptionAlgorithm IKEProposalEncryptionAlgorithm, authenticationAlgorithm IKEProposalAuthenticationAlgorithm, created NullableTime, lastUpdated NullableTime) *IPSecProposal { +func NewIPSecProposal(id int32, url string, display string, name string, encryptionAlgorithm IKEProposalEncryptionAlgorithm, authenticationAlgorithm IKEProposalAuthenticationAlgorithm) *IPSecProposal { this := IPSecProposal{} this.Id = id this.Url = url @@ -55,8 +55,6 @@ func NewIPSecProposal(id int32, url string, display string, name string, encrypt this.Name = name this.EncryptionAlgorithm = encryptionAlgorithm this.AuthenticationAlgorithm = authenticationAlgorithm - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -462,18 +460,16 @@ func (o *IPSecProposal) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *IPSecProposal) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *IPSecProposal) GetCreatedOk() (*time.Time, bool) { @@ -483,24 +479,39 @@ func (o *IPSecProposal) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *IPSecProposal) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *IPSecProposal) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *IPSecProposal) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *IPSecProposal) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *IPSecProposal) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *IPSecProposal) GetLastUpdatedOk() (*time.Time, bool) { @@ -510,11 +521,28 @@ func (o *IPSecProposal) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *IPSecProposal) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *IPSecProposal) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *IPSecProposal) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *IPSecProposal) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o IPSecProposal) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -553,8 +581,12 @@ func (o IPSecProposal) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -574,8 +606,6 @@ func (o *IPSecProposal) UnmarshalJSON(data []byte) (err error) { "name", "encryption_algorithm", "authentication_algorithm", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_job.go b/netbox/model_job.go index 15fb1b930..4bb7ab9d9 100644 --- a/netbox/model_job.go +++ b/netbox/model_job.go @@ -29,7 +29,7 @@ type Job struct { ObjectId NullableInt64 `json:"object_id,omitempty"` Name string `json:"name"` Status BriefJobStatus `json:"status"` - Created time.Time `json:"created"` + Created *time.Time `json:"created,omitempty"` Scheduled NullableTime `json:"scheduled,omitempty"` // Recurrence interval (in minutes) Interval NullableInt32 `json:"interval,omitempty"` @@ -48,7 +48,7 @@ type _Job Job // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewJob(id int32, url string, display string, objectType string, name string, status BriefJobStatus, created time.Time, user BriefUser, error_ string, jobId string) *Job { +func NewJob(id int32, url string, display string, objectType string, name string, status BriefJobStatus, user BriefUser, error_ string, jobId string) *Job { this := Job{} this.Id = id this.Url = url @@ -56,7 +56,6 @@ func NewJob(id int32, url string, display string, objectType string, name string this.ObjectType = objectType this.Name = name this.Status = status - this.Created = created this.User = user this.Error = error_ this.JobId = jobId @@ -295,30 +294,37 @@ func (o *Job) SetStatus(v BriefJobStatus) { } -// GetCreated returns the Created field value +// GetCreated returns the Created field value if set, zero value otherwise. func (o *Job) GetCreated() time.Time { - if o == nil { + if o == nil || IsNil(o.Created) { var ret time.Time return ret } - - return o.Created + return *o.Created } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Job) GetCreatedOk() (*time.Time, bool) { - if o == nil { + if o == nil || IsNil(o.Created) { return nil, false } - return &o.Created, true + return o.Created, true } -// SetCreated sets field value -func (o *Job) SetCreated(v time.Time) { - o.Created = v +// HasCreated returns a boolean if a field has been set. +func (o *Job) HasCreated() bool { + if o != nil && !IsNil(o.Created) { + return true + } + + return false } +// SetCreated gets a reference to the given time.Time and assigns it to the Created field. +func (o *Job) SetCreated(v time.Time) { + o.Created = &v +} // GetScheduled returns the Scheduled field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Job) GetScheduled() time.Time { @@ -618,7 +624,9 @@ func (o Job) ToMap() (map[string]interface{}, error) { } toSerialize["name"] = o.Name toSerialize["status"] = o.Status - toSerialize["created"] = o.Created + if !IsNil(o.Created) { + toSerialize["created"] = o.Created + } if o.Scheduled.IsSet() { toSerialize["scheduled"] = o.Scheduled.Get() } @@ -656,7 +664,6 @@ func (o *Job) UnmarshalJSON(data []byte) (err error) { "object_type", "name", "status", - "created", "user", "error", "job_id", diff --git a/netbox/model_journal_entry.go b/netbox/model_journal_entry.go index 74cd54eef..e6a2a64af 100644 --- a/netbox/model_journal_entry.go +++ b/netbox/model_journal_entry.go @@ -27,14 +27,14 @@ type JournalEntry struct { Display string `json:"display"` AssignedObjectType string `json:"assigned_object_type"` AssignedObjectId int64 `json:"assigned_object_id"` - AssignedObject interface{} `json:"assigned_object"` - Created NullableTime `json:"created"` + AssignedObject interface{} `json:"assigned_object,omitempty"` + Created NullableTime `json:"created,omitempty"` CreatedBy NullableInt32 `json:"created_by,omitempty"` Kind *JournalEntryKind `json:"kind,omitempty"` Comments string `json:"comments"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - LastUpdated NullableTime `json:"last_updated"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -44,17 +44,14 @@ type _JournalEntry JournalEntry // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewJournalEntry(id int32, url string, display string, assignedObjectType string, assignedObjectId int64, assignedObject interface{}, created NullableTime, comments string, lastUpdated NullableTime) *JournalEntry { +func NewJournalEntry(id int32, url string, display string, assignedObjectType string, assignedObjectId int64, comments string) *JournalEntry { this := JournalEntry{} this.Id = id this.Url = url this.Display = display this.AssignedObjectType = assignedObjectType this.AssignedObjectId = assignedObjectId - this.AssignedObject = assignedObject - this.Created = created this.Comments = comments - this.LastUpdated = lastUpdated return &this } @@ -223,18 +220,16 @@ func (o *JournalEntry) SetAssignedObjectId(v int64) { } -// GetAssignedObject returns the AssignedObject field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetAssignedObject returns the AssignedObject field value if set, zero value otherwise (both if not set or set to explicit null). func (o *JournalEntry) GetAssignedObject() interface{} { if o == nil { var ret interface{} return ret } - return o.AssignedObject } -// GetAssignedObjectOk returns a tuple with the AssignedObject field value +// GetAssignedObjectOk returns a tuple with the AssignedObject field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *JournalEntry) GetAssignedObjectOk() (*interface{}, bool) { @@ -244,24 +239,30 @@ func (o *JournalEntry) GetAssignedObjectOk() (*interface{}, bool) { return &o.AssignedObject, true } -// SetAssignedObject sets field value +// HasAssignedObject returns a boolean if a field has been set. +func (o *JournalEntry) HasAssignedObject() bool { + if o != nil && !IsNil(o.AssignedObject) { + return true + } + + return false +} + +// SetAssignedObject gets a reference to the given interface{} and assigns it to the AssignedObject field. func (o *JournalEntry) SetAssignedObject(v interface{}) { o.AssignedObject = v } - -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *JournalEntry) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *JournalEntry) GetCreatedOk() (*time.Time, bool) { @@ -271,11 +272,28 @@ func (o *JournalEntry) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *JournalEntry) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *JournalEntry) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *JournalEntry) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *JournalEntry) UnsetCreated() { + o.Created.Unset() +} // GetCreatedBy returns the CreatedBy field value if set, zero value otherwise (both if not set or set to explicit null). func (o *JournalEntry) GetCreatedBy() int32 { @@ -440,18 +458,16 @@ func (o *JournalEntry) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *JournalEntry) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *JournalEntry) GetLastUpdatedOk() (*time.Time, bool) { @@ -461,11 +477,28 @@ func (o *JournalEntry) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *JournalEntry) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *JournalEntry) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *JournalEntry) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *JournalEntry) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o JournalEntry) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -488,7 +521,9 @@ func (o JournalEntry) ToMap() (map[string]interface{}, error) { if o.AssignedObject != nil { toSerialize["assigned_object"] = o.AssignedObject } - toSerialize["created"] = o.Created.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } if o.CreatedBy.IsSet() { toSerialize["created_by"] = o.CreatedBy.Get() } @@ -502,7 +537,9 @@ func (o JournalEntry) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -521,10 +558,7 @@ func (o *JournalEntry) UnmarshalJSON(data []byte) (err error) { "display", "assigned_object_type", "assigned_object_id", - "assigned_object", - "created", "comments", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_l2_vpn.go b/netbox/model_l2_vpn.go index 1700961eb..b6d321431 100644 --- a/netbox/model_l2_vpn.go +++ b/netbox/model_l2_vpn.go @@ -36,8 +36,8 @@ type L2VPN struct { Tenant NullableBriefTenant `json:"tenant,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -47,15 +47,13 @@ type _L2VPN L2VPN // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewL2VPN(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime) *L2VPN { +func NewL2VPN(id int32, url string, display string, name string, slug string) *L2VPN { this := L2VPN{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -532,18 +530,16 @@ func (o *L2VPN) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *L2VPN) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *L2VPN) GetCreatedOk() (*time.Time, bool) { @@ -553,24 +549,39 @@ func (o *L2VPN) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *L2VPN) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *L2VPN) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *L2VPN) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *L2VPN) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *L2VPN) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *L2VPN) GetLastUpdatedOk() (*time.Time, bool) { @@ -580,11 +591,28 @@ func (o *L2VPN) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *L2VPN) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *L2VPN) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *L2VPN) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *L2VPN) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o L2VPN) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -631,8 +659,12 @@ func (o L2VPN) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -651,8 +683,6 @@ func (o *L2VPN) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_l2_vpn_termination.go b/netbox/model_l2_vpn_termination.go index babb884b9..e83829b1a 100644 --- a/netbox/model_l2_vpn_termination.go +++ b/netbox/model_l2_vpn_termination.go @@ -28,11 +28,11 @@ type L2VPNTermination struct { L2vpn BriefL2VPN `json:"l2vpn"` AssignedObjectType string `json:"assigned_object_type"` AssignedObjectId int64 `json:"assigned_object_id"` - AssignedObject interface{} `json:"assigned_object"` + AssignedObject interface{} `json:"assigned_object,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -42,7 +42,7 @@ type _L2VPNTermination L2VPNTermination // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewL2VPNTermination(id int32, url string, display string, l2vpn BriefL2VPN, assignedObjectType string, assignedObjectId int64, assignedObject interface{}, created NullableTime, lastUpdated NullableTime) *L2VPNTermination { +func NewL2VPNTermination(id int32, url string, display string, l2vpn BriefL2VPN, assignedObjectType string, assignedObjectId int64) *L2VPNTermination { this := L2VPNTermination{} this.Id = id this.Url = url @@ -50,9 +50,6 @@ func NewL2VPNTermination(id int32, url string, display string, l2vpn BriefL2VPN, this.L2vpn = l2vpn this.AssignedObjectType = assignedObjectType this.AssignedObjectId = assignedObjectId - this.AssignedObject = assignedObject - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -246,18 +243,16 @@ func (o *L2VPNTermination) SetAssignedObjectId(v int64) { } -// GetAssignedObject returns the AssignedObject field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetAssignedObject returns the AssignedObject field value if set, zero value otherwise (both if not set or set to explicit null). func (o *L2VPNTermination) GetAssignedObject() interface{} { if o == nil { var ret interface{} return ret } - return o.AssignedObject } -// GetAssignedObjectOk returns a tuple with the AssignedObject field value +// GetAssignedObjectOk returns a tuple with the AssignedObject field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *L2VPNTermination) GetAssignedObjectOk() (*interface{}, bool) { @@ -267,12 +262,20 @@ func (o *L2VPNTermination) GetAssignedObjectOk() (*interface{}, bool) { return &o.AssignedObject, true } -// SetAssignedObject sets field value +// HasAssignedObject returns a boolean if a field has been set. +func (o *L2VPNTermination) HasAssignedObject() bool { + if o != nil && !IsNil(o.AssignedObject) { + return true + } + + return false +} + +// SetAssignedObject gets a reference to the given interface{} and assigns it to the AssignedObject field. func (o *L2VPNTermination) SetAssignedObject(v interface{}) { o.AssignedObject = v } - // GetTags returns the Tags field value if set, zero value otherwise. func (o *L2VPNTermination) GetTags() []NestedTag { if o == nil || IsNil(o.Tags) { @@ -337,18 +340,16 @@ func (o *L2VPNTermination) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *L2VPNTermination) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *L2VPNTermination) GetCreatedOk() (*time.Time, bool) { @@ -358,24 +359,39 @@ func (o *L2VPNTermination) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *L2VPNTermination) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *L2VPNTermination) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *L2VPNTermination) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *L2VPNTermination) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *L2VPNTermination) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *L2VPNTermination) GetLastUpdatedOk() (*time.Time, bool) { @@ -385,11 +401,28 @@ func (o *L2VPNTermination) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *L2VPNTermination) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *L2VPNTermination) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *L2VPNTermination) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *L2VPNTermination) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o L2VPNTermination) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -419,8 +452,12 @@ func (o L2VPNTermination) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -440,9 +477,6 @@ func (o *L2VPNTermination) UnmarshalJSON(data []byte) (err error) { "l2vpn", "assigned_object_type", "assigned_object_id", - "assigned_object", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_location.go b/netbox/model_location.go index 922c82f42..27b8e8da8 100644 --- a/netbox/model_location.go +++ b/netbox/model_location.go @@ -36,8 +36,8 @@ type Location struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` RackCount *int32 `json:"rack_count,omitempty"` DeviceCount *int32 `json:"device_count,omitempty"` Depth int32 `json:"_depth"` @@ -50,7 +50,7 @@ type _Location Location // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewLocation(id int32, url string, display string, name string, slug string, site BriefSite, created NullableTime, lastUpdated NullableTime, depth int32) *Location { +func NewLocation(id int32, url string, display string, name string, slug string, site BriefSite, depth int32) *Location { this := Location{} this.Id = id this.Url = url @@ -58,8 +58,6 @@ func NewLocation(id int32, url string, display string, name string, slug string, this.Name = name this.Slug = slug this.Site = site - this.Created = created - this.LastUpdated = lastUpdated this.Depth = depth return &this } @@ -498,18 +496,16 @@ func (o *Location) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Location) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Location) GetCreatedOk() (*time.Time, bool) { @@ -519,24 +515,39 @@ func (o *Location) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Location) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Location) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Location) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Location) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Location) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Location) GetLastUpdatedOk() (*time.Time, bool) { @@ -546,11 +557,28 @@ func (o *Location) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Location) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Location) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Location) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Location) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetRackCount returns the RackCount field value if set, zero value otherwise. func (o *Location) GetRackCount() int32 { @@ -681,8 +709,12 @@ func (o Location) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } if !IsNil(o.RackCount) { toSerialize["rack_count"] = o.RackCount } @@ -709,8 +741,6 @@ func (o *Location) UnmarshalJSON(data []byte) (err error) { "name", "slug", "site", - "created", - "last_updated", "_depth", } diff --git a/netbox/model_manufacturer.go b/netbox/model_manufacturer.go index b46a29d23..52bc6988f 100644 --- a/netbox/model_manufacturer.go +++ b/netbox/model_manufacturer.go @@ -30,8 +30,8 @@ type Manufacturer struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` DevicetypeCount *int64 `json:"devicetype_count,omitempty"` InventoryitemCount int64 `json:"inventoryitem_count"` PlatformCount int64 `json:"platform_count"` @@ -44,15 +44,13 @@ type _Manufacturer Manufacturer // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewManufacturer(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, inventoryitemCount int64, platformCount int64) *Manufacturer { +func NewManufacturer(id int32, url string, display string, name string, slug string, inventoryitemCount int64, platformCount int64) *Manufacturer { this := Manufacturer{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated this.InventoryitemCount = inventoryitemCount this.PlatformCount = platformCount return &this @@ -319,18 +317,16 @@ func (o *Manufacturer) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Manufacturer) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Manufacturer) GetCreatedOk() (*time.Time, bool) { @@ -340,24 +336,39 @@ func (o *Manufacturer) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Manufacturer) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Manufacturer) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Manufacturer) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Manufacturer) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Manufacturer) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Manufacturer) GetLastUpdatedOk() (*time.Time, bool) { @@ -367,11 +378,28 @@ func (o *Manufacturer) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Manufacturer) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Manufacturer) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Manufacturer) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Manufacturer) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetDevicetypeCount returns the DevicetypeCount field value if set, zero value otherwise. func (o *Manufacturer) GetDevicetypeCount() int64 { @@ -482,8 +510,12 @@ func (o Manufacturer) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } if !IsNil(o.DevicetypeCount) { toSerialize["devicetype_count"] = o.DevicetypeCount } @@ -507,8 +539,6 @@ func (o *Manufacturer) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", "inventoryitem_count", "platform_count", } diff --git a/netbox/model_module.go b/netbox/model_module.go index b9aed75a4..416e08da2 100644 --- a/netbox/model_module.go +++ b/netbox/model_module.go @@ -36,8 +36,8 @@ type Module struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -47,7 +47,7 @@ type _Module Module // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewModule(id int32, url string, display string, device BriefDevice, moduleBay NestedModuleBay, moduleType BriefModuleType, created NullableTime, lastUpdated NullableTime) *Module { +func NewModule(id int32, url string, display string, device BriefDevice, moduleBay NestedModuleBay, moduleType BriefModuleType) *Module { this := Module{} this.Id = id this.Url = url @@ -55,8 +55,6 @@ func NewModule(id int32, url string, display string, device BriefDevice, moduleB this.Device = device this.ModuleBay = moduleBay this.ModuleType = moduleType - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -484,18 +482,16 @@ func (o *Module) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Module) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Module) GetCreatedOk() (*time.Time, bool) { @@ -505,24 +501,39 @@ func (o *Module) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Module) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Module) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Module) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Module) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Module) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Module) GetLastUpdatedOk() (*time.Time, bool) { @@ -532,11 +543,28 @@ func (o *Module) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Module) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Module) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Module) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Module) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o Module) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -578,8 +606,12 @@ func (o Module) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -599,8 +631,6 @@ func (o *Module) UnmarshalJSON(data []byte) (err error) { "device", "module_bay", "module_type", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_module_bay.go b/netbox/model_module_bay.go index c71432cb1..4aeb99ee3 100644 --- a/netbox/model_module_bay.go +++ b/netbox/model_module_bay.go @@ -36,8 +36,8 @@ type ModuleBay struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -47,15 +47,13 @@ type _ModuleBay ModuleBay // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewModuleBay(id int32, url string, display string, device BriefDevice, name string, created NullableTime, lastUpdated NullableTime) *ModuleBay { +func NewModuleBay(id int32, url string, display string, device BriefDevice, name string) *ModuleBay { this := ModuleBay{} this.Id = id this.Url = url this.Display = display this.Device = device this.Name = name - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -468,18 +466,16 @@ func (o *ModuleBay) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ModuleBay) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ModuleBay) GetCreatedOk() (*time.Time, bool) { @@ -489,24 +485,39 @@ func (o *ModuleBay) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ModuleBay) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ModuleBay) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ModuleBay) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ModuleBay) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ModuleBay) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ModuleBay) GetLastUpdatedOk() (*time.Time, bool) { @@ -516,11 +527,28 @@ func (o *ModuleBay) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ModuleBay) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ModuleBay) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ModuleBay) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ModuleBay) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o ModuleBay) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -561,8 +589,12 @@ func (o ModuleBay) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -581,8 +613,6 @@ func (o *ModuleBay) UnmarshalJSON(data []byte) (err error) { "display", "device", "name", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_module_bay_template.go b/netbox/model_module_bay_template.go index 1a2c08660..be7a1da04 100644 --- a/netbox/model_module_bay_template.go +++ b/netbox/model_module_bay_template.go @@ -33,8 +33,8 @@ type ModuleBayTemplate struct { // Identifier to reference when renaming installed components Position *string `json:"position,omitempty"` Description *string `json:"description,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -44,14 +44,12 @@ type _ModuleBayTemplate ModuleBayTemplate // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewModuleBayTemplate(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime) *ModuleBayTemplate { +func NewModuleBayTemplate(id int32, url string, display string, name string) *ModuleBayTemplate { this := ModuleBayTemplate{} this.Id = id this.Url = url this.Display = display this.Name = name - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -343,18 +341,16 @@ func (o *ModuleBayTemplate) SetDescription(v string) { o.Description = &v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ModuleBayTemplate) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ModuleBayTemplate) GetCreatedOk() (*time.Time, bool) { @@ -364,24 +360,39 @@ func (o *ModuleBayTemplate) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ModuleBayTemplate) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ModuleBayTemplate) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ModuleBayTemplate) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ModuleBayTemplate) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ModuleBayTemplate) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ModuleBayTemplate) GetLastUpdatedOk() (*time.Time, bool) { @@ -391,11 +402,28 @@ func (o *ModuleBayTemplate) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ModuleBayTemplate) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ModuleBayTemplate) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ModuleBayTemplate) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ModuleBayTemplate) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o ModuleBayTemplate) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -426,8 +454,12 @@ func (o ModuleBayTemplate) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -445,8 +477,6 @@ func (o *ModuleBayTemplate) UnmarshalJSON(data []byte) (err error) { "url", "display", "name", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_module_type.go b/netbox/model_module_type.go index dea98c5bb..252eca926 100644 --- a/netbox/model_module_type.go +++ b/netbox/model_module_type.go @@ -36,8 +36,8 @@ type ModuleType struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -47,15 +47,13 @@ type _ModuleType ModuleType // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewModuleType(id int32, url string, display string, manufacturer BriefManufacturer, model string, created NullableTime, lastUpdated NullableTime) *ModuleType { +func NewModuleType(id int32, url string, display string, manufacturer BriefManufacturer, model string) *ModuleType { this := ModuleType{} this.Id = id this.Url = url this.Display = display this.Manufacturer = manufacturer this.Model = model - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -510,18 +508,16 @@ func (o *ModuleType) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ModuleType) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ModuleType) GetCreatedOk() (*time.Time, bool) { @@ -531,24 +527,39 @@ func (o *ModuleType) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ModuleType) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ModuleType) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ModuleType) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ModuleType) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ModuleType) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ModuleType) GetLastUpdatedOk() (*time.Time, bool) { @@ -558,11 +569,28 @@ func (o *ModuleType) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ModuleType) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ModuleType) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ModuleType) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ModuleType) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o ModuleType) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -606,8 +634,12 @@ func (o ModuleType) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -626,8 +658,6 @@ func (o *ModuleType) UnmarshalJSON(data []byte) (err error) { "display", "manufacturer", "model", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_notification.go b/netbox/model_notification.go index 6f1651a88..5af6edf82 100644 --- a/netbox/model_notification.go +++ b/netbox/model_notification.go @@ -26,9 +26,9 @@ type Notification struct { Display string `json:"display"` ObjectType string `json:"object_type"` ObjectId int64 `json:"object_id"` - Object interface{} `json:"object"` + Object interface{} `json:"object,omitempty"` User BriefUser `json:"user"` - Created time.Time `json:"created"` + Created *time.Time `json:"created,omitempty"` Read NullableTime `json:"read,omitempty"` EventType Event `json:"event_type"` AdditionalProperties map[string]interface{} @@ -40,16 +40,14 @@ type _Notification Notification // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewNotification(id int32, url string, display string, objectType string, objectId int64, object interface{}, user BriefUser, created time.Time, eventType Event) *Notification { +func NewNotification(id int32, url string, display string, objectType string, objectId int64, user BriefUser, eventType Event) *Notification { this := Notification{} this.Id = id this.Url = url this.Display = display this.ObjectType = objectType this.ObjectId = objectId - this.Object = object this.User = user - this.Created = created this.EventType = eventType return &this } @@ -187,18 +185,16 @@ func (o *Notification) SetObjectId(v int64) { } -// GetObject returns the Object field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetObject returns the Object field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Notification) GetObject() interface{} { if o == nil { var ret interface{} return ret } - return o.Object } -// GetObjectOk returns a tuple with the Object field value +// GetObjectOk returns a tuple with the Object field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Notification) GetObjectOk() (*interface{}, bool) { @@ -208,12 +204,20 @@ func (o *Notification) GetObjectOk() (*interface{}, bool) { return &o.Object, true } -// SetObject sets field value +// HasObject returns a boolean if a field has been set. +func (o *Notification) HasObject() bool { + if o != nil && !IsNil(o.Object) { + return true + } + + return false +} + +// SetObject gets a reference to the given interface{} and assigns it to the Object field. func (o *Notification) SetObject(v interface{}) { o.Object = v } - // GetUser returns the User field value func (o *Notification) GetUser() BriefUser { if o == nil { @@ -239,30 +243,37 @@ func (o *Notification) SetUser(v BriefUser) { } -// GetCreated returns the Created field value +// GetCreated returns the Created field value if set, zero value otherwise. func (o *Notification) GetCreated() time.Time { - if o == nil { + if o == nil || IsNil(o.Created) { var ret time.Time return ret } - - return o.Created + return *o.Created } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Notification) GetCreatedOk() (*time.Time, bool) { - if o == nil { + if o == nil || IsNil(o.Created) { return nil, false } - return &o.Created, true + return o.Created, true } -// SetCreated sets field value -func (o *Notification) SetCreated(v time.Time) { - o.Created = v +// HasCreated returns a boolean if a field has been set. +func (o *Notification) HasCreated() bool { + if o != nil && !IsNil(o.Created) { + return true + } + + return false } +// SetCreated gets a reference to the given time.Time and assigns it to the Created field. +func (o *Notification) SetCreated(v time.Time) { + o.Created = &v +} // GetRead returns the Read field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Notification) GetRead() time.Time { @@ -350,7 +361,9 @@ func (o Notification) ToMap() (map[string]interface{}, error) { toSerialize["object"] = o.Object } toSerialize["user"] = o.User - toSerialize["created"] = o.Created + if !IsNil(o.Created) { + toSerialize["created"] = o.Created + } if o.Read.IsSet() { toSerialize["read"] = o.Read.Get() } @@ -373,9 +386,7 @@ func (o *Notification) UnmarshalJSON(data []byte) (err error) { "display", "object_type", "object_id", - "object", "user", - "created", "event_type", } diff --git a/netbox/model_object_change.go b/netbox/model_object_change.go index ca2029f11..956ba144d 100644 --- a/netbox/model_object_change.go +++ b/netbox/model_object_change.go @@ -32,9 +32,9 @@ type ObjectChange struct { Action ObjectChangeAction `json:"action"` ChangedObjectType string `json:"changed_object_type"` ChangedObjectId int64 `json:"changed_object_id"` - ChangedObject interface{} `json:"changed_object"` - PrechangeData interface{} `json:"prechange_data"` - PostchangeData interface{} `json:"postchange_data"` + ChangedObject interface{} `json:"changed_object,omitempty"` + PrechangeData interface{} `json:"prechange_data,omitempty"` + PostchangeData interface{} `json:"postchange_data,omitempty"` AdditionalProperties map[string]interface{} } @@ -44,7 +44,7 @@ type _ObjectChange ObjectChange // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewObjectChange(id int32, url string, display string, time time.Time, user BriefUser, userName string, requestId string, action ObjectChangeAction, changedObjectType string, changedObjectId int64, changedObject interface{}, prechangeData interface{}, postchangeData interface{}) *ObjectChange { +func NewObjectChange(id int32, url string, display string, time time.Time, user BriefUser, userName string, requestId string, action ObjectChangeAction, changedObjectType string, changedObjectId int64) *ObjectChange { this := ObjectChange{} this.Id = id this.Url = url @@ -56,9 +56,6 @@ func NewObjectChange(id int32, url string, display string, time time.Time, user this.Action = action this.ChangedObjectType = changedObjectType this.ChangedObjectId = changedObjectId - this.ChangedObject = changedObject - this.PrechangeData = prechangeData - this.PostchangeData = postchangeData return &this } @@ -352,18 +349,16 @@ func (o *ObjectChange) SetChangedObjectId(v int64) { } -// GetChangedObject returns the ChangedObject field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetChangedObject returns the ChangedObject field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ObjectChange) GetChangedObject() interface{} { if o == nil { var ret interface{} return ret } - return o.ChangedObject } -// GetChangedObjectOk returns a tuple with the ChangedObject field value +// GetChangedObjectOk returns a tuple with the ChangedObject field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ObjectChange) GetChangedObjectOk() (*interface{}, bool) { @@ -373,24 +368,30 @@ func (o *ObjectChange) GetChangedObjectOk() (*interface{}, bool) { return &o.ChangedObject, true } -// SetChangedObject sets field value +// HasChangedObject returns a boolean if a field has been set. +func (o *ObjectChange) HasChangedObject() bool { + if o != nil && !IsNil(o.ChangedObject) { + return true + } + + return false +} + +// SetChangedObject gets a reference to the given interface{} and assigns it to the ChangedObject field. func (o *ObjectChange) SetChangedObject(v interface{}) { o.ChangedObject = v } - -// GetPrechangeData returns the PrechangeData field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetPrechangeData returns the PrechangeData field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ObjectChange) GetPrechangeData() interface{} { if o == nil { var ret interface{} return ret } - return o.PrechangeData } -// GetPrechangeDataOk returns a tuple with the PrechangeData field value +// GetPrechangeDataOk returns a tuple with the PrechangeData field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ObjectChange) GetPrechangeDataOk() (*interface{}, bool) { @@ -400,24 +401,30 @@ func (o *ObjectChange) GetPrechangeDataOk() (*interface{}, bool) { return &o.PrechangeData, true } -// SetPrechangeData sets field value +// HasPrechangeData returns a boolean if a field has been set. +func (o *ObjectChange) HasPrechangeData() bool { + if o != nil && !IsNil(o.PrechangeData) { + return true + } + + return false +} + +// SetPrechangeData gets a reference to the given interface{} and assigns it to the PrechangeData field. func (o *ObjectChange) SetPrechangeData(v interface{}) { o.PrechangeData = v } - -// GetPostchangeData returns the PostchangeData field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetPostchangeData returns the PostchangeData field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ObjectChange) GetPostchangeData() interface{} { if o == nil { var ret interface{} return ret } - return o.PostchangeData } -// GetPostchangeDataOk returns a tuple with the PostchangeData field value +// GetPostchangeDataOk returns a tuple with the PostchangeData field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ObjectChange) GetPostchangeDataOk() (*interface{}, bool) { @@ -427,12 +434,20 @@ func (o *ObjectChange) GetPostchangeDataOk() (*interface{}, bool) { return &o.PostchangeData, true } -// SetPostchangeData sets field value +// HasPostchangeData returns a boolean if a field has been set. +func (o *ObjectChange) HasPostchangeData() bool { + if o != nil && !IsNil(o.PostchangeData) { + return true + } + + return false +} + +// SetPostchangeData gets a reference to the given interface{} and assigns it to the PostchangeData field. func (o *ObjectChange) SetPostchangeData(v interface{}) { o.PostchangeData = v } - func (o ObjectChange) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { @@ -488,9 +503,6 @@ func (o *ObjectChange) UnmarshalJSON(data []byte) (err error) { "action", "changed_object_type", "changed_object_id", - "changed_object", - "prechange_data", - "postchange_data", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_platform.go b/netbox/model_platform.go index fdfaf0572..703f24e55 100644 --- a/netbox/model_platform.go +++ b/netbox/model_platform.go @@ -32,8 +32,8 @@ type Platform struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` DeviceCount *int64 `json:"device_count,omitempty"` VirtualmachineCount *int64 `json:"virtualmachine_count,omitempty"` AdditionalProperties map[string]interface{} @@ -45,15 +45,13 @@ type _Platform Platform // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewPlatform(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime) *Platform { +func NewPlatform(id int32, url string, display string, name string, slug string) *Platform { this := Platform{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -402,18 +400,16 @@ func (o *Platform) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Platform) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Platform) GetCreatedOk() (*time.Time, bool) { @@ -423,24 +419,39 @@ func (o *Platform) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Platform) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Platform) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Platform) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Platform) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Platform) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Platform) GetLastUpdatedOk() (*time.Time, bool) { @@ -450,11 +461,28 @@ func (o *Platform) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Platform) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Platform) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Platform) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Platform) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetDeviceCount returns the DeviceCount field value if set, zero value otherwise. func (o *Platform) GetDeviceCount() int64 { @@ -553,8 +581,12 @@ func (o Platform) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } if !IsNil(o.DeviceCount) { toSerialize["device_count"] = o.DeviceCount } @@ -579,8 +611,6 @@ func (o *Platform) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_power_feed.go b/netbox/model_power_feed.go index 441db2f5e..75bbf5329 100644 --- a/netbox/model_power_feed.go +++ b/netbox/model_power_feed.go @@ -38,21 +38,21 @@ type PowerFeed struct { MaxUtilization *int32 `json:"max_utilization,omitempty"` // Treat as if a cable is connected MarkConnected *bool `json:"mark_connected,omitempty"` - Cable NullableBriefCable `json:"cable"` + Cable NullableBriefCable `json:"cable,omitempty"` CableEnd string `json:"cable_end"` LinkPeers []interface{} `json:"link_peers"` // Return the type of the peer link terminations, or None. - LinkPeersType NullableString `json:"link_peers_type"` - ConnectedEndpoints []interface{} `json:"connected_endpoints"` - ConnectedEndpointsType NullableString `json:"connected_endpoints_type"` + LinkPeersType NullableString `json:"link_peers_type,omitempty"` + ConnectedEndpoints []interface{} `json:"connected_endpoints,omitempty"` + ConnectedEndpointsType NullableString `json:"connected_endpoints_type,omitempty"` ConnectedEndpointsReachable bool `json:"connected_endpoints_reachable"` Description *string `json:"description,omitempty"` Tenant NullableBriefTenant `json:"tenant,omitempty"` Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` Occupied bool `json:"_occupied"` AdditionalProperties map[string]interface{} } @@ -63,22 +63,16 @@ type _PowerFeed PowerFeed // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewPowerFeed(id int32, url string, display string, powerPanel BriefPowerPanel, name string, cable NullableBriefCable, cableEnd string, linkPeers []interface{}, linkPeersType NullableString, connectedEndpoints []interface{}, connectedEndpointsType NullableString, connectedEndpointsReachable bool, created NullableTime, lastUpdated NullableTime, occupied bool) *PowerFeed { +func NewPowerFeed(id int32, url string, display string, powerPanel BriefPowerPanel, name string, cableEnd string, linkPeers []interface{}, connectedEndpointsReachable bool, occupied bool) *PowerFeed { this := PowerFeed{} this.Id = id this.Url = url this.Display = display this.PowerPanel = powerPanel this.Name = name - this.Cable = cable this.CableEnd = cableEnd this.LinkPeers = linkPeers - this.LinkPeersType = linkPeersType - this.ConnectedEndpoints = connectedEndpoints - this.ConnectedEndpointsType = connectedEndpointsType this.ConnectedEndpointsReachable = connectedEndpointsReachable - this.Created = created - this.LastUpdated = lastUpdated this.Occupied = occupied return &this } @@ -546,18 +540,16 @@ func (o *PowerFeed) SetMarkConnected(v bool) { o.MarkConnected = &v } -// GetCable returns the Cable field value -// If the value is explicit nil, the zero value for BriefCable will be returned +// GetCable returns the Cable field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerFeed) GetCable() BriefCable { - if o == nil || o.Cable.Get() == nil { + if o == nil || IsNil(o.Cable.Get()) { var ret BriefCable return ret } - return *o.Cable.Get() } -// GetCableOk returns a tuple with the Cable field value +// GetCableOk returns a tuple with the Cable field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerFeed) GetCableOk() (*BriefCable, bool) { @@ -567,11 +559,28 @@ func (o *PowerFeed) GetCableOk() (*BriefCable, bool) { return o.Cable.Get(), o.Cable.IsSet() } -// SetCable sets field value +// HasCable returns a boolean if a field has been set. +func (o *PowerFeed) HasCable() bool { + if o != nil && o.Cable.IsSet() { + return true + } + + return false +} + +// SetCable gets a reference to the given NullableBriefCable and assigns it to the Cable field. func (o *PowerFeed) SetCable(v BriefCable) { o.Cable.Set(&v) } +// SetCableNil sets the value for Cable to be an explicit nil +func (o *PowerFeed) SetCableNil() { + o.Cable.Set(nil) +} +// UnsetCable ensures that no value is present for Cable, not even an explicit nil +func (o *PowerFeed) UnsetCable() { + o.Cable.Unset() +} // GetCableEnd returns the CableEnd field value func (o *PowerFeed) GetCableEnd() string { @@ -623,18 +632,16 @@ func (o *PowerFeed) SetLinkPeers(v []interface{}) { } -// GetLinkPeersType returns the LinkPeersType field value -// If the value is explicit nil, the zero value for string will be returned +// GetLinkPeersType returns the LinkPeersType field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerFeed) GetLinkPeersType() string { - if o == nil || o.LinkPeersType.Get() == nil { + if o == nil || IsNil(o.LinkPeersType.Get()) { var ret string return ret } - return *o.LinkPeersType.Get() } -// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value +// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerFeed) GetLinkPeersTypeOk() (*string, bool) { @@ -644,24 +651,39 @@ func (o *PowerFeed) GetLinkPeersTypeOk() (*string, bool) { return o.LinkPeersType.Get(), o.LinkPeersType.IsSet() } -// SetLinkPeersType sets field value +// HasLinkPeersType returns a boolean if a field has been set. +func (o *PowerFeed) HasLinkPeersType() bool { + if o != nil && o.LinkPeersType.IsSet() { + return true + } + + return false +} + +// SetLinkPeersType gets a reference to the given NullableString and assigns it to the LinkPeersType field. func (o *PowerFeed) SetLinkPeersType(v string) { o.LinkPeersType.Set(&v) } +// SetLinkPeersTypeNil sets the value for LinkPeersType to be an explicit nil +func (o *PowerFeed) SetLinkPeersTypeNil() { + o.LinkPeersType.Set(nil) +} +// UnsetLinkPeersType ensures that no value is present for LinkPeersType, not even an explicit nil +func (o *PowerFeed) UnsetLinkPeersType() { + o.LinkPeersType.Unset() +} -// GetConnectedEndpoints returns the ConnectedEndpoints field value -// If the value is explicit nil, the zero value for []interface{} will be returned +// GetConnectedEndpoints returns the ConnectedEndpoints field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerFeed) GetConnectedEndpoints() []interface{} { if o == nil { var ret []interface{} return ret } - return o.ConnectedEndpoints } -// GetConnectedEndpointsOk returns a tuple with the ConnectedEndpoints field value +// GetConnectedEndpointsOk returns a tuple with the ConnectedEndpoints field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerFeed) GetConnectedEndpointsOk() ([]interface{}, bool) { @@ -671,24 +693,30 @@ func (o *PowerFeed) GetConnectedEndpointsOk() ([]interface{}, bool) { return o.ConnectedEndpoints, true } -// SetConnectedEndpoints sets field value +// HasConnectedEndpoints returns a boolean if a field has been set. +func (o *PowerFeed) HasConnectedEndpoints() bool { + if o != nil && !IsNil(o.ConnectedEndpoints) { + return true + } + + return false +} + +// SetConnectedEndpoints gets a reference to the given []interface{} and assigns it to the ConnectedEndpoints field. func (o *PowerFeed) SetConnectedEndpoints(v []interface{}) { o.ConnectedEndpoints = v } - -// GetConnectedEndpointsType returns the ConnectedEndpointsType field value -// If the value is explicit nil, the zero value for string will be returned +// GetConnectedEndpointsType returns the ConnectedEndpointsType field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerFeed) GetConnectedEndpointsType() string { - if o == nil || o.ConnectedEndpointsType.Get() == nil { + if o == nil || IsNil(o.ConnectedEndpointsType.Get()) { var ret string return ret } - return *o.ConnectedEndpointsType.Get() } -// GetConnectedEndpointsTypeOk returns a tuple with the ConnectedEndpointsType field value +// GetConnectedEndpointsTypeOk returns a tuple with the ConnectedEndpointsType field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerFeed) GetConnectedEndpointsTypeOk() (*string, bool) { @@ -698,11 +726,28 @@ func (o *PowerFeed) GetConnectedEndpointsTypeOk() (*string, bool) { return o.ConnectedEndpointsType.Get(), o.ConnectedEndpointsType.IsSet() } -// SetConnectedEndpointsType sets field value +// HasConnectedEndpointsType returns a boolean if a field has been set. +func (o *PowerFeed) HasConnectedEndpointsType() bool { + if o != nil && o.ConnectedEndpointsType.IsSet() { + return true + } + + return false +} + +// SetConnectedEndpointsType gets a reference to the given NullableString and assigns it to the ConnectedEndpointsType field. func (o *PowerFeed) SetConnectedEndpointsType(v string) { o.ConnectedEndpointsType.Set(&v) } +// SetConnectedEndpointsTypeNil sets the value for ConnectedEndpointsType to be an explicit nil +func (o *PowerFeed) SetConnectedEndpointsTypeNil() { + o.ConnectedEndpointsType.Set(nil) +} +// UnsetConnectedEndpointsType ensures that no value is present for ConnectedEndpointsType, not even an explicit nil +func (o *PowerFeed) UnsetConnectedEndpointsType() { + o.ConnectedEndpointsType.Unset() +} // GetConnectedEndpointsReachable returns the ConnectedEndpointsReachable field value func (o *PowerFeed) GetConnectedEndpointsReachable() bool { @@ -899,18 +944,16 @@ func (o *PowerFeed) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerFeed) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerFeed) GetCreatedOk() (*time.Time, bool) { @@ -920,24 +963,39 @@ func (o *PowerFeed) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *PowerFeed) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *PowerFeed) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *PowerFeed) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *PowerFeed) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerFeed) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerFeed) GetLastUpdatedOk() (*time.Time, bool) { @@ -947,11 +1005,28 @@ func (o *PowerFeed) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *PowerFeed) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *PowerFeed) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *PowerFeed) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *PowerFeed) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetOccupied returns the Occupied field value func (o *PowerFeed) GetOccupied() bool { @@ -1023,14 +1098,20 @@ func (o PowerFeed) ToMap() (map[string]interface{}, error) { if !IsNil(o.MarkConnected) { toSerialize["mark_connected"] = o.MarkConnected } - toSerialize["cable"] = o.Cable.Get() + if o.Cable.IsSet() { + toSerialize["cable"] = o.Cable.Get() + } toSerialize["cable_end"] = o.CableEnd toSerialize["link_peers"] = o.LinkPeers - toSerialize["link_peers_type"] = o.LinkPeersType.Get() + if o.LinkPeersType.IsSet() { + toSerialize["link_peers_type"] = o.LinkPeersType.Get() + } if o.ConnectedEndpoints != nil { toSerialize["connected_endpoints"] = o.ConnectedEndpoints } - toSerialize["connected_endpoints_type"] = o.ConnectedEndpointsType.Get() + if o.ConnectedEndpointsType.IsSet() { + toSerialize["connected_endpoints_type"] = o.ConnectedEndpointsType.Get() + } toSerialize["connected_endpoints_reachable"] = o.ConnectedEndpointsReachable if !IsNil(o.Description) { toSerialize["description"] = o.Description @@ -1047,8 +1128,12 @@ func (o PowerFeed) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["_occupied"] = o.Occupied for key, value := range o.AdditionalProperties { @@ -1068,15 +1153,9 @@ func (o *PowerFeed) UnmarshalJSON(data []byte) (err error) { "display", "power_panel", "name", - "cable", "cable_end", "link_peers", - "link_peers_type", - "connected_endpoints", - "connected_endpoints_type", "connected_endpoints_reachable", - "created", - "last_updated", "_occupied", } diff --git a/netbox/model_power_outlet.go b/netbox/model_power_outlet.go index ff66396cd..39c9d05bf 100644 --- a/netbox/model_power_outlet.go +++ b/netbox/model_power_outlet.go @@ -36,18 +36,18 @@ type PowerOutlet struct { Description *string `json:"description,omitempty"` // Treat as if a cable is connected MarkConnected *bool `json:"mark_connected,omitempty"` - Cable NullableBriefCable `json:"cable"` + Cable NullableBriefCable `json:"cable,omitempty"` CableEnd string `json:"cable_end"` LinkPeers []interface{} `json:"link_peers"` // Return the type of the peer link terminations, or None. - LinkPeersType NullableString `json:"link_peers_type"` - ConnectedEndpoints []interface{} `json:"connected_endpoints"` - ConnectedEndpointsType NullableString `json:"connected_endpoints_type"` + LinkPeersType NullableString `json:"link_peers_type,omitempty"` + ConnectedEndpoints []interface{} `json:"connected_endpoints,omitempty"` + ConnectedEndpointsType NullableString `json:"connected_endpoints_type,omitempty"` ConnectedEndpointsReachable bool `json:"connected_endpoints_reachable"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` Occupied bool `json:"_occupied"` AdditionalProperties map[string]interface{} } @@ -58,22 +58,16 @@ type _PowerOutlet PowerOutlet // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewPowerOutlet(id int32, url string, display string, device BriefDevice, name string, cable NullableBriefCable, cableEnd string, linkPeers []interface{}, linkPeersType NullableString, connectedEndpoints []interface{}, connectedEndpointsType NullableString, connectedEndpointsReachable bool, created NullableTime, lastUpdated NullableTime, occupied bool) *PowerOutlet { +func NewPowerOutlet(id int32, url string, display string, device BriefDevice, name string, cableEnd string, linkPeers []interface{}, connectedEndpointsReachable bool, occupied bool) *PowerOutlet { this := PowerOutlet{} this.Id = id this.Url = url this.Display = display this.Device = device this.Name = name - this.Cable = cable this.CableEnd = cableEnd this.LinkPeers = linkPeers - this.LinkPeersType = linkPeersType - this.ConnectedEndpoints = connectedEndpoints - this.ConnectedEndpointsType = connectedEndpointsType this.ConnectedEndpointsReachable = connectedEndpointsReachable - this.Created = created - this.LastUpdated = lastUpdated this.Occupied = occupied return &this } @@ -507,18 +501,16 @@ func (o *PowerOutlet) SetMarkConnected(v bool) { o.MarkConnected = &v } -// GetCable returns the Cable field value -// If the value is explicit nil, the zero value for BriefCable will be returned +// GetCable returns the Cable field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerOutlet) GetCable() BriefCable { - if o == nil || o.Cable.Get() == nil { + if o == nil || IsNil(o.Cable.Get()) { var ret BriefCable return ret } - return *o.Cable.Get() } -// GetCableOk returns a tuple with the Cable field value +// GetCableOk returns a tuple with the Cable field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerOutlet) GetCableOk() (*BriefCable, bool) { @@ -528,11 +520,28 @@ func (o *PowerOutlet) GetCableOk() (*BriefCable, bool) { return o.Cable.Get(), o.Cable.IsSet() } -// SetCable sets field value +// HasCable returns a boolean if a field has been set. +func (o *PowerOutlet) HasCable() bool { + if o != nil && o.Cable.IsSet() { + return true + } + + return false +} + +// SetCable gets a reference to the given NullableBriefCable and assigns it to the Cable field. func (o *PowerOutlet) SetCable(v BriefCable) { o.Cable.Set(&v) } +// SetCableNil sets the value for Cable to be an explicit nil +func (o *PowerOutlet) SetCableNil() { + o.Cable.Set(nil) +} +// UnsetCable ensures that no value is present for Cable, not even an explicit nil +func (o *PowerOutlet) UnsetCable() { + o.Cable.Unset() +} // GetCableEnd returns the CableEnd field value func (o *PowerOutlet) GetCableEnd() string { @@ -584,18 +593,16 @@ func (o *PowerOutlet) SetLinkPeers(v []interface{}) { } -// GetLinkPeersType returns the LinkPeersType field value -// If the value is explicit nil, the zero value for string will be returned +// GetLinkPeersType returns the LinkPeersType field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerOutlet) GetLinkPeersType() string { - if o == nil || o.LinkPeersType.Get() == nil { + if o == nil || IsNil(o.LinkPeersType.Get()) { var ret string return ret } - return *o.LinkPeersType.Get() } -// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value +// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerOutlet) GetLinkPeersTypeOk() (*string, bool) { @@ -605,24 +612,39 @@ func (o *PowerOutlet) GetLinkPeersTypeOk() (*string, bool) { return o.LinkPeersType.Get(), o.LinkPeersType.IsSet() } -// SetLinkPeersType sets field value +// HasLinkPeersType returns a boolean if a field has been set. +func (o *PowerOutlet) HasLinkPeersType() bool { + if o != nil && o.LinkPeersType.IsSet() { + return true + } + + return false +} + +// SetLinkPeersType gets a reference to the given NullableString and assigns it to the LinkPeersType field. func (o *PowerOutlet) SetLinkPeersType(v string) { o.LinkPeersType.Set(&v) } +// SetLinkPeersTypeNil sets the value for LinkPeersType to be an explicit nil +func (o *PowerOutlet) SetLinkPeersTypeNil() { + o.LinkPeersType.Set(nil) +} +// UnsetLinkPeersType ensures that no value is present for LinkPeersType, not even an explicit nil +func (o *PowerOutlet) UnsetLinkPeersType() { + o.LinkPeersType.Unset() +} -// GetConnectedEndpoints returns the ConnectedEndpoints field value -// If the value is explicit nil, the zero value for []interface{} will be returned +// GetConnectedEndpoints returns the ConnectedEndpoints field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerOutlet) GetConnectedEndpoints() []interface{} { if o == nil { var ret []interface{} return ret } - return o.ConnectedEndpoints } -// GetConnectedEndpointsOk returns a tuple with the ConnectedEndpoints field value +// GetConnectedEndpointsOk returns a tuple with the ConnectedEndpoints field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerOutlet) GetConnectedEndpointsOk() ([]interface{}, bool) { @@ -632,24 +654,30 @@ func (o *PowerOutlet) GetConnectedEndpointsOk() ([]interface{}, bool) { return o.ConnectedEndpoints, true } -// SetConnectedEndpoints sets field value +// HasConnectedEndpoints returns a boolean if a field has been set. +func (o *PowerOutlet) HasConnectedEndpoints() bool { + if o != nil && !IsNil(o.ConnectedEndpoints) { + return true + } + + return false +} + +// SetConnectedEndpoints gets a reference to the given []interface{} and assigns it to the ConnectedEndpoints field. func (o *PowerOutlet) SetConnectedEndpoints(v []interface{}) { o.ConnectedEndpoints = v } - -// GetConnectedEndpointsType returns the ConnectedEndpointsType field value -// If the value is explicit nil, the zero value for string will be returned +// GetConnectedEndpointsType returns the ConnectedEndpointsType field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerOutlet) GetConnectedEndpointsType() string { - if o == nil || o.ConnectedEndpointsType.Get() == nil { + if o == nil || IsNil(o.ConnectedEndpointsType.Get()) { var ret string return ret } - return *o.ConnectedEndpointsType.Get() } -// GetConnectedEndpointsTypeOk returns a tuple with the ConnectedEndpointsType field value +// GetConnectedEndpointsTypeOk returns a tuple with the ConnectedEndpointsType field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerOutlet) GetConnectedEndpointsTypeOk() (*string, bool) { @@ -659,11 +687,28 @@ func (o *PowerOutlet) GetConnectedEndpointsTypeOk() (*string, bool) { return o.ConnectedEndpointsType.Get(), o.ConnectedEndpointsType.IsSet() } -// SetConnectedEndpointsType sets field value +// HasConnectedEndpointsType returns a boolean if a field has been set. +func (o *PowerOutlet) HasConnectedEndpointsType() bool { + if o != nil && o.ConnectedEndpointsType.IsSet() { + return true + } + + return false +} + +// SetConnectedEndpointsType gets a reference to the given NullableString and assigns it to the ConnectedEndpointsType field. func (o *PowerOutlet) SetConnectedEndpointsType(v string) { o.ConnectedEndpointsType.Set(&v) } +// SetConnectedEndpointsTypeNil sets the value for ConnectedEndpointsType to be an explicit nil +func (o *PowerOutlet) SetConnectedEndpointsTypeNil() { + o.ConnectedEndpointsType.Set(nil) +} +// UnsetConnectedEndpointsType ensures that no value is present for ConnectedEndpointsType, not even an explicit nil +func (o *PowerOutlet) UnsetConnectedEndpointsType() { + o.ConnectedEndpointsType.Unset() +} // GetConnectedEndpointsReachable returns the ConnectedEndpointsReachable field value func (o *PowerOutlet) GetConnectedEndpointsReachable() bool { @@ -754,18 +799,16 @@ func (o *PowerOutlet) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerOutlet) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerOutlet) GetCreatedOk() (*time.Time, bool) { @@ -775,24 +818,39 @@ func (o *PowerOutlet) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *PowerOutlet) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *PowerOutlet) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *PowerOutlet) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *PowerOutlet) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerOutlet) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerOutlet) GetLastUpdatedOk() (*time.Time, bool) { @@ -802,11 +860,28 @@ func (o *PowerOutlet) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *PowerOutlet) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *PowerOutlet) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *PowerOutlet) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *PowerOutlet) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetOccupied returns the Occupied field value func (o *PowerOutlet) GetOccupied() bool { @@ -872,14 +947,20 @@ func (o PowerOutlet) ToMap() (map[string]interface{}, error) { if !IsNil(o.MarkConnected) { toSerialize["mark_connected"] = o.MarkConnected } - toSerialize["cable"] = o.Cable.Get() + if o.Cable.IsSet() { + toSerialize["cable"] = o.Cable.Get() + } toSerialize["cable_end"] = o.CableEnd toSerialize["link_peers"] = o.LinkPeers - toSerialize["link_peers_type"] = o.LinkPeersType.Get() + if o.LinkPeersType.IsSet() { + toSerialize["link_peers_type"] = o.LinkPeersType.Get() + } if o.ConnectedEndpoints != nil { toSerialize["connected_endpoints"] = o.ConnectedEndpoints } - toSerialize["connected_endpoints_type"] = o.ConnectedEndpointsType.Get() + if o.ConnectedEndpointsType.IsSet() { + toSerialize["connected_endpoints_type"] = o.ConnectedEndpointsType.Get() + } toSerialize["connected_endpoints_reachable"] = o.ConnectedEndpointsReachable if !IsNil(o.Tags) { toSerialize["tags"] = o.Tags @@ -887,8 +968,12 @@ func (o PowerOutlet) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["_occupied"] = o.Occupied for key, value := range o.AdditionalProperties { @@ -908,15 +993,9 @@ func (o *PowerOutlet) UnmarshalJSON(data []byte) (err error) { "display", "device", "name", - "cable", "cable_end", "link_peers", - "link_peers_type", - "connected_endpoints", - "connected_endpoints_type", "connected_endpoints_reachable", - "created", - "last_updated", "_occupied", } diff --git a/netbox/model_power_outlet_template.go b/netbox/model_power_outlet_template.go index de83e7936..78ab6f938 100644 --- a/netbox/model_power_outlet_template.go +++ b/netbox/model_power_outlet_template.go @@ -34,8 +34,8 @@ type PowerOutletTemplate struct { PowerPort NullableBriefPowerPortTemplate `json:"power_port,omitempty"` FeedLeg NullablePowerOutletFeedLeg `json:"feed_leg,omitempty"` Description *string `json:"description,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -45,14 +45,12 @@ type _PowerOutletTemplate PowerOutletTemplate // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewPowerOutletTemplate(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime) *PowerOutletTemplate { +func NewPowerOutletTemplate(id int32, url string, display string, name string) *PowerOutletTemplate { this := PowerOutletTemplate{} this.Id = id this.Url = url this.Display = display this.Name = name - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -438,18 +436,16 @@ func (o *PowerOutletTemplate) SetDescription(v string) { o.Description = &v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerOutletTemplate) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerOutletTemplate) GetCreatedOk() (*time.Time, bool) { @@ -459,24 +455,39 @@ func (o *PowerOutletTemplate) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *PowerOutletTemplate) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *PowerOutletTemplate) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *PowerOutletTemplate) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *PowerOutletTemplate) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerOutletTemplate) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerOutletTemplate) GetLastUpdatedOk() (*time.Time, bool) { @@ -486,11 +497,28 @@ func (o *PowerOutletTemplate) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *PowerOutletTemplate) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *PowerOutletTemplate) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *PowerOutletTemplate) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *PowerOutletTemplate) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o PowerOutletTemplate) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -527,8 +555,12 @@ func (o PowerOutletTemplate) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -546,8 +578,6 @@ func (o *PowerOutletTemplate) UnmarshalJSON(data []byte) (err error) { "url", "display", "name", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_power_panel.go b/netbox/model_power_panel.go index a31ad57ec..0ff7d6081 100644 --- a/netbox/model_power_panel.go +++ b/netbox/model_power_panel.go @@ -33,8 +33,8 @@ type PowerPanel struct { Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` PowerfeedCount int64 `json:"powerfeed_count"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -44,7 +44,7 @@ type _PowerPanel PowerPanel // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewPowerPanel(id int32, url string, display string, site BriefSite, name string, powerfeedCount int64, created NullableTime, lastUpdated NullableTime) *PowerPanel { +func NewPowerPanel(id int32, url string, display string, site BriefSite, name string, powerfeedCount int64) *PowerPanel { this := PowerPanel{} this.Id = id this.Url = url @@ -52,8 +52,6 @@ func NewPowerPanel(id int32, url string, display string, site BriefSite, name st this.Site = site this.Name = name this.PowerfeedCount = powerfeedCount - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -417,18 +415,16 @@ func (o *PowerPanel) SetPowerfeedCount(v int64) { } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerPanel) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerPanel) GetCreatedOk() (*time.Time, bool) { @@ -438,24 +434,39 @@ func (o *PowerPanel) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *PowerPanel) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *PowerPanel) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *PowerPanel) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *PowerPanel) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerPanel) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerPanel) GetLastUpdatedOk() (*time.Time, bool) { @@ -465,11 +476,28 @@ func (o *PowerPanel) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *PowerPanel) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *PowerPanel) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *PowerPanel) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *PowerPanel) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o PowerPanel) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -505,8 +533,12 @@ func (o PowerPanel) ToMap() (map[string]interface{}, error) { toSerialize["custom_fields"] = o.CustomFields } toSerialize["powerfeed_count"] = o.PowerfeedCount - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -526,8 +558,6 @@ func (o *PowerPanel) UnmarshalJSON(data []byte) (err error) { "site", "name", "powerfeed_count", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_power_port.go b/netbox/model_power_port.go index 325b7247e..048855aca 100644 --- a/netbox/model_power_port.go +++ b/netbox/model_power_port.go @@ -38,18 +38,18 @@ type PowerPort struct { Description *string `json:"description,omitempty"` // Treat as if a cable is connected MarkConnected *bool `json:"mark_connected,omitempty"` - Cable NullableBriefCable `json:"cable"` + Cable NullableBriefCable `json:"cable,omitempty"` CableEnd string `json:"cable_end"` LinkPeers []interface{} `json:"link_peers"` // Return the type of the peer link terminations, or None. - LinkPeersType NullableString `json:"link_peers_type"` - ConnectedEndpoints []interface{} `json:"connected_endpoints"` - ConnectedEndpointsType NullableString `json:"connected_endpoints_type"` + LinkPeersType NullableString `json:"link_peers_type,omitempty"` + ConnectedEndpoints []interface{} `json:"connected_endpoints,omitempty"` + ConnectedEndpointsType NullableString `json:"connected_endpoints_type,omitempty"` ConnectedEndpointsReachable bool `json:"connected_endpoints_reachable"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` Occupied bool `json:"_occupied"` AdditionalProperties map[string]interface{} } @@ -60,22 +60,16 @@ type _PowerPort PowerPort // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewPowerPort(id int32, url string, display string, device BriefDevice, name string, cable NullableBriefCable, cableEnd string, linkPeers []interface{}, linkPeersType NullableString, connectedEndpoints []interface{}, connectedEndpointsType NullableString, connectedEndpointsReachable bool, created NullableTime, lastUpdated NullableTime, occupied bool) *PowerPort { +func NewPowerPort(id int32, url string, display string, device BriefDevice, name string, cableEnd string, linkPeers []interface{}, connectedEndpointsReachable bool, occupied bool) *PowerPort { this := PowerPort{} this.Id = id this.Url = url this.Display = display this.Device = device this.Name = name - this.Cable = cable this.CableEnd = cableEnd this.LinkPeers = linkPeers - this.LinkPeersType = linkPeersType - this.ConnectedEndpoints = connectedEndpoints - this.ConnectedEndpointsType = connectedEndpointsType this.ConnectedEndpointsReachable = connectedEndpointsReachable - this.Created = created - this.LastUpdated = lastUpdated this.Occupied = occupied return &this } @@ -509,18 +503,16 @@ func (o *PowerPort) SetMarkConnected(v bool) { o.MarkConnected = &v } -// GetCable returns the Cable field value -// If the value is explicit nil, the zero value for BriefCable will be returned +// GetCable returns the Cable field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerPort) GetCable() BriefCable { - if o == nil || o.Cable.Get() == nil { + if o == nil || IsNil(o.Cable.Get()) { var ret BriefCable return ret } - return *o.Cable.Get() } -// GetCableOk returns a tuple with the Cable field value +// GetCableOk returns a tuple with the Cable field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerPort) GetCableOk() (*BriefCable, bool) { @@ -530,11 +522,28 @@ func (o *PowerPort) GetCableOk() (*BriefCable, bool) { return o.Cable.Get(), o.Cable.IsSet() } -// SetCable sets field value +// HasCable returns a boolean if a field has been set. +func (o *PowerPort) HasCable() bool { + if o != nil && o.Cable.IsSet() { + return true + } + + return false +} + +// SetCable gets a reference to the given NullableBriefCable and assigns it to the Cable field. func (o *PowerPort) SetCable(v BriefCable) { o.Cable.Set(&v) } +// SetCableNil sets the value for Cable to be an explicit nil +func (o *PowerPort) SetCableNil() { + o.Cable.Set(nil) +} +// UnsetCable ensures that no value is present for Cable, not even an explicit nil +func (o *PowerPort) UnsetCable() { + o.Cable.Unset() +} // GetCableEnd returns the CableEnd field value func (o *PowerPort) GetCableEnd() string { @@ -586,18 +595,16 @@ func (o *PowerPort) SetLinkPeers(v []interface{}) { } -// GetLinkPeersType returns the LinkPeersType field value -// If the value is explicit nil, the zero value for string will be returned +// GetLinkPeersType returns the LinkPeersType field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerPort) GetLinkPeersType() string { - if o == nil || o.LinkPeersType.Get() == nil { + if o == nil || IsNil(o.LinkPeersType.Get()) { var ret string return ret } - return *o.LinkPeersType.Get() } -// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value +// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerPort) GetLinkPeersTypeOk() (*string, bool) { @@ -607,24 +614,39 @@ func (o *PowerPort) GetLinkPeersTypeOk() (*string, bool) { return o.LinkPeersType.Get(), o.LinkPeersType.IsSet() } -// SetLinkPeersType sets field value +// HasLinkPeersType returns a boolean if a field has been set. +func (o *PowerPort) HasLinkPeersType() bool { + if o != nil && o.LinkPeersType.IsSet() { + return true + } + + return false +} + +// SetLinkPeersType gets a reference to the given NullableString and assigns it to the LinkPeersType field. func (o *PowerPort) SetLinkPeersType(v string) { o.LinkPeersType.Set(&v) } +// SetLinkPeersTypeNil sets the value for LinkPeersType to be an explicit nil +func (o *PowerPort) SetLinkPeersTypeNil() { + o.LinkPeersType.Set(nil) +} +// UnsetLinkPeersType ensures that no value is present for LinkPeersType, not even an explicit nil +func (o *PowerPort) UnsetLinkPeersType() { + o.LinkPeersType.Unset() +} -// GetConnectedEndpoints returns the ConnectedEndpoints field value -// If the value is explicit nil, the zero value for []interface{} will be returned +// GetConnectedEndpoints returns the ConnectedEndpoints field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerPort) GetConnectedEndpoints() []interface{} { if o == nil { var ret []interface{} return ret } - return o.ConnectedEndpoints } -// GetConnectedEndpointsOk returns a tuple with the ConnectedEndpoints field value +// GetConnectedEndpointsOk returns a tuple with the ConnectedEndpoints field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerPort) GetConnectedEndpointsOk() ([]interface{}, bool) { @@ -634,24 +656,30 @@ func (o *PowerPort) GetConnectedEndpointsOk() ([]interface{}, bool) { return o.ConnectedEndpoints, true } -// SetConnectedEndpoints sets field value +// HasConnectedEndpoints returns a boolean if a field has been set. +func (o *PowerPort) HasConnectedEndpoints() bool { + if o != nil && !IsNil(o.ConnectedEndpoints) { + return true + } + + return false +} + +// SetConnectedEndpoints gets a reference to the given []interface{} and assigns it to the ConnectedEndpoints field. func (o *PowerPort) SetConnectedEndpoints(v []interface{}) { o.ConnectedEndpoints = v } - -// GetConnectedEndpointsType returns the ConnectedEndpointsType field value -// If the value is explicit nil, the zero value for string will be returned +// GetConnectedEndpointsType returns the ConnectedEndpointsType field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerPort) GetConnectedEndpointsType() string { - if o == nil || o.ConnectedEndpointsType.Get() == nil { + if o == nil || IsNil(o.ConnectedEndpointsType.Get()) { var ret string return ret } - return *o.ConnectedEndpointsType.Get() } -// GetConnectedEndpointsTypeOk returns a tuple with the ConnectedEndpointsType field value +// GetConnectedEndpointsTypeOk returns a tuple with the ConnectedEndpointsType field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerPort) GetConnectedEndpointsTypeOk() (*string, bool) { @@ -661,11 +689,28 @@ func (o *PowerPort) GetConnectedEndpointsTypeOk() (*string, bool) { return o.ConnectedEndpointsType.Get(), o.ConnectedEndpointsType.IsSet() } -// SetConnectedEndpointsType sets field value +// HasConnectedEndpointsType returns a boolean if a field has been set. +func (o *PowerPort) HasConnectedEndpointsType() bool { + if o != nil && o.ConnectedEndpointsType.IsSet() { + return true + } + + return false +} + +// SetConnectedEndpointsType gets a reference to the given NullableString and assigns it to the ConnectedEndpointsType field. func (o *PowerPort) SetConnectedEndpointsType(v string) { o.ConnectedEndpointsType.Set(&v) } +// SetConnectedEndpointsTypeNil sets the value for ConnectedEndpointsType to be an explicit nil +func (o *PowerPort) SetConnectedEndpointsTypeNil() { + o.ConnectedEndpointsType.Set(nil) +} +// UnsetConnectedEndpointsType ensures that no value is present for ConnectedEndpointsType, not even an explicit nil +func (o *PowerPort) UnsetConnectedEndpointsType() { + o.ConnectedEndpointsType.Unset() +} // GetConnectedEndpointsReachable returns the ConnectedEndpointsReachable field value func (o *PowerPort) GetConnectedEndpointsReachable() bool { @@ -756,18 +801,16 @@ func (o *PowerPort) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerPort) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerPort) GetCreatedOk() (*time.Time, bool) { @@ -777,24 +820,39 @@ func (o *PowerPort) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *PowerPort) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *PowerPort) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *PowerPort) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *PowerPort) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerPort) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerPort) GetLastUpdatedOk() (*time.Time, bool) { @@ -804,11 +862,28 @@ func (o *PowerPort) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *PowerPort) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *PowerPort) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *PowerPort) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *PowerPort) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetOccupied returns the Occupied field value func (o *PowerPort) GetOccupied() bool { @@ -874,14 +949,20 @@ func (o PowerPort) ToMap() (map[string]interface{}, error) { if !IsNil(o.MarkConnected) { toSerialize["mark_connected"] = o.MarkConnected } - toSerialize["cable"] = o.Cable.Get() + if o.Cable.IsSet() { + toSerialize["cable"] = o.Cable.Get() + } toSerialize["cable_end"] = o.CableEnd toSerialize["link_peers"] = o.LinkPeers - toSerialize["link_peers_type"] = o.LinkPeersType.Get() + if o.LinkPeersType.IsSet() { + toSerialize["link_peers_type"] = o.LinkPeersType.Get() + } if o.ConnectedEndpoints != nil { toSerialize["connected_endpoints"] = o.ConnectedEndpoints } - toSerialize["connected_endpoints_type"] = o.ConnectedEndpointsType.Get() + if o.ConnectedEndpointsType.IsSet() { + toSerialize["connected_endpoints_type"] = o.ConnectedEndpointsType.Get() + } toSerialize["connected_endpoints_reachable"] = o.ConnectedEndpointsReachable if !IsNil(o.Tags) { toSerialize["tags"] = o.Tags @@ -889,8 +970,12 @@ func (o PowerPort) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["_occupied"] = o.Occupied for key, value := range o.AdditionalProperties { @@ -910,15 +995,9 @@ func (o *PowerPort) UnmarshalJSON(data []byte) (err error) { "display", "device", "name", - "cable", "cable_end", "link_peers", - "link_peers_type", - "connected_endpoints", - "connected_endpoints_type", "connected_endpoints_reachable", - "created", - "last_updated", "_occupied", } diff --git a/netbox/model_power_port_template.go b/netbox/model_power_port_template.go index 4826a7024..21e498aea 100644 --- a/netbox/model_power_port_template.go +++ b/netbox/model_power_port_template.go @@ -36,8 +36,8 @@ type PowerPortTemplate struct { // Allocated power draw (watts) AllocatedDraw NullableInt32 `json:"allocated_draw,omitempty"` Description *string `json:"description,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -47,14 +47,12 @@ type _PowerPortTemplate PowerPortTemplate // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewPowerPortTemplate(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime) *PowerPortTemplate { +func NewPowerPortTemplate(id int32, url string, display string, name string) *PowerPortTemplate { this := PowerPortTemplate{} this.Id = id this.Url = url this.Display = display this.Name = name - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -440,18 +438,16 @@ func (o *PowerPortTemplate) SetDescription(v string) { o.Description = &v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerPortTemplate) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerPortTemplate) GetCreatedOk() (*time.Time, bool) { @@ -461,24 +457,39 @@ func (o *PowerPortTemplate) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *PowerPortTemplate) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *PowerPortTemplate) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *PowerPortTemplate) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *PowerPortTemplate) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PowerPortTemplate) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PowerPortTemplate) GetLastUpdatedOk() (*time.Time, bool) { @@ -488,11 +499,28 @@ func (o *PowerPortTemplate) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *PowerPortTemplate) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *PowerPortTemplate) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *PowerPortTemplate) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *PowerPortTemplate) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o PowerPortTemplate) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -529,8 +557,12 @@ func (o PowerPortTemplate) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -548,8 +580,6 @@ func (o *PowerPortTemplate) UnmarshalJSON(data []byte) (err error) { "url", "display", "name", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_prefix.go b/netbox/model_prefix.go index ae3143cc3..a854ba633 100644 --- a/netbox/model_prefix.go +++ b/netbox/model_prefix.go @@ -41,8 +41,8 @@ type Prefix struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` Children int32 `json:"children"` Depth int32 `json:"_depth"` AdditionalProperties map[string]interface{} @@ -54,15 +54,13 @@ type _Prefix Prefix // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewPrefix(id int32, url string, display string, family AggregateFamily, prefix string, created NullableTime, lastUpdated NullableTime, children int32, depth int32) *Prefix { +func NewPrefix(id int32, url string, display string, family AggregateFamily, prefix string, children int32, depth int32) *Prefix { this := Prefix{} this.Id = id this.Url = url this.Display = display this.Family = family this.Prefix = prefix - this.Created = created - this.LastUpdated = lastUpdated this.Children = children this.Depth = depth return &this @@ -667,18 +665,16 @@ func (o *Prefix) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Prefix) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Prefix) GetCreatedOk() (*time.Time, bool) { @@ -688,24 +684,39 @@ func (o *Prefix) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Prefix) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Prefix) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Prefix) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Prefix) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Prefix) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Prefix) GetLastUpdatedOk() (*time.Time, bool) { @@ -715,11 +726,28 @@ func (o *Prefix) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Prefix) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Prefix) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Prefix) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Prefix) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetChildren returns the Children field value func (o *Prefix) GetChildren() int32 { @@ -825,8 +853,12 @@ func (o Prefix) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["children"] = o.Children toSerialize["_depth"] = o.Depth @@ -847,8 +879,6 @@ func (o *Prefix) UnmarshalJSON(data []byte) (err error) { "display", "family", "prefix", - "created", - "last_updated", "children", "_depth", } diff --git a/netbox/model_provider.go b/netbox/model_provider.go index 6bd23a8cd..eb51581c8 100644 --- a/netbox/model_provider.go +++ b/netbox/model_provider.go @@ -34,8 +34,8 @@ type Provider struct { Asns []ASN `json:"asns,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` CircuitCount int64 `json:"circuit_count"` AdditionalProperties map[string]interface{} } @@ -46,15 +46,13 @@ type _Provider Provider // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewProvider(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, circuitCount int64) *Provider { +func NewProvider(id int32, url string, display string, name string, slug string, circuitCount int64) *Provider { this := Provider{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated this.CircuitCount = circuitCount return &this } @@ -416,18 +414,16 @@ func (o *Provider) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Provider) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Provider) GetCreatedOk() (*time.Time, bool) { @@ -437,24 +433,39 @@ func (o *Provider) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Provider) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Provider) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Provider) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Provider) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Provider) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Provider) GetLastUpdatedOk() (*time.Time, bool) { @@ -464,11 +475,28 @@ func (o *Provider) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Provider) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Provider) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Provider) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Provider) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetCircuitCount returns the CircuitCount field value func (o *Provider) GetCircuitCount() int64 { @@ -531,8 +559,12 @@ func (o Provider) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["circuit_count"] = o.CircuitCount for key, value := range o.AdditionalProperties { @@ -552,8 +584,6 @@ func (o *Provider) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", "circuit_count", } diff --git a/netbox/model_provider_account.go b/netbox/model_provider_account.go index 363f37d28..98a6afba3 100644 --- a/netbox/model_provider_account.go +++ b/netbox/model_provider_account.go @@ -32,8 +32,8 @@ type ProviderAccount struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -43,7 +43,7 @@ type _ProviderAccount ProviderAccount // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewProviderAccount(id int32, url string, display string, provider BriefProvider, account string, created NullableTime, lastUpdated NullableTime) *ProviderAccount { +func NewProviderAccount(id int32, url string, display string, provider BriefProvider, account string) *ProviderAccount { this := ProviderAccount{} this.Id = id this.Url = url @@ -52,8 +52,6 @@ func NewProviderAccount(id int32, url string, display string, provider BriefProv var name string = "" this.Name = &name this.Account = account - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -384,18 +382,16 @@ func (o *ProviderAccount) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ProviderAccount) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ProviderAccount) GetCreatedOk() (*time.Time, bool) { @@ -405,24 +401,39 @@ func (o *ProviderAccount) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ProviderAccount) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ProviderAccount) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ProviderAccount) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ProviderAccount) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ProviderAccount) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ProviderAccount) GetLastUpdatedOk() (*time.Time, bool) { @@ -432,11 +443,28 @@ func (o *ProviderAccount) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ProviderAccount) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ProviderAccount) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ProviderAccount) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ProviderAccount) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o ProviderAccount) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -471,8 +499,12 @@ func (o ProviderAccount) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -491,8 +523,6 @@ func (o *ProviderAccount) UnmarshalJSON(data []byte) (err error) { "display", "provider", "account", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_provider_network.go b/netbox/model_provider_network.go index 00ece78fc..9948fab3e 100644 --- a/netbox/model_provider_network.go +++ b/netbox/model_provider_network.go @@ -32,8 +32,8 @@ type ProviderNetwork struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -43,15 +43,13 @@ type _ProviderNetwork ProviderNetwork // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewProviderNetwork(id int32, url string, display string, provider BriefProvider, name string, created NullableTime, lastUpdated NullableTime) *ProviderNetwork { +func NewProviderNetwork(id int32, url string, display string, provider BriefProvider, name string) *ProviderNetwork { this := ProviderNetwork{} this.Id = id this.Url = url this.Display = display this.Provider = provider this.Name = name - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -380,18 +378,16 @@ func (o *ProviderNetwork) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ProviderNetwork) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ProviderNetwork) GetCreatedOk() (*time.Time, bool) { @@ -401,24 +397,39 @@ func (o *ProviderNetwork) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ProviderNetwork) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ProviderNetwork) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ProviderNetwork) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ProviderNetwork) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ProviderNetwork) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ProviderNetwork) GetLastUpdatedOk() (*time.Time, bool) { @@ -428,11 +439,28 @@ func (o *ProviderNetwork) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ProviderNetwork) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ProviderNetwork) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ProviderNetwork) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ProviderNetwork) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o ProviderNetwork) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -467,8 +495,12 @@ func (o ProviderNetwork) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -487,8 +519,6 @@ func (o *ProviderNetwork) UnmarshalJSON(data []byte) (err error) { "display", "provider", "name", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_rack.go b/netbox/model_rack.go index cefd4c950..61322c8b5 100644 --- a/netbox/model_rack.go +++ b/netbox/model_rack.go @@ -60,8 +60,8 @@ type Rack struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` DeviceCount *int64 `json:"device_count,omitempty"` PowerfeedCount int64 `json:"powerfeed_count"` AdditionalProperties map[string]interface{} @@ -73,15 +73,13 @@ type _Rack Rack // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRack(id int32, url string, display string, name string, site BriefSite, created NullableTime, lastUpdated NullableTime, powerfeedCount int64) *Rack { +func NewRack(id int32, url string, display string, name string, site BriefSite, powerfeedCount int64) *Rack { this := Rack{} this.Id = id this.Url = url this.Display = display this.Name = name this.Site = site - this.Created = created - this.LastUpdated = lastUpdated this.PowerfeedCount = powerfeedCount return &this } @@ -1191,18 +1189,16 @@ func (o *Rack) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Rack) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Rack) GetCreatedOk() (*time.Time, bool) { @@ -1212,24 +1208,39 @@ func (o *Rack) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Rack) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Rack) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Rack) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Rack) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Rack) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Rack) GetLastUpdatedOk() (*time.Time, bool) { @@ -1239,11 +1250,28 @@ func (o *Rack) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Rack) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Rack) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Rack) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Rack) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetDeviceCount returns the DeviceCount field value if set, zero value otherwise. func (o *Rack) GetDeviceCount() int64 { @@ -1395,8 +1423,12 @@ func (o Rack) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } if !IsNil(o.DeviceCount) { toSerialize["device_count"] = o.DeviceCount } @@ -1419,8 +1451,6 @@ func (o *Rack) UnmarshalJSON(data []byte) (err error) { "display", "name", "site", - "created", - "last_updated", "powerfeed_count", } diff --git a/netbox/model_rack_reservation.go b/netbox/model_rack_reservation.go index 0cd01b583..c5ff0ea50 100644 --- a/netbox/model_rack_reservation.go +++ b/netbox/model_rack_reservation.go @@ -27,8 +27,8 @@ type RackReservation struct { Display string `json:"display"` Rack BriefRack `json:"rack"` Units []int32 `json:"units"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` User BriefUser `json:"user"` Tenant NullableBriefTenant `json:"tenant,omitempty"` Description string `json:"description"` @@ -44,15 +44,13 @@ type _RackReservation RackReservation // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRackReservation(id int32, url string, display string, rack BriefRack, units []int32, created NullableTime, lastUpdated NullableTime, user BriefUser, description string) *RackReservation { +func NewRackReservation(id int32, url string, display string, rack BriefRack, units []int32, user BriefUser, description string) *RackReservation { this := RackReservation{} this.Id = id this.Url = url this.Display = display this.Rack = rack this.Units = units - this.Created = created - this.LastUpdated = lastUpdated this.User = user this.Description = description return &this @@ -223,18 +221,16 @@ func (o *RackReservation) SetUnits(v []int32) { } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *RackReservation) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RackReservation) GetCreatedOk() (*time.Time, bool) { @@ -244,24 +240,39 @@ func (o *RackReservation) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *RackReservation) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *RackReservation) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *RackReservation) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *RackReservation) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *RackReservation) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RackReservation) GetLastUpdatedOk() (*time.Time, bool) { @@ -271,11 +282,28 @@ func (o *RackReservation) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *RackReservation) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *RackReservation) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *RackReservation) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *RackReservation) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetUser returns the User field value func (o *RackReservation) GetUser() BriefUser { @@ -483,8 +511,12 @@ func (o RackReservation) ToMap() (map[string]interface{}, error) { toSerialize["display"] = o.Display toSerialize["rack"] = o.Rack toSerialize["units"] = o.Units - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["user"] = o.User if o.Tenant.IsSet() { toSerialize["tenant"] = o.Tenant.Get() @@ -517,8 +549,6 @@ func (o *RackReservation) UnmarshalJSON(data []byte) (err error) { "display", "rack", "units", - "created", - "last_updated", "user", "description", } diff --git a/netbox/model_rack_role.go b/netbox/model_rack_role.go index 6f6580065..2602b7357 100644 --- a/netbox/model_rack_role.go +++ b/netbox/model_rack_role.go @@ -31,8 +31,8 @@ type RackRole struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` RackCount *int64 `json:"rack_count,omitempty"` AdditionalProperties map[string]interface{} } @@ -43,15 +43,13 @@ type _RackRole RackRole // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRackRole(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime) *RackRole { +func NewRackRole(id int32, url string, display string, name string, slug string) *RackRole { this := RackRole{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -348,18 +346,16 @@ func (o *RackRole) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *RackRole) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RackRole) GetCreatedOk() (*time.Time, bool) { @@ -369,24 +365,39 @@ func (o *RackRole) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *RackRole) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *RackRole) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *RackRole) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *RackRole) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *RackRole) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RackRole) GetLastUpdatedOk() (*time.Time, bool) { @@ -396,11 +407,28 @@ func (o *RackRole) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *RackRole) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *RackRole) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *RackRole) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *RackRole) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetRackCount returns the RackCount field value if set, zero value otherwise. func (o *RackRole) GetRackCount() int64 { @@ -464,8 +492,12 @@ func (o RackRole) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } if !IsNil(o.RackCount) { toSerialize["rack_count"] = o.RackCount } @@ -487,8 +519,6 @@ func (o *RackRole) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_rack_type.go b/netbox/model_rack_type.go index 5665b9043..3ac24f861 100644 --- a/netbox/model_rack_type.go +++ b/netbox/model_rack_type.go @@ -51,8 +51,8 @@ type RackType struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -62,7 +62,7 @@ type _RackType RackType // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRackType(id int32, url string, display string, manufacturer BriefManufacturer, model string, slug string, created NullableTime, lastUpdated NullableTime) *RackType { +func NewRackType(id int32, url string, display string, manufacturer BriefManufacturer, model string, slug string) *RackType { this := RackType{} this.Id = id this.Url = url @@ -70,8 +70,6 @@ func NewRackType(id int32, url string, display string, manufacturer BriefManufac this.Manufacturer = manufacturer this.Model = model this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -857,18 +855,16 @@ func (o *RackType) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *RackType) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RackType) GetCreatedOk() (*time.Time, bool) { @@ -878,24 +874,39 @@ func (o *RackType) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *RackType) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *RackType) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *RackType) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *RackType) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *RackType) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RackType) GetLastUpdatedOk() (*time.Time, bool) { @@ -905,11 +916,28 @@ func (o *RackType) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *RackType) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *RackType) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *RackType) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *RackType) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o RackType) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -978,8 +1006,12 @@ func (o RackType) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -999,8 +1031,6 @@ func (o *RackType) UnmarshalJSON(data []byte) (err error) { "manufacturer", "model", "slug", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_rear_port.go b/netbox/model_rear_port.go index 545dd0d5f..c56dc1f5e 100644 --- a/netbox/model_rear_port.go +++ b/netbox/model_rear_port.go @@ -37,15 +37,15 @@ type RearPort struct { Description *string `json:"description,omitempty"` // Treat as if a cable is connected MarkConnected *bool `json:"mark_connected,omitempty"` - Cable NullableBriefCable `json:"cable"` + Cable NullableBriefCable `json:"cable,omitempty"` CableEnd string `json:"cable_end"` LinkPeers []interface{} `json:"link_peers"` // Return the type of the peer link terminations, or None. - LinkPeersType NullableString `json:"link_peers_type"` + LinkPeersType NullableString `json:"link_peers_type,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` Occupied bool `json:"_occupied"` AdditionalProperties map[string]interface{} } @@ -56,7 +56,7 @@ type _RearPort RearPort // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRearPort(id int32, url string, display string, device BriefDevice, name string, type_ FrontPortType, cable NullableBriefCable, cableEnd string, linkPeers []interface{}, linkPeersType NullableString, created NullableTime, lastUpdated NullableTime, occupied bool) *RearPort { +func NewRearPort(id int32, url string, display string, device BriefDevice, name string, type_ FrontPortType, cableEnd string, linkPeers []interface{}, occupied bool) *RearPort { this := RearPort{} this.Id = id this.Url = url @@ -64,12 +64,8 @@ func NewRearPort(id int32, url string, display string, device BriefDevice, name this.Device = device this.Name = name this.Type = type_ - this.Cable = cable this.CableEnd = cableEnd this.LinkPeers = linkPeers - this.LinkPeersType = linkPeersType - this.Created = created - this.LastUpdated = lastUpdated this.Occupied = occupied return &this } @@ -466,18 +462,16 @@ func (o *RearPort) SetMarkConnected(v bool) { o.MarkConnected = &v } -// GetCable returns the Cable field value -// If the value is explicit nil, the zero value for BriefCable will be returned +// GetCable returns the Cable field value if set, zero value otherwise (both if not set or set to explicit null). func (o *RearPort) GetCable() BriefCable { - if o == nil || o.Cable.Get() == nil { + if o == nil || IsNil(o.Cable.Get()) { var ret BriefCable return ret } - return *o.Cable.Get() } -// GetCableOk returns a tuple with the Cable field value +// GetCableOk returns a tuple with the Cable field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RearPort) GetCableOk() (*BriefCable, bool) { @@ -487,11 +481,28 @@ func (o *RearPort) GetCableOk() (*BriefCable, bool) { return o.Cable.Get(), o.Cable.IsSet() } -// SetCable sets field value +// HasCable returns a boolean if a field has been set. +func (o *RearPort) HasCable() bool { + if o != nil && o.Cable.IsSet() { + return true + } + + return false +} + +// SetCable gets a reference to the given NullableBriefCable and assigns it to the Cable field. func (o *RearPort) SetCable(v BriefCable) { o.Cable.Set(&v) } +// SetCableNil sets the value for Cable to be an explicit nil +func (o *RearPort) SetCableNil() { + o.Cable.Set(nil) +} +// UnsetCable ensures that no value is present for Cable, not even an explicit nil +func (o *RearPort) UnsetCable() { + o.Cable.Unset() +} // GetCableEnd returns the CableEnd field value func (o *RearPort) GetCableEnd() string { @@ -543,18 +554,16 @@ func (o *RearPort) SetLinkPeers(v []interface{}) { } -// GetLinkPeersType returns the LinkPeersType field value -// If the value is explicit nil, the zero value for string will be returned +// GetLinkPeersType returns the LinkPeersType field value if set, zero value otherwise (both if not set or set to explicit null). func (o *RearPort) GetLinkPeersType() string { - if o == nil || o.LinkPeersType.Get() == nil { + if o == nil || IsNil(o.LinkPeersType.Get()) { var ret string return ret } - return *o.LinkPeersType.Get() } -// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value +// GetLinkPeersTypeOk returns a tuple with the LinkPeersType field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RearPort) GetLinkPeersTypeOk() (*string, bool) { @@ -564,11 +573,28 @@ func (o *RearPort) GetLinkPeersTypeOk() (*string, bool) { return o.LinkPeersType.Get(), o.LinkPeersType.IsSet() } -// SetLinkPeersType sets field value +// HasLinkPeersType returns a boolean if a field has been set. +func (o *RearPort) HasLinkPeersType() bool { + if o != nil && o.LinkPeersType.IsSet() { + return true + } + + return false +} + +// SetLinkPeersType gets a reference to the given NullableString and assigns it to the LinkPeersType field. func (o *RearPort) SetLinkPeersType(v string) { o.LinkPeersType.Set(&v) } +// SetLinkPeersTypeNil sets the value for LinkPeersType to be an explicit nil +func (o *RearPort) SetLinkPeersTypeNil() { + o.LinkPeersType.Set(nil) +} +// UnsetLinkPeersType ensures that no value is present for LinkPeersType, not even an explicit nil +func (o *RearPort) UnsetLinkPeersType() { + o.LinkPeersType.Unset() +} // GetTags returns the Tags field value if set, zero value otherwise. func (o *RearPort) GetTags() []NestedTag { @@ -634,18 +660,16 @@ func (o *RearPort) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *RearPort) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RearPort) GetCreatedOk() (*time.Time, bool) { @@ -655,24 +679,39 @@ func (o *RearPort) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *RearPort) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *RearPort) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *RearPort) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *RearPort) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *RearPort) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RearPort) GetLastUpdatedOk() (*time.Time, bool) { @@ -682,11 +721,28 @@ func (o *RearPort) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *RearPort) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *RearPort) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *RearPort) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *RearPort) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetOccupied returns the Occupied field value func (o *RearPort) GetOccupied() bool { @@ -750,18 +806,26 @@ func (o RearPort) ToMap() (map[string]interface{}, error) { if !IsNil(o.MarkConnected) { toSerialize["mark_connected"] = o.MarkConnected } - toSerialize["cable"] = o.Cable.Get() + if o.Cable.IsSet() { + toSerialize["cable"] = o.Cable.Get() + } toSerialize["cable_end"] = o.CableEnd toSerialize["link_peers"] = o.LinkPeers - toSerialize["link_peers_type"] = o.LinkPeersType.Get() + if o.LinkPeersType.IsSet() { + toSerialize["link_peers_type"] = o.LinkPeersType.Get() + } if !IsNil(o.Tags) { toSerialize["tags"] = o.Tags } if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["_occupied"] = o.Occupied for key, value := range o.AdditionalProperties { @@ -782,12 +846,8 @@ func (o *RearPort) UnmarshalJSON(data []byte) (err error) { "device", "name", "type", - "cable", "cable_end", "link_peers", - "link_peers_type", - "created", - "last_updated", "_occupied", } diff --git a/netbox/model_rear_port_template.go b/netbox/model_rear_port_template.go index 2a2827954..14522e18d 100644 --- a/netbox/model_rear_port_template.go +++ b/netbox/model_rear_port_template.go @@ -34,8 +34,8 @@ type RearPortTemplate struct { Color *string `json:"color,omitempty" validate:"regexp=^[0-9a-f]{6}$"` Positions *int32 `json:"positions,omitempty"` Description *string `json:"description,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -45,15 +45,13 @@ type _RearPortTemplate RearPortTemplate // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRearPortTemplate(id int32, url string, display string, name string, type_ FrontPortType, created NullableTime, lastUpdated NullableTime) *RearPortTemplate { +func NewRearPortTemplate(id int32, url string, display string, name string, type_ FrontPortType) *RearPortTemplate { this := RearPortTemplate{} this.Id = id this.Url = url this.Display = display this.Name = name this.Type = type_ - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -402,18 +400,16 @@ func (o *RearPortTemplate) SetDescription(v string) { o.Description = &v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *RearPortTemplate) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RearPortTemplate) GetCreatedOk() (*time.Time, bool) { @@ -423,24 +419,39 @@ func (o *RearPortTemplate) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *RearPortTemplate) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *RearPortTemplate) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *RearPortTemplate) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *RearPortTemplate) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *RearPortTemplate) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RearPortTemplate) GetLastUpdatedOk() (*time.Time, bool) { @@ -450,11 +461,28 @@ func (o *RearPortTemplate) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *RearPortTemplate) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *RearPortTemplate) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *RearPortTemplate) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *RearPortTemplate) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o RearPortTemplate) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -489,8 +517,12 @@ func (o RearPortTemplate) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -509,8 +541,6 @@ func (o *RearPortTemplate) UnmarshalJSON(data []byte) (err error) { "display", "name", "type", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_region.go b/netbox/model_region.go index 1f11f731e..86dac1f42 100644 --- a/netbox/model_region.go +++ b/netbox/model_region.go @@ -31,9 +31,9 @@ type Region struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` - SiteCount int32 `json:"site_count"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` + SiteCount *int32 `json:"site_count,omitempty"` Depth int32 `json:"_depth"` AdditionalProperties map[string]interface{} } @@ -44,16 +44,13 @@ type _Region Region // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRegion(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, siteCount int32, depth int32) *Region { +func NewRegion(id int32, url string, display string, name string, slug string, depth int32) *Region { this := Region{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated - this.SiteCount = siteCount this.Depth = depth return &this } @@ -361,18 +358,16 @@ func (o *Region) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Region) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Region) GetCreatedOk() (*time.Time, bool) { @@ -382,24 +377,39 @@ func (o *Region) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Region) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Region) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Region) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Region) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Region) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Region) GetLastUpdatedOk() (*time.Time, bool) { @@ -409,36 +419,60 @@ func (o *Region) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Region) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Region) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Region) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Region) UnsetLastUpdated() { + o.LastUpdated.Unset() +} -// GetSiteCount returns the SiteCount field value +// GetSiteCount returns the SiteCount field value if set, zero value otherwise. func (o *Region) GetSiteCount() int32 { - if o == nil { + if o == nil || IsNil(o.SiteCount) { var ret int32 return ret } - - return o.SiteCount + return *o.SiteCount } -// GetSiteCountOk returns a tuple with the SiteCount field value +// GetSiteCountOk returns a tuple with the SiteCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Region) GetSiteCountOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.SiteCount) { return nil, false } - return &o.SiteCount, true + return o.SiteCount, true } -// SetSiteCount sets field value -func (o *Region) SetSiteCount(v int32) { - o.SiteCount = v +// HasSiteCount returns a boolean if a field has been set. +func (o *Region) HasSiteCount() bool { + if o != nil && !IsNil(o.SiteCount) { + return true + } + + return false } +// SetSiteCount gets a reference to the given int32 and assigns it to the SiteCount field. +func (o *Region) SetSiteCount(v int32) { + o.SiteCount = &v +} // GetDepth returns the Depth field value func (o *Region) GetDepth() int32 { @@ -495,9 +529,15 @@ func (o Region) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() - toSerialize["site_count"] = o.SiteCount + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } + if !IsNil(o.SiteCount) { + toSerialize["site_count"] = o.SiteCount + } toSerialize["_depth"] = o.Depth for key, value := range o.AdditionalProperties { @@ -517,9 +557,6 @@ func (o *Region) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", - "site_count", "_depth", } diff --git a/netbox/model_rir.go b/netbox/model_rir.go index 0a5a3afaf..1d6bf183c 100644 --- a/netbox/model_rir.go +++ b/netbox/model_rir.go @@ -32,8 +32,8 @@ type RIR struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AggregateCount int64 `json:"aggregate_count"` AdditionalProperties map[string]interface{} } @@ -44,15 +44,13 @@ type _RIR RIR // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRIR(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, aggregateCount int64) *RIR { +func NewRIR(id int32, url string, display string, name string, slug string, aggregateCount int64) *RIR { this := RIR{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated this.AggregateCount = aggregateCount return &this } @@ -350,18 +348,16 @@ func (o *RIR) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *RIR) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RIR) GetCreatedOk() (*time.Time, bool) { @@ -371,24 +367,39 @@ func (o *RIR) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *RIR) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *RIR) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *RIR) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *RIR) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *RIR) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RIR) GetLastUpdatedOk() (*time.Time, bool) { @@ -398,11 +409,28 @@ func (o *RIR) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *RIR) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *RIR) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *RIR) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *RIR) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetAggregateCount returns the AggregateCount field value func (o *RIR) GetAggregateCount() int64 { @@ -459,8 +487,12 @@ func (o RIR) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["aggregate_count"] = o.AggregateCount for key, value := range o.AdditionalProperties { @@ -480,8 +512,6 @@ func (o *RIR) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", "aggregate_count", } diff --git a/netbox/model_role.go b/netbox/model_role.go index a14a1b8cc..ea17a7c5f 100644 --- a/netbox/model_role.go +++ b/netbox/model_role.go @@ -31,8 +31,8 @@ type Role struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` PrefixCount *int64 `json:"prefix_count,omitempty"` VlanCount *int64 `json:"vlan_count,omitempty"` AdditionalProperties map[string]interface{} @@ -44,15 +44,13 @@ type _Role Role // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRole(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime) *Role { +func NewRole(id int32, url string, display string, name string, slug string) *Role { this := Role{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -349,18 +347,16 @@ func (o *Role) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Role) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Role) GetCreatedOk() (*time.Time, bool) { @@ -370,24 +366,39 @@ func (o *Role) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Role) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Role) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Role) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Role) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Role) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Role) GetLastUpdatedOk() (*time.Time, bool) { @@ -397,11 +408,28 @@ func (o *Role) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Role) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Role) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Role) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Role) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetPrefixCount returns the PrefixCount field value if set, zero value otherwise. func (o *Role) GetPrefixCount() int64 { @@ -497,8 +525,12 @@ func (o Role) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } if !IsNil(o.PrefixCount) { toSerialize["prefix_count"] = o.PrefixCount } @@ -523,8 +555,6 @@ func (o *Role) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_route_target.go b/netbox/model_route_target.go index 757914e0a..87ec974c4 100644 --- a/netbox/model_route_target.go +++ b/netbox/model_route_target.go @@ -32,8 +32,8 @@ type RouteTarget struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -43,14 +43,12 @@ type _RouteTarget RouteTarget // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRouteTarget(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime) *RouteTarget { +func NewRouteTarget(id int32, url string, display string, name string) *RouteTarget { this := RouteTarget{} this.Id = id this.Url = url this.Display = display this.Name = name - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -364,18 +362,16 @@ func (o *RouteTarget) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *RouteTarget) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RouteTarget) GetCreatedOk() (*time.Time, bool) { @@ -385,24 +381,39 @@ func (o *RouteTarget) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *RouteTarget) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *RouteTarget) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *RouteTarget) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *RouteTarget) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *RouteTarget) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *RouteTarget) GetLastUpdatedOk() (*time.Time, bool) { @@ -412,11 +423,28 @@ func (o *RouteTarget) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *RouteTarget) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *RouteTarget) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *RouteTarget) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *RouteTarget) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o RouteTarget) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -450,8 +478,12 @@ func (o RouteTarget) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -469,8 +501,6 @@ func (o *RouteTarget) UnmarshalJSON(data []byte) (err error) { "url", "display", "name", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_saved_filter.go b/netbox/model_saved_filter.go index 3c849d009..d5b28e4c0 100644 --- a/netbox/model_saved_filter.go +++ b/netbox/model_saved_filter.go @@ -34,8 +34,8 @@ type SavedFilter struct { Enabled *bool `json:"enabled,omitempty"` Shared *bool `json:"shared,omitempty"` Parameters interface{} `json:"parameters"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -45,7 +45,7 @@ type _SavedFilter SavedFilter // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewSavedFilter(id int32, url string, display string, objectTypes []string, name string, slug string, parameters interface{}, created NullableTime, lastUpdated NullableTime) *SavedFilter { +func NewSavedFilter(id int32, url string, display string, objectTypes []string, name string, slug string, parameters interface{}) *SavedFilter { this := SavedFilter{} this.Id = id this.Url = url @@ -54,8 +54,6 @@ func NewSavedFilter(id int32, url string, display string, objectTypes []string, this.Name = name this.Slug = slug this.Parameters = parameters - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -446,18 +444,16 @@ func (o *SavedFilter) SetParameters(v interface{}) { } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *SavedFilter) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *SavedFilter) GetCreatedOk() (*time.Time, bool) { @@ -467,24 +463,39 @@ func (o *SavedFilter) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *SavedFilter) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *SavedFilter) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *SavedFilter) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *SavedFilter) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *SavedFilter) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *SavedFilter) GetLastUpdatedOk() (*time.Time, bool) { @@ -494,11 +505,28 @@ func (o *SavedFilter) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *SavedFilter) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *SavedFilter) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *SavedFilter) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *SavedFilter) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o SavedFilter) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -537,8 +565,12 @@ func (o SavedFilter) ToMap() (map[string]interface{}, error) { if o.Parameters != nil { toSerialize["parameters"] = o.Parameters } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -559,8 +591,6 @@ func (o *SavedFilter) UnmarshalJSON(data []byte) (err error) { "name", "slug", "parameters", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_script.go b/netbox/model_script.go index 5887880fc..7c42f8173 100644 --- a/netbox/model_script.go +++ b/netbox/model_script.go @@ -25,8 +25,8 @@ type Script struct { DisplayUrl *string `json:"display_url,omitempty"` Module int32 `json:"module"` Name string `json:"name"` - Description NullableString `json:"description"` - Vars interface{} `json:"vars"` + Description NullableString `json:"description,omitempty"` + Vars interface{} `json:"vars,omitempty"` Result BriefJob `json:"result"` Display string `json:"display"` IsExecutable bool `json:"is_executable"` @@ -39,14 +39,12 @@ type _Script Script // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewScript(id int32, url string, module int32, name string, description NullableString, vars interface{}, result BriefJob, display string, isExecutable bool) *Script { +func NewScript(id int32, url string, module int32, name string, result BriefJob, display string, isExecutable bool) *Script { this := Script{} this.Id = id this.Url = url this.Module = module this.Name = name - this.Description = description - this.Vars = vars this.Result = result this.Display = display this.IsExecutable = isExecutable @@ -193,18 +191,16 @@ func (o *Script) SetName(v string) { } -// GetDescription returns the Description field value -// If the value is explicit nil, the zero value for string will be returned +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Script) GetDescription() string { - if o == nil || o.Description.Get() == nil { + if o == nil || IsNil(o.Description.Get()) { var ret string return ret } - return *o.Description.Get() } -// GetDescriptionOk returns a tuple with the Description field value +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Script) GetDescriptionOk() (*string, bool) { @@ -214,24 +210,39 @@ func (o *Script) GetDescriptionOk() (*string, bool) { return o.Description.Get(), o.Description.IsSet() } -// SetDescription sets field value +// HasDescription returns a boolean if a field has been set. +func (o *Script) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. func (o *Script) SetDescription(v string) { o.Description.Set(&v) } +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *Script) SetDescriptionNil() { + o.Description.Set(nil) +} +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *Script) UnsetDescription() { + o.Description.Unset() +} -// GetVars returns the Vars field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetVars returns the Vars field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Script) GetVars() interface{} { if o == nil { var ret interface{} return ret } - return o.Vars } -// GetVarsOk returns a tuple with the Vars field value +// GetVarsOk returns a tuple with the Vars field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Script) GetVarsOk() (*interface{}, bool) { @@ -241,12 +252,20 @@ func (o *Script) GetVarsOk() (*interface{}, bool) { return &o.Vars, true } -// SetVars sets field value +// HasVars returns a boolean if a field has been set. +func (o *Script) HasVars() bool { + if o != nil && !IsNil(o.Vars) { + return true + } + + return false +} + +// SetVars gets a reference to the given interface{} and assigns it to the Vars field. func (o *Script) SetVars(v interface{}) { o.Vars = v } - // GetResult returns the Result field value func (o *Script) GetResult() BriefJob { if o == nil { @@ -339,7 +358,9 @@ func (o Script) ToMap() (map[string]interface{}, error) { } toSerialize["module"] = o.Module toSerialize["name"] = o.Name - toSerialize["description"] = o.Description.Get() + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } if o.Vars != nil { toSerialize["vars"] = o.Vars } @@ -363,8 +384,6 @@ func (o *Script) UnmarshalJSON(data []byte) (err error) { "url", "module", "name", - "description", - "vars", "result", "display", "is_executable", diff --git a/netbox/model_service.go b/netbox/model_service.go index 77b3b7cf6..199009eb2 100644 --- a/netbox/model_service.go +++ b/netbox/model_service.go @@ -35,8 +35,8 @@ type Service struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -46,15 +46,13 @@ type _Service Service // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewService(id int32, url string, display string, name string, ports []int32, created NullableTime, lastUpdated NullableTime) *Service { +func NewService(id int32, url string, display string, name string, ports []int32) *Service { this := Service{} this.Id = id this.Url = url this.Display = display this.Name = name this.Ports = ports - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -499,18 +497,16 @@ func (o *Service) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Service) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Service) GetCreatedOk() (*time.Time, bool) { @@ -520,24 +516,39 @@ func (o *Service) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Service) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Service) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Service) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Service) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Service) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Service) GetLastUpdatedOk() (*time.Time, bool) { @@ -547,11 +558,28 @@ func (o *Service) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Service) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Service) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Service) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Service) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o Service) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -595,8 +623,12 @@ func (o Service) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -615,8 +647,6 @@ func (o *Service) UnmarshalJSON(data []byte) (err error) { "display", "name", "ports", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_service_template.go b/netbox/model_service_template.go index 8356a94a0..ca11a47ae 100644 --- a/netbox/model_service_template.go +++ b/netbox/model_service_template.go @@ -32,8 +32,8 @@ type ServiceTemplate struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -43,15 +43,13 @@ type _ServiceTemplate ServiceTemplate // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewServiceTemplate(id int32, url string, display string, name string, ports []int32, created NullableTime, lastUpdated NullableTime) *ServiceTemplate { +func NewServiceTemplate(id int32, url string, display string, name string, ports []int32) *ServiceTemplate { this := ServiceTemplate{} this.Id = id this.Url = url this.Display = display this.Name = name this.Ports = ports - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -380,18 +378,16 @@ func (o *ServiceTemplate) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ServiceTemplate) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ServiceTemplate) GetCreatedOk() (*time.Time, bool) { @@ -401,24 +397,39 @@ func (o *ServiceTemplate) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *ServiceTemplate) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *ServiceTemplate) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *ServiceTemplate) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *ServiceTemplate) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ServiceTemplate) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ServiceTemplate) GetLastUpdatedOk() (*time.Time, bool) { @@ -428,11 +439,28 @@ func (o *ServiceTemplate) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *ServiceTemplate) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *ServiceTemplate) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *ServiceTemplate) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *ServiceTemplate) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o ServiceTemplate) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -467,8 +495,12 @@ func (o ServiceTemplate) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -487,8 +519,6 @@ func (o *ServiceTemplate) UnmarshalJSON(data []byte) (err error) { "display", "name", "ports", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_site.go b/netbox/model_site.go index 5dcc6c3fb..baa9f694e 100644 --- a/netbox/model_site.go +++ b/netbox/model_site.go @@ -48,8 +48,8 @@ type Site struct { Asns []ASN `json:"asns,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` CircuitCount int64 `json:"circuit_count"` DeviceCount *int64 `json:"device_count,omitempty"` PrefixCount *int64 `json:"prefix_count,omitempty"` @@ -65,15 +65,13 @@ type _Site Site // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewSite(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, circuitCount int64) *Site { +func NewSite(id int32, url string, display string, name string, slug string, circuitCount int64) *Site { this := Site{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated this.CircuitCount = circuitCount return &this } @@ -783,18 +781,16 @@ func (o *Site) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Site) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Site) GetCreatedOk() (*time.Time, bool) { @@ -804,24 +800,39 @@ func (o *Site) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Site) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Site) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Site) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Site) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Site) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Site) GetLastUpdatedOk() (*time.Time, bool) { @@ -831,11 +842,28 @@ func (o *Site) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Site) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Site) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Site) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Site) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetCircuitCount returns the CircuitCount field value func (o *Site) GetCircuitCount() int64 { @@ -1085,8 +1113,12 @@ func (o Site) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["circuit_count"] = o.CircuitCount if !IsNil(o.DeviceCount) { toSerialize["device_count"] = o.DeviceCount @@ -1121,8 +1153,6 @@ func (o *Site) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", "circuit_count", } diff --git a/netbox/model_site_group.go b/netbox/model_site_group.go index 148159006..586431f14 100644 --- a/netbox/model_site_group.go +++ b/netbox/model_site_group.go @@ -31,9 +31,9 @@ type SiteGroup struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` - SiteCount int32 `json:"site_count"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` + SiteCount *int32 `json:"site_count,omitempty"` Depth int32 `json:"_depth"` AdditionalProperties map[string]interface{} } @@ -44,16 +44,13 @@ type _SiteGroup SiteGroup // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewSiteGroup(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, siteCount int32, depth int32) *SiteGroup { +func NewSiteGroup(id int32, url string, display string, name string, slug string, depth int32) *SiteGroup { this := SiteGroup{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated - this.SiteCount = siteCount this.Depth = depth return &this } @@ -361,18 +358,16 @@ func (o *SiteGroup) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *SiteGroup) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *SiteGroup) GetCreatedOk() (*time.Time, bool) { @@ -382,24 +377,39 @@ func (o *SiteGroup) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *SiteGroup) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *SiteGroup) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *SiteGroup) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *SiteGroup) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *SiteGroup) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *SiteGroup) GetLastUpdatedOk() (*time.Time, bool) { @@ -409,36 +419,60 @@ func (o *SiteGroup) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *SiteGroup) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *SiteGroup) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *SiteGroup) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *SiteGroup) UnsetLastUpdated() { + o.LastUpdated.Unset() +} -// GetSiteCount returns the SiteCount field value +// GetSiteCount returns the SiteCount field value if set, zero value otherwise. func (o *SiteGroup) GetSiteCount() int32 { - if o == nil { + if o == nil || IsNil(o.SiteCount) { var ret int32 return ret } - - return o.SiteCount + return *o.SiteCount } -// GetSiteCountOk returns a tuple with the SiteCount field value +// GetSiteCountOk returns a tuple with the SiteCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SiteGroup) GetSiteCountOk() (*int32, bool) { - if o == nil { + if o == nil || IsNil(o.SiteCount) { return nil, false } - return &o.SiteCount, true + return o.SiteCount, true } -// SetSiteCount sets field value -func (o *SiteGroup) SetSiteCount(v int32) { - o.SiteCount = v +// HasSiteCount returns a boolean if a field has been set. +func (o *SiteGroup) HasSiteCount() bool { + if o != nil && !IsNil(o.SiteCount) { + return true + } + + return false } +// SetSiteCount gets a reference to the given int32 and assigns it to the SiteCount field. +func (o *SiteGroup) SetSiteCount(v int32) { + o.SiteCount = &v +} // GetDepth returns the Depth field value func (o *SiteGroup) GetDepth() int32 { @@ -495,9 +529,15 @@ func (o SiteGroup) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() - toSerialize["site_count"] = o.SiteCount + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } + if !IsNil(o.SiteCount) { + toSerialize["site_count"] = o.SiteCount + } toSerialize["_depth"] = o.Depth for key, value := range o.AdditionalProperties { @@ -517,9 +557,6 @@ func (o *SiteGroup) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", - "site_count", "_depth", } diff --git a/netbox/model_subscription.go b/netbox/model_subscription.go index efc98ef3b..76936ac09 100644 --- a/netbox/model_subscription.go +++ b/netbox/model_subscription.go @@ -26,9 +26,9 @@ type Subscription struct { Display string `json:"display"` ObjectType string `json:"object_type"` ObjectId int64 `json:"object_id"` - Object interface{} `json:"object"` + Object interface{} `json:"object,omitempty"` User BriefUser `json:"user"` - Created time.Time `json:"created"` + Created *time.Time `json:"created,omitempty"` AdditionalProperties map[string]interface{} } @@ -38,16 +38,14 @@ type _Subscription Subscription // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewSubscription(id int32, url string, display string, objectType string, objectId int64, object interface{}, user BriefUser, created time.Time) *Subscription { +func NewSubscription(id int32, url string, display string, objectType string, objectId int64, user BriefUser) *Subscription { this := Subscription{} this.Id = id this.Url = url this.Display = display this.ObjectType = objectType this.ObjectId = objectId - this.Object = object this.User = user - this.Created = created return &this } @@ -184,18 +182,16 @@ func (o *Subscription) SetObjectId(v int64) { } -// GetObject returns the Object field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetObject returns the Object field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Subscription) GetObject() interface{} { if o == nil { var ret interface{} return ret } - return o.Object } -// GetObjectOk returns a tuple with the Object field value +// GetObjectOk returns a tuple with the Object field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Subscription) GetObjectOk() (*interface{}, bool) { @@ -205,12 +201,20 @@ func (o *Subscription) GetObjectOk() (*interface{}, bool) { return &o.Object, true } -// SetObject sets field value +// HasObject returns a boolean if a field has been set. +func (o *Subscription) HasObject() bool { + if o != nil && !IsNil(o.Object) { + return true + } + + return false +} + +// SetObject gets a reference to the given interface{} and assigns it to the Object field. func (o *Subscription) SetObject(v interface{}) { o.Object = v } - // GetUser returns the User field value func (o *Subscription) GetUser() BriefUser { if o == nil { @@ -236,30 +240,37 @@ func (o *Subscription) SetUser(v BriefUser) { } -// GetCreated returns the Created field value +// GetCreated returns the Created field value if set, zero value otherwise. func (o *Subscription) GetCreated() time.Time { - if o == nil { + if o == nil || IsNil(o.Created) { var ret time.Time return ret } - - return o.Created + return *o.Created } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Subscription) GetCreatedOk() (*time.Time, bool) { - if o == nil { + if o == nil || IsNil(o.Created) { return nil, false } - return &o.Created, true + return o.Created, true } -// SetCreated sets field value -func (o *Subscription) SetCreated(v time.Time) { - o.Created = v +// HasCreated returns a boolean if a field has been set. +func (o *Subscription) HasCreated() bool { + if o != nil && !IsNil(o.Created) { + return true + } + + return false } +// SetCreated gets a reference to the given time.Time and assigns it to the Created field. +func (o *Subscription) SetCreated(v time.Time) { + o.Created = &v +} func (o Subscription) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -280,7 +291,9 @@ func (o Subscription) ToMap() (map[string]interface{}, error) { toSerialize["object"] = o.Object } toSerialize["user"] = o.User - toSerialize["created"] = o.Created + if !IsNil(o.Created) { + toSerialize["created"] = o.Created + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -299,9 +312,7 @@ func (o *Subscription) UnmarshalJSON(data []byte) (err error) { "display", "object_type", "object_id", - "object", "user", - "created", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_tag.go b/netbox/model_tag.go index 67567510c..3fa9f34ac 100644 --- a/netbox/model_tag.go +++ b/netbox/model_tag.go @@ -31,8 +31,8 @@ type Tag struct { Description *string `json:"description,omitempty"` ObjectTypes []string `json:"object_types,omitempty"` TaggedItems int64 `json:"tagged_items"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -42,7 +42,7 @@ type _Tag Tag // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewTag(id int32, url string, display string, name string, slug string, taggedItems int64, created NullableTime, lastUpdated NullableTime) *Tag { +func NewTag(id int32, url string, display string, name string, slug string, taggedItems int64) *Tag { this := Tag{} this.Id = id this.Url = url @@ -50,8 +50,6 @@ func NewTag(id int32, url string, display string, name string, slug string, tagg this.Name = name this.Slug = slug this.TaggedItems = taggedItems - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -341,18 +339,16 @@ func (o *Tag) SetTaggedItems(v int64) { } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Tag) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Tag) GetCreatedOk() (*time.Time, bool) { @@ -362,24 +358,39 @@ func (o *Tag) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Tag) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Tag) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Tag) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Tag) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Tag) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Tag) GetLastUpdatedOk() (*time.Time, bool) { @@ -389,11 +400,28 @@ func (o *Tag) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Tag) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Tag) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Tag) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Tag) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o Tag) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -423,8 +451,12 @@ func (o Tag) ToMap() (map[string]interface{}, error) { toSerialize["object_types"] = o.ObjectTypes } toSerialize["tagged_items"] = o.TaggedItems - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -444,8 +476,6 @@ func (o *Tag) UnmarshalJSON(data []byte) (err error) { "name", "slug", "tagged_items", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_tenant.go b/netbox/model_tenant.go index 442e03a69..d7548a80f 100644 --- a/netbox/model_tenant.go +++ b/netbox/model_tenant.go @@ -32,14 +32,14 @@ type Tenant struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` CircuitCount int64 `json:"circuit_count"` DeviceCount *int64 `json:"device_count,omitempty"` IpaddressCount int64 `json:"ipaddress_count"` PrefixCount *int64 `json:"prefix_count,omitempty"` RackCount *int64 `json:"rack_count,omitempty"` - SiteCount int64 `json:"site_count"` + SiteCount *int64 `json:"site_count,omitempty"` VirtualmachineCount *int64 `json:"virtualmachine_count,omitempty"` VlanCount *int64 `json:"vlan_count,omitempty"` VrfCount *int64 `json:"vrf_count,omitempty"` @@ -53,18 +53,15 @@ type _Tenant Tenant // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewTenant(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, circuitCount int64, ipaddressCount int64, siteCount int64) *Tenant { +func NewTenant(id int32, url string, display string, name string, slug string, circuitCount int64, ipaddressCount int64) *Tenant { this := Tenant{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated this.CircuitCount = circuitCount this.IpaddressCount = ipaddressCount - this.SiteCount = siteCount return &this } @@ -403,18 +400,16 @@ func (o *Tenant) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Tenant) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Tenant) GetCreatedOk() (*time.Time, bool) { @@ -424,24 +419,39 @@ func (o *Tenant) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Tenant) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Tenant) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Tenant) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Tenant) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Tenant) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Tenant) GetLastUpdatedOk() (*time.Time, bool) { @@ -451,11 +461,28 @@ func (o *Tenant) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Tenant) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Tenant) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Tenant) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Tenant) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetCircuitCount returns the CircuitCount field value func (o *Tenant) GetCircuitCount() int64 { @@ -603,30 +630,37 @@ func (o *Tenant) SetRackCount(v int64) { o.RackCount = &v } -// GetSiteCount returns the SiteCount field value +// GetSiteCount returns the SiteCount field value if set, zero value otherwise. func (o *Tenant) GetSiteCount() int64 { - if o == nil { + if o == nil || IsNil(o.SiteCount) { var ret int64 return ret } - - return o.SiteCount + return *o.SiteCount } -// GetSiteCountOk returns a tuple with the SiteCount field value +// GetSiteCountOk returns a tuple with the SiteCount field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Tenant) GetSiteCountOk() (*int64, bool) { - if o == nil { + if o == nil || IsNil(o.SiteCount) { return nil, false } - return &o.SiteCount, true + return o.SiteCount, true } -// SetSiteCount sets field value -func (o *Tenant) SetSiteCount(v int64) { - o.SiteCount = v +// HasSiteCount returns a boolean if a field has been set. +func (o *Tenant) HasSiteCount() bool { + if o != nil && !IsNil(o.SiteCount) { + return true + } + + return false } +// SetSiteCount gets a reference to the given int64 and assigns it to the SiteCount field. +func (o *Tenant) SetSiteCount(v int64) { + o.SiteCount = &v +} // GetVirtualmachineCount returns the VirtualmachineCount field value if set, zero value otherwise. func (o *Tenant) GetVirtualmachineCount() int64 { @@ -789,8 +823,12 @@ func (o Tenant) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["circuit_count"] = o.CircuitCount if !IsNil(o.DeviceCount) { toSerialize["device_count"] = o.DeviceCount @@ -802,7 +840,9 @@ func (o Tenant) ToMap() (map[string]interface{}, error) { if !IsNil(o.RackCount) { toSerialize["rack_count"] = o.RackCount } - toSerialize["site_count"] = o.SiteCount + if !IsNil(o.SiteCount) { + toSerialize["site_count"] = o.SiteCount + } if !IsNil(o.VirtualmachineCount) { toSerialize["virtualmachine_count"] = o.VirtualmachineCount } @@ -833,11 +873,8 @@ func (o *Tenant) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", "circuit_count", "ipaddress_count", - "site_count", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_tenant_group.go b/netbox/model_tenant_group.go index ab0cbd521..3f7a30fd3 100644 --- a/netbox/model_tenant_group.go +++ b/netbox/model_tenant_group.go @@ -31,8 +31,8 @@ type TenantGroup struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` TenantCount int32 `json:"tenant_count"` Depth int32 `json:"_depth"` AdditionalProperties map[string]interface{} @@ -44,15 +44,13 @@ type _TenantGroup TenantGroup // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewTenantGroup(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, tenantCount int32, depth int32) *TenantGroup { +func NewTenantGroup(id int32, url string, display string, name string, slug string, tenantCount int32, depth int32) *TenantGroup { this := TenantGroup{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated this.TenantCount = tenantCount this.Depth = depth return &this @@ -361,18 +359,16 @@ func (o *TenantGroup) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TenantGroup) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *TenantGroup) GetCreatedOk() (*time.Time, bool) { @@ -382,24 +378,39 @@ func (o *TenantGroup) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *TenantGroup) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *TenantGroup) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *TenantGroup) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *TenantGroup) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TenantGroup) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *TenantGroup) GetLastUpdatedOk() (*time.Time, bool) { @@ -409,11 +420,28 @@ func (o *TenantGroup) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *TenantGroup) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *TenantGroup) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *TenantGroup) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *TenantGroup) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetTenantCount returns the TenantCount field value func (o *TenantGroup) GetTenantCount() int32 { @@ -495,8 +523,12 @@ func (o TenantGroup) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["tenant_count"] = o.TenantCount toSerialize["_depth"] = o.Depth @@ -517,8 +549,6 @@ func (o *TenantGroup) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", "tenant_count", "_depth", } diff --git a/netbox/model_token.go b/netbox/model_token.go index 600a69769..646227603 100644 --- a/netbox/model_token.go +++ b/netbox/model_token.go @@ -26,7 +26,7 @@ type Token struct { DisplayUrl *string `json:"display_url,omitempty"` Display string `json:"display"` User BriefUser `json:"user"` - Created time.Time `json:"created"` + Created *time.Time `json:"created,omitempty"` Expires NullableTime `json:"expires,omitempty"` LastUsed NullableTime `json:"last_used,omitempty"` Key *string `json:"key,omitempty"` @@ -42,13 +42,12 @@ type _Token Token // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewToken(id int32, url string, display string, user BriefUser, created time.Time) *Token { +func NewToken(id int32, url string, display string, user BriefUser) *Token { this := Token{} this.Id = id this.Url = url this.Display = display this.User = user - this.Created = created return &this } @@ -192,30 +191,37 @@ func (o *Token) SetUser(v BriefUser) { } -// GetCreated returns the Created field value +// GetCreated returns the Created field value if set, zero value otherwise. func (o *Token) GetCreated() time.Time { - if o == nil { + if o == nil || IsNil(o.Created) { var ret time.Time return ret } - - return o.Created + return *o.Created } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Token) GetCreatedOk() (*time.Time, bool) { - if o == nil { + if o == nil || IsNil(o.Created) { return nil, false } - return &o.Created, true + return o.Created, true } -// SetCreated sets field value -func (o *Token) SetCreated(v time.Time) { - o.Created = v +// HasCreated returns a boolean if a field has been set. +func (o *Token) HasCreated() bool { + if o != nil && !IsNil(o.Created) { + return true + } + + return false } +// SetCreated gets a reference to the given time.Time and assigns it to the Created field. +func (o *Token) SetCreated(v time.Time) { + o.Created = &v +} // GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Token) GetExpires() time.Time { @@ -414,7 +420,9 @@ func (o Token) ToMap() (map[string]interface{}, error) { } toSerialize["display"] = o.Display toSerialize["user"] = o.User - toSerialize["created"] = o.Created + if !IsNil(o.Created) { + toSerialize["created"] = o.Created + } if o.Expires.IsSet() { toSerialize["expires"] = o.Expires.Get() } @@ -447,7 +455,6 @@ func (o *Token) UnmarshalJSON(data []byte) (err error) { "url", "display", "user", - "created", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_token_provision.go b/netbox/model_token_provision.go index 9794dcc88..7ce0a1bf4 100644 --- a/netbox/model_token_provision.go +++ b/netbox/model_token_provision.go @@ -26,7 +26,7 @@ type TokenProvision struct { DisplayUrl *string `json:"display_url,omitempty"` Display string `json:"display"` User BriefUser `json:"user"` - Created time.Time `json:"created"` + Created *time.Time `json:"created,omitempty"` Expires NullableTime `json:"expires,omitempty"` LastUsed time.Time `json:"last_used"` Key string `json:"key"` @@ -42,13 +42,12 @@ type _TokenProvision TokenProvision // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewTokenProvision(id int32, url string, display string, user BriefUser, created time.Time, lastUsed time.Time, key string) *TokenProvision { +func NewTokenProvision(id int32, url string, display string, user BriefUser, lastUsed time.Time, key string) *TokenProvision { this := TokenProvision{} this.Id = id this.Url = url this.Display = display this.User = user - this.Created = created this.LastUsed = lastUsed this.Key = key return &this @@ -194,30 +193,37 @@ func (o *TokenProvision) SetUser(v BriefUser) { } -// GetCreated returns the Created field value +// GetCreated returns the Created field value if set, zero value otherwise. func (o *TokenProvision) GetCreated() time.Time { - if o == nil { + if o == nil || IsNil(o.Created) { var ret time.Time return ret } - - return o.Created + return *o.Created } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TokenProvision) GetCreatedOk() (*time.Time, bool) { - if o == nil { + if o == nil || IsNil(o.Created) { return nil, false } - return &o.Created, true + return o.Created, true } -// SetCreated sets field value -func (o *TokenProvision) SetCreated(v time.Time) { - o.Created = v +// HasCreated returns a boolean if a field has been set. +func (o *TokenProvision) HasCreated() bool { + if o != nil && !IsNil(o.Created) { + return true + } + + return false } +// SetCreated gets a reference to the given time.Time and assigns it to the Created field. +func (o *TokenProvision) SetCreated(v time.Time) { + o.Created = &v +} // GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TokenProvision) GetExpires() time.Time { @@ -392,7 +398,9 @@ func (o TokenProvision) ToMap() (map[string]interface{}, error) { } toSerialize["display"] = o.Display toSerialize["user"] = o.User - toSerialize["created"] = o.Created + if !IsNil(o.Created) { + toSerialize["created"] = o.Created + } if o.Expires.IsSet() { toSerialize["expires"] = o.Expires.Get() } @@ -421,7 +429,6 @@ func (o *TokenProvision) UnmarshalJSON(data []byte) (err error) { "url", "display", "user", - "created", "last_used", "key", } diff --git a/netbox/model_tunnel.go b/netbox/model_tunnel.go index 0c54e1a41..5dc71b6bd 100644 --- a/netbox/model_tunnel.go +++ b/netbox/model_tunnel.go @@ -36,8 +36,8 @@ type Tunnel struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` TerminationsCount int64 `json:"terminations_count"` AdditionalProperties map[string]interface{} } @@ -48,7 +48,7 @@ type _Tunnel Tunnel // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewTunnel(id int32, url string, display string, name string, status TunnelStatus, encapsulation TunnelEncapsulation, created NullableTime, lastUpdated NullableTime, terminationsCount int64) *Tunnel { +func NewTunnel(id int32, url string, display string, name string, status TunnelStatus, encapsulation TunnelEncapsulation, terminationsCount int64) *Tunnel { this := Tunnel{} this.Id = id this.Url = url @@ -56,8 +56,6 @@ func NewTunnel(id int32, url string, display string, name string, status TunnelS this.Name = name this.Status = status this.Encapsulation = encapsulation - this.Created = created - this.LastUpdated = lastUpdated this.TerminationsCount = terminationsCount return &this } @@ -548,18 +546,16 @@ func (o *Tunnel) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Tunnel) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Tunnel) GetCreatedOk() (*time.Time, bool) { @@ -569,24 +565,39 @@ func (o *Tunnel) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Tunnel) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Tunnel) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Tunnel) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Tunnel) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Tunnel) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Tunnel) GetLastUpdatedOk() (*time.Time, bool) { @@ -596,11 +607,28 @@ func (o *Tunnel) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Tunnel) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Tunnel) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Tunnel) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Tunnel) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetTerminationsCount returns the TerminationsCount field value func (o *Tunnel) GetTerminationsCount() int64 { @@ -670,8 +698,12 @@ func (o Tunnel) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["terminations_count"] = o.TerminationsCount for key, value := range o.AdditionalProperties { @@ -692,8 +724,6 @@ func (o *Tunnel) UnmarshalJSON(data []byte) (err error) { "name", "status", "encapsulation", - "created", - "last_updated", "terminations_count", } diff --git a/netbox/model_tunnel_group.go b/netbox/model_tunnel_group.go index f9a9436f8..71d76d287 100644 --- a/netbox/model_tunnel_group.go +++ b/netbox/model_tunnel_group.go @@ -30,8 +30,8 @@ type TunnelGroup struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` TunnelCount int64 `json:"tunnel_count"` AdditionalProperties map[string]interface{} } @@ -42,15 +42,13 @@ type _TunnelGroup TunnelGroup // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewTunnelGroup(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, tunnelCount int64) *TunnelGroup { +func NewTunnelGroup(id int32, url string, display string, name string, slug string, tunnelCount int64) *TunnelGroup { this := TunnelGroup{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated this.TunnelCount = tunnelCount return &this } @@ -316,18 +314,16 @@ func (o *TunnelGroup) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TunnelGroup) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *TunnelGroup) GetCreatedOk() (*time.Time, bool) { @@ -337,24 +333,39 @@ func (o *TunnelGroup) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *TunnelGroup) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *TunnelGroup) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *TunnelGroup) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *TunnelGroup) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TunnelGroup) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *TunnelGroup) GetLastUpdatedOk() (*time.Time, bool) { @@ -364,11 +375,28 @@ func (o *TunnelGroup) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *TunnelGroup) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *TunnelGroup) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *TunnelGroup) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *TunnelGroup) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetTunnelCount returns the TunnelCount field value func (o *TunnelGroup) GetTunnelCount() int64 { @@ -422,8 +450,12 @@ func (o TunnelGroup) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["tunnel_count"] = o.TunnelCount for key, value := range o.AdditionalProperties { @@ -443,8 +475,6 @@ func (o *TunnelGroup) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", "tunnel_count", } diff --git a/netbox/model_tunnel_termination.go b/netbox/model_tunnel_termination.go index 28aa377dc..573d1dfdd 100644 --- a/netbox/model_tunnel_termination.go +++ b/netbox/model_tunnel_termination.go @@ -28,13 +28,13 @@ type TunnelTermination struct { Tunnel BriefTunnel `json:"tunnel"` Role TunnelTerminationRole `json:"role"` TerminationType string `json:"termination_type"` - TerminationId NullableInt64 `json:"termination_id"` - Termination interface{} `json:"termination"` + TerminationId NullableInt64 `json:"termination_id,omitempty"` + Termination interface{} `json:"termination,omitempty"` OutsideIp NullableBriefIPAddress `json:"outside_ip,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -44,7 +44,7 @@ type _TunnelTermination TunnelTermination // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewTunnelTermination(id int32, url string, display string, tunnel BriefTunnel, role TunnelTerminationRole, terminationType string, terminationId NullableInt64, termination interface{}, created NullableTime, lastUpdated NullableTime) *TunnelTermination { +func NewTunnelTermination(id int32, url string, display string, tunnel BriefTunnel, role TunnelTerminationRole, terminationType string) *TunnelTermination { this := TunnelTermination{} this.Id = id this.Url = url @@ -52,10 +52,6 @@ func NewTunnelTermination(id int32, url string, display string, tunnel BriefTunn this.Tunnel = tunnel this.Role = role this.TerminationType = terminationType - this.TerminationId = terminationId - this.Termination = termination - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -249,18 +245,16 @@ func (o *TunnelTermination) SetTerminationType(v string) { } -// GetTerminationId returns the TerminationId field value -// If the value is explicit nil, the zero value for int64 will be returned +// GetTerminationId returns the TerminationId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TunnelTermination) GetTerminationId() int64 { - if o == nil || o.TerminationId.Get() == nil { + if o == nil || IsNil(o.TerminationId.Get()) { var ret int64 return ret } - return *o.TerminationId.Get() } -// GetTerminationIdOk returns a tuple with the TerminationId field value +// GetTerminationIdOk returns a tuple with the TerminationId field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *TunnelTermination) GetTerminationIdOk() (*int64, bool) { @@ -270,24 +264,39 @@ func (o *TunnelTermination) GetTerminationIdOk() (*int64, bool) { return o.TerminationId.Get(), o.TerminationId.IsSet() } -// SetTerminationId sets field value +// HasTerminationId returns a boolean if a field has been set. +func (o *TunnelTermination) HasTerminationId() bool { + if o != nil && o.TerminationId.IsSet() { + return true + } + + return false +} + +// SetTerminationId gets a reference to the given NullableInt64 and assigns it to the TerminationId field. func (o *TunnelTermination) SetTerminationId(v int64) { o.TerminationId.Set(&v) } +// SetTerminationIdNil sets the value for TerminationId to be an explicit nil +func (o *TunnelTermination) SetTerminationIdNil() { + o.TerminationId.Set(nil) +} +// UnsetTerminationId ensures that no value is present for TerminationId, not even an explicit nil +func (o *TunnelTermination) UnsetTerminationId() { + o.TerminationId.Unset() +} -// GetTermination returns the Termination field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetTermination returns the Termination field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TunnelTermination) GetTermination() interface{} { if o == nil { var ret interface{} return ret } - return o.Termination } -// GetTerminationOk returns a tuple with the Termination field value +// GetTerminationOk returns a tuple with the Termination field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *TunnelTermination) GetTerminationOk() (*interface{}, bool) { @@ -297,12 +306,20 @@ func (o *TunnelTermination) GetTerminationOk() (*interface{}, bool) { return &o.Termination, true } -// SetTermination sets field value +// HasTermination returns a boolean if a field has been set. +func (o *TunnelTermination) HasTermination() bool { + if o != nil && !IsNil(o.Termination) { + return true + } + + return false +} + +// SetTermination gets a reference to the given interface{} and assigns it to the Termination field. func (o *TunnelTermination) SetTermination(v interface{}) { o.Termination = v } - // GetOutsideIp returns the OutsideIp field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TunnelTermination) GetOutsideIp() BriefIPAddress { if o == nil || IsNil(o.OutsideIp.Get()) { @@ -409,18 +426,16 @@ func (o *TunnelTermination) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TunnelTermination) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *TunnelTermination) GetCreatedOk() (*time.Time, bool) { @@ -430,24 +445,39 @@ func (o *TunnelTermination) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *TunnelTermination) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *TunnelTermination) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *TunnelTermination) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *TunnelTermination) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TunnelTermination) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *TunnelTermination) GetLastUpdatedOk() (*time.Time, bool) { @@ -457,11 +487,28 @@ func (o *TunnelTermination) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *TunnelTermination) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *TunnelTermination) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *TunnelTermination) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *TunnelTermination) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o TunnelTermination) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -482,7 +529,9 @@ func (o TunnelTermination) ToMap() (map[string]interface{}, error) { toSerialize["tunnel"] = o.Tunnel toSerialize["role"] = o.Role toSerialize["termination_type"] = o.TerminationType - toSerialize["termination_id"] = o.TerminationId.Get() + if o.TerminationId.IsSet() { + toSerialize["termination_id"] = o.TerminationId.Get() + } if o.Termination != nil { toSerialize["termination"] = o.Termination } @@ -495,8 +544,12 @@ func (o TunnelTermination) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -516,10 +569,6 @@ func (o *TunnelTermination) UnmarshalJSON(data []byte) (err error) { "tunnel", "role", "termination_type", - "termination_id", - "termination", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_tunnel_termination_request.go b/netbox/model_tunnel_termination_request.go index eed774212..41dcdcf01 100644 --- a/netbox/model_tunnel_termination_request.go +++ b/netbox/model_tunnel_termination_request.go @@ -23,7 +23,7 @@ type TunnelTerminationRequest struct { Tunnel BriefTunnelRequest `json:"tunnel"` Role PatchedWritableTunnelTerminationRequestRole `json:"role"` TerminationType string `json:"termination_type"` - TerminationId NullableInt64 `json:"termination_id"` + TerminationId NullableInt64 `json:"termination_id,omitempty"` OutsideIp NullableBriefIPAddressRequest `json:"outside_ip,omitempty"` Tags []NestedTagRequest `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` @@ -36,12 +36,11 @@ type _TunnelTerminationRequest TunnelTerminationRequest // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewTunnelTerminationRequest(tunnel BriefTunnelRequest, role PatchedWritableTunnelTerminationRequestRole, terminationType string, terminationId NullableInt64) *TunnelTerminationRequest { +func NewTunnelTerminationRequest(tunnel BriefTunnelRequest, role PatchedWritableTunnelTerminationRequestRole, terminationType string) *TunnelTerminationRequest { this := TunnelTerminationRequest{} this.Tunnel = tunnel this.Role = role this.TerminationType = terminationType - this.TerminationId = terminationId return &this } @@ -128,18 +127,16 @@ func (o *TunnelTerminationRequest) SetTerminationType(v string) { } -// GetTerminationId returns the TerminationId field value -// If the value is explicit nil, the zero value for int64 will be returned +// GetTerminationId returns the TerminationId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TunnelTerminationRequest) GetTerminationId() int64 { - if o == nil || o.TerminationId.Get() == nil { + if o == nil || IsNil(o.TerminationId.Get()) { var ret int64 return ret } - return *o.TerminationId.Get() } -// GetTerminationIdOk returns a tuple with the TerminationId field value +// GetTerminationIdOk returns a tuple with the TerminationId field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *TunnelTerminationRequest) GetTerminationIdOk() (*int64, bool) { @@ -149,11 +146,28 @@ func (o *TunnelTerminationRequest) GetTerminationIdOk() (*int64, bool) { return o.TerminationId.Get(), o.TerminationId.IsSet() } -// SetTerminationId sets field value +// HasTerminationId returns a boolean if a field has been set. +func (o *TunnelTerminationRequest) HasTerminationId() bool { + if o != nil && o.TerminationId.IsSet() { + return true + } + + return false +} + +// SetTerminationId gets a reference to the given NullableInt64 and assigns it to the TerminationId field. func (o *TunnelTerminationRequest) SetTerminationId(v int64) { o.TerminationId.Set(&v) } +// SetTerminationIdNil sets the value for TerminationId to be an explicit nil +func (o *TunnelTerminationRequest) SetTerminationIdNil() { + o.TerminationId.Set(nil) +} +// UnsetTerminationId ensures that no value is present for TerminationId, not even an explicit nil +func (o *TunnelTerminationRequest) UnsetTerminationId() { + o.TerminationId.Unset() +} // GetOutsideIp returns the OutsideIp field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TunnelTerminationRequest) GetOutsideIp() BriefIPAddressRequest { @@ -274,7 +288,9 @@ func (o TunnelTerminationRequest) ToMap() (map[string]interface{}, error) { toSerialize["tunnel"] = o.Tunnel toSerialize["role"] = o.Role toSerialize["termination_type"] = o.TerminationType - toSerialize["termination_id"] = o.TerminationId.Get() + if o.TerminationId.IsSet() { + toSerialize["termination_id"] = o.TerminationId.Get() + } if o.OutsideIp.IsSet() { toSerialize["outside_ip"] = o.OutsideIp.Get() } @@ -300,7 +316,6 @@ func (o *TunnelTerminationRequest) UnmarshalJSON(data []byte) (err error) { "tunnel", "role", "termination_type", - "termination_id", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_virtual_chassis.go b/netbox/model_virtual_chassis.go index ee68cc4ee..4ba88e2eb 100644 --- a/netbox/model_virtual_chassis.go +++ b/netbox/model_virtual_chassis.go @@ -32,8 +32,8 @@ type VirtualChassis struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` MemberCount int32 `json:"member_count"` Members []NestedDevice `json:"members"` AdditionalProperties map[string]interface{} @@ -45,14 +45,12 @@ type _VirtualChassis VirtualChassis // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewVirtualChassis(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime, memberCount int32, members []NestedDevice) *VirtualChassis { +func NewVirtualChassis(id int32, url string, display string, name string, memberCount int32, members []NestedDevice) *VirtualChassis { this := VirtualChassis{} this.Id = id this.Url = url this.Display = display this.Name = name - this.Created = created - this.LastUpdated = lastUpdated this.MemberCount = memberCount this.Members = members return &this @@ -400,18 +398,16 @@ func (o *VirtualChassis) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VirtualChassis) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VirtualChassis) GetCreatedOk() (*time.Time, bool) { @@ -421,24 +417,39 @@ func (o *VirtualChassis) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *VirtualChassis) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *VirtualChassis) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *VirtualChassis) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *VirtualChassis) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VirtualChassis) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VirtualChassis) GetLastUpdatedOk() (*time.Time, bool) { @@ -448,11 +459,28 @@ func (o *VirtualChassis) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *VirtualChassis) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *VirtualChassis) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *VirtualChassis) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *VirtualChassis) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetMemberCount returns the MemberCount field value func (o *VirtualChassis) GetMemberCount() int32 { @@ -539,8 +567,12 @@ func (o VirtualChassis) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["member_count"] = o.MemberCount toSerialize["members"] = o.Members @@ -560,8 +592,6 @@ func (o *VirtualChassis) UnmarshalJSON(data []byte) (err error) { "url", "display", "name", - "created", - "last_updated", "member_count", "members", } diff --git a/netbox/model_virtual_device_context.go b/netbox/model_virtual_device_context.go index 27899df83..5d6189116 100644 --- a/netbox/model_virtual_device_context.go +++ b/netbox/model_virtual_device_context.go @@ -29,7 +29,7 @@ type VirtualDeviceContext struct { Device BriefDevice `json:"device"` Identifier NullableInt32 `json:"identifier,omitempty"` Tenant NullableBriefTenant `json:"tenant,omitempty"` - PrimaryIp NullableBriefIPAddress `json:"primary_ip"` + PrimaryIp NullableBriefIPAddress `json:"primary_ip,omitempty"` PrimaryIp4 NullableBriefIPAddress `json:"primary_ip4,omitempty"` PrimaryIp6 NullableBriefIPAddress `json:"primary_ip6,omitempty"` Status VirtualDeviceContextStatus `json:"status"` @@ -37,8 +37,8 @@ type VirtualDeviceContext struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` InterfaceCount int64 `json:"interface_count"` AdditionalProperties map[string]interface{} } @@ -49,17 +49,14 @@ type _VirtualDeviceContext VirtualDeviceContext // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewVirtualDeviceContext(id int32, url string, display string, name string, device BriefDevice, primaryIp NullableBriefIPAddress, status VirtualDeviceContextStatus, created NullableTime, lastUpdated NullableTime, interfaceCount int64) *VirtualDeviceContext { +func NewVirtualDeviceContext(id int32, url string, display string, name string, device BriefDevice, status VirtualDeviceContextStatus, interfaceCount int64) *VirtualDeviceContext { this := VirtualDeviceContext{} this.Id = id this.Url = url this.Display = display this.Name = name this.Device = device - this.PrimaryIp = primaryIp this.Status = status - this.Created = created - this.LastUpdated = lastUpdated this.InterfaceCount = interfaceCount return &this } @@ -313,18 +310,16 @@ func (o *VirtualDeviceContext) UnsetTenant() { o.Tenant.Unset() } -// GetPrimaryIp returns the PrimaryIp field value -// If the value is explicit nil, the zero value for BriefIPAddress will be returned +// GetPrimaryIp returns the PrimaryIp field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VirtualDeviceContext) GetPrimaryIp() BriefIPAddress { - if o == nil || o.PrimaryIp.Get() == nil { + if o == nil || IsNil(o.PrimaryIp.Get()) { var ret BriefIPAddress return ret } - return *o.PrimaryIp.Get() } -// GetPrimaryIpOk returns a tuple with the PrimaryIp field value +// GetPrimaryIpOk returns a tuple with the PrimaryIp field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VirtualDeviceContext) GetPrimaryIpOk() (*BriefIPAddress, bool) { @@ -334,11 +329,28 @@ func (o *VirtualDeviceContext) GetPrimaryIpOk() (*BriefIPAddress, bool) { return o.PrimaryIp.Get(), o.PrimaryIp.IsSet() } -// SetPrimaryIp sets field value +// HasPrimaryIp returns a boolean if a field has been set. +func (o *VirtualDeviceContext) HasPrimaryIp() bool { + if o != nil && o.PrimaryIp.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp gets a reference to the given NullableBriefIPAddress and assigns it to the PrimaryIp field. func (o *VirtualDeviceContext) SetPrimaryIp(v BriefIPAddress) { o.PrimaryIp.Set(&v) } +// SetPrimaryIpNil sets the value for PrimaryIp to be an explicit nil +func (o *VirtualDeviceContext) SetPrimaryIpNil() { + o.PrimaryIp.Set(nil) +} +// UnsetPrimaryIp ensures that no value is present for PrimaryIp, not even an explicit nil +func (o *VirtualDeviceContext) UnsetPrimaryIp() { + o.PrimaryIp.Unset() +} // GetPrimaryIp4 returns the PrimaryIp4 field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VirtualDeviceContext) GetPrimaryIp4() BriefIPAddress { @@ -577,18 +589,16 @@ func (o *VirtualDeviceContext) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VirtualDeviceContext) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VirtualDeviceContext) GetCreatedOk() (*time.Time, bool) { @@ -598,24 +608,39 @@ func (o *VirtualDeviceContext) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *VirtualDeviceContext) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *VirtualDeviceContext) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *VirtualDeviceContext) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *VirtualDeviceContext) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VirtualDeviceContext) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VirtualDeviceContext) GetLastUpdatedOk() (*time.Time, bool) { @@ -625,11 +650,28 @@ func (o *VirtualDeviceContext) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *VirtualDeviceContext) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *VirtualDeviceContext) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *VirtualDeviceContext) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *VirtualDeviceContext) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetInterfaceCount returns the InterfaceCount field value func (o *VirtualDeviceContext) GetInterfaceCount() int64 { @@ -680,7 +722,9 @@ func (o VirtualDeviceContext) ToMap() (map[string]interface{}, error) { if o.Tenant.IsSet() { toSerialize["tenant"] = o.Tenant.Get() } - toSerialize["primary_ip"] = o.PrimaryIp.Get() + if o.PrimaryIp.IsSet() { + toSerialize["primary_ip"] = o.PrimaryIp.Get() + } if o.PrimaryIp4.IsSet() { toSerialize["primary_ip4"] = o.PrimaryIp4.Get() } @@ -700,8 +744,12 @@ func (o VirtualDeviceContext) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["interface_count"] = o.InterfaceCount for key, value := range o.AdditionalProperties { @@ -721,10 +769,7 @@ func (o *VirtualDeviceContext) UnmarshalJSON(data []byte) (err error) { "display", "name", "device", - "primary_ip", "status", - "created", - "last_updated", "interface_count", } diff --git a/netbox/model_virtual_disk.go b/netbox/model_virtual_disk.go index 373df0272..fce903b3f 100644 --- a/netbox/model_virtual_disk.go +++ b/netbox/model_virtual_disk.go @@ -31,8 +31,8 @@ type VirtualDisk struct { Size int32 `json:"size"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -42,7 +42,7 @@ type _VirtualDisk VirtualDisk // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewVirtualDisk(id int32, url string, display string, virtualMachine BriefVirtualMachine, name string, size int32, created NullableTime, lastUpdated NullableTime) *VirtualDisk { +func NewVirtualDisk(id int32, url string, display string, virtualMachine BriefVirtualMachine, name string, size int32) *VirtualDisk { this := VirtualDisk{} this.Id = id this.Url = url @@ -50,8 +50,6 @@ func NewVirtualDisk(id int32, url string, display string, virtualMachine BriefVi this.VirtualMachine = virtualMachine this.Name = name this.Size = size - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -341,18 +339,16 @@ func (o *VirtualDisk) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VirtualDisk) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VirtualDisk) GetCreatedOk() (*time.Time, bool) { @@ -362,24 +358,39 @@ func (o *VirtualDisk) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *VirtualDisk) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *VirtualDisk) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *VirtualDisk) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *VirtualDisk) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VirtualDisk) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VirtualDisk) GetLastUpdatedOk() (*time.Time, bool) { @@ -389,11 +400,28 @@ func (o *VirtualDisk) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *VirtualDisk) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *VirtualDisk) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *VirtualDisk) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *VirtualDisk) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o VirtualDisk) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -423,8 +451,12 @@ func (o VirtualDisk) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -444,8 +476,6 @@ func (o *VirtualDisk) UnmarshalJSON(data []byte) (err error) { "virtual_machine", "name", "size", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_virtual_machine_with_config_context.go b/netbox/model_virtual_machine_with_config_context.go index 61bd3db4a..e0d71ea85 100644 --- a/netbox/model_virtual_machine_with_config_context.go +++ b/netbox/model_virtual_machine_with_config_context.go @@ -34,7 +34,7 @@ type VirtualMachineWithConfigContext struct { Role NullableBriefDeviceRole `json:"role,omitempty"` Tenant NullableBriefTenant `json:"tenant,omitempty"` Platform NullableBriefPlatform `json:"platform,omitempty"` - PrimaryIp NullableBriefIPAddress `json:"primary_ip"` + PrimaryIp NullableBriefIPAddress `json:"primary_ip,omitempty"` PrimaryIp4 NullableBriefIPAddress `json:"primary_ip4,omitempty"` PrimaryIp6 NullableBriefIPAddress `json:"primary_ip6,omitempty"` Vcpus NullableFloat64 `json:"vcpus,omitempty"` @@ -47,9 +47,9 @@ type VirtualMachineWithConfigContext struct { LocalContextData interface{} `json:"local_context_data,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - ConfigContext interface{} `json:"config_context"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + ConfigContext interface{} `json:"config_context,omitempty"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` InterfaceCount int32 `json:"interface_count"` VirtualDiskCount int32 `json:"virtual_disk_count"` AdditionalProperties map[string]interface{} @@ -61,16 +61,12 @@ type _VirtualMachineWithConfigContext VirtualMachineWithConfigContext // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewVirtualMachineWithConfigContext(id int32, url string, display string, name string, primaryIp NullableBriefIPAddress, configContext interface{}, created NullableTime, lastUpdated NullableTime, interfaceCount int32, virtualDiskCount int32) *VirtualMachineWithConfigContext { +func NewVirtualMachineWithConfigContext(id int32, url string, display string, name string, interfaceCount int32, virtualDiskCount int32) *VirtualMachineWithConfigContext { this := VirtualMachineWithConfigContext{} this.Id = id this.Url = url this.Display = display this.Name = name - this.PrimaryIp = primaryIp - this.ConfigContext = configContext - this.Created = created - this.LastUpdated = lastUpdated this.InterfaceCount = interfaceCount this.VirtualDiskCount = virtualDiskCount return &this @@ -532,18 +528,16 @@ func (o *VirtualMachineWithConfigContext) UnsetPlatform() { o.Platform.Unset() } -// GetPrimaryIp returns the PrimaryIp field value -// If the value is explicit nil, the zero value for BriefIPAddress will be returned +// GetPrimaryIp returns the PrimaryIp field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VirtualMachineWithConfigContext) GetPrimaryIp() BriefIPAddress { - if o == nil || o.PrimaryIp.Get() == nil { + if o == nil || IsNil(o.PrimaryIp.Get()) { var ret BriefIPAddress return ret } - return *o.PrimaryIp.Get() } -// GetPrimaryIpOk returns a tuple with the PrimaryIp field value +// GetPrimaryIpOk returns a tuple with the PrimaryIp field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VirtualMachineWithConfigContext) GetPrimaryIpOk() (*BriefIPAddress, bool) { @@ -553,11 +547,28 @@ func (o *VirtualMachineWithConfigContext) GetPrimaryIpOk() (*BriefIPAddress, boo return o.PrimaryIp.Get(), o.PrimaryIp.IsSet() } -// SetPrimaryIp sets field value +// HasPrimaryIp returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasPrimaryIp() bool { + if o != nil && o.PrimaryIp.IsSet() { + return true + } + + return false +} + +// SetPrimaryIp gets a reference to the given NullableBriefIPAddress and assigns it to the PrimaryIp field. func (o *VirtualMachineWithConfigContext) SetPrimaryIp(v BriefIPAddress) { o.PrimaryIp.Set(&v) } +// SetPrimaryIpNil sets the value for PrimaryIp to be an explicit nil +func (o *VirtualMachineWithConfigContext) SetPrimaryIpNil() { + o.PrimaryIp.Set(nil) +} +// UnsetPrimaryIp ensures that no value is present for PrimaryIp, not even an explicit nil +func (o *VirtualMachineWithConfigContext) UnsetPrimaryIp() { + o.PrimaryIp.Unset() +} // GetPrimaryIp4 returns the PrimaryIp4 field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VirtualMachineWithConfigContext) GetPrimaryIp4() BriefIPAddress { @@ -972,18 +983,16 @@ func (o *VirtualMachineWithConfigContext) SetCustomFields(v map[string]interface o.CustomFields = v } -// GetConfigContext returns the ConfigContext field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetConfigContext returns the ConfigContext field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VirtualMachineWithConfigContext) GetConfigContext() interface{} { if o == nil { var ret interface{} return ret } - return o.ConfigContext } -// GetConfigContextOk returns a tuple with the ConfigContext field value +// GetConfigContextOk returns a tuple with the ConfigContext field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VirtualMachineWithConfigContext) GetConfigContextOk() (*interface{}, bool) { @@ -993,24 +1002,30 @@ func (o *VirtualMachineWithConfigContext) GetConfigContextOk() (*interface{}, bo return &o.ConfigContext, true } -// SetConfigContext sets field value +// HasConfigContext returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasConfigContext() bool { + if o != nil && !IsNil(o.ConfigContext) { + return true + } + + return false +} + +// SetConfigContext gets a reference to the given interface{} and assigns it to the ConfigContext field. func (o *VirtualMachineWithConfigContext) SetConfigContext(v interface{}) { o.ConfigContext = v } - -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VirtualMachineWithConfigContext) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VirtualMachineWithConfigContext) GetCreatedOk() (*time.Time, bool) { @@ -1020,24 +1035,39 @@ func (o *VirtualMachineWithConfigContext) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *VirtualMachineWithConfigContext) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *VirtualMachineWithConfigContext) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *VirtualMachineWithConfigContext) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VirtualMachineWithConfigContext) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VirtualMachineWithConfigContext) GetLastUpdatedOk() (*time.Time, bool) { @@ -1047,11 +1077,28 @@ func (o *VirtualMachineWithConfigContext) GetLastUpdatedOk() (*time.Time, bool) return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *VirtualMachineWithConfigContext) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *VirtualMachineWithConfigContext) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *VirtualMachineWithConfigContext) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *VirtualMachineWithConfigContext) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetInterfaceCount returns the InterfaceCount field value func (o *VirtualMachineWithConfigContext) GetInterfaceCount() int32 { @@ -1144,7 +1191,9 @@ func (o VirtualMachineWithConfigContext) ToMap() (map[string]interface{}, error) if o.Platform.IsSet() { toSerialize["platform"] = o.Platform.Get() } - toSerialize["primary_ip"] = o.PrimaryIp.Get() + if o.PrimaryIp.IsSet() { + toSerialize["primary_ip"] = o.PrimaryIp.Get() + } if o.PrimaryIp4.IsSet() { toSerialize["primary_ip4"] = o.PrimaryIp4.Get() } @@ -1181,8 +1230,12 @@ func (o VirtualMachineWithConfigContext) ToMap() (map[string]interface{}, error) if o.ConfigContext != nil { toSerialize["config_context"] = o.ConfigContext } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["interface_count"] = o.InterfaceCount toSerialize["virtual_disk_count"] = o.VirtualDiskCount @@ -1202,10 +1255,6 @@ func (o *VirtualMachineWithConfigContext) UnmarshalJSON(data []byte) (err error) "url", "display", "name", - "primary_ip", - "config_context", - "created", - "last_updated", "interface_count", "virtual_disk_count", } diff --git a/netbox/model_vlan.go b/netbox/model_vlan.go index 00b4858e9..49bcca41c 100644 --- a/netbox/model_vlan.go +++ b/netbox/model_vlan.go @@ -35,11 +35,11 @@ type VLAN struct { Role NullableBriefRole `json:"role,omitempty"` Description *string `json:"description,omitempty"` Comments *string `json:"comments,omitempty"` - L2vpnTermination NullableBriefL2VPNTermination `json:"l2vpn_termination"` + L2vpnTermination NullableBriefL2VPNTermination `json:"l2vpn_termination,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` PrefixCount *int64 `json:"prefix_count,omitempty"` AdditionalProperties map[string]interface{} } @@ -50,16 +50,13 @@ type _VLAN VLAN // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewVLAN(id int32, url string, display string, vid int32, name string, l2vpnTermination NullableBriefL2VPNTermination, created NullableTime, lastUpdated NullableTime) *VLAN { +func NewVLAN(id int32, url string, display string, vid int32, name string) *VLAN { this := VLAN{} this.Id = id this.Url = url this.Display = display this.Vid = vid this.Name = name - this.L2vpnTermination = l2vpnTermination - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -492,18 +489,16 @@ func (o *VLAN) SetComments(v string) { o.Comments = &v } -// GetL2vpnTermination returns the L2vpnTermination field value -// If the value is explicit nil, the zero value for BriefL2VPNTermination will be returned +// GetL2vpnTermination returns the L2vpnTermination field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VLAN) GetL2vpnTermination() BriefL2VPNTermination { - if o == nil || o.L2vpnTermination.Get() == nil { + if o == nil || IsNil(o.L2vpnTermination.Get()) { var ret BriefL2VPNTermination return ret } - return *o.L2vpnTermination.Get() } -// GetL2vpnTerminationOk returns a tuple with the L2vpnTermination field value +// GetL2vpnTerminationOk returns a tuple with the L2vpnTermination field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VLAN) GetL2vpnTerminationOk() (*BriefL2VPNTermination, bool) { @@ -513,11 +508,28 @@ func (o *VLAN) GetL2vpnTerminationOk() (*BriefL2VPNTermination, bool) { return o.L2vpnTermination.Get(), o.L2vpnTermination.IsSet() } -// SetL2vpnTermination sets field value +// HasL2vpnTermination returns a boolean if a field has been set. +func (o *VLAN) HasL2vpnTermination() bool { + if o != nil && o.L2vpnTermination.IsSet() { + return true + } + + return false +} + +// SetL2vpnTermination gets a reference to the given NullableBriefL2VPNTermination and assigns it to the L2vpnTermination field. func (o *VLAN) SetL2vpnTermination(v BriefL2VPNTermination) { o.L2vpnTermination.Set(&v) } +// SetL2vpnTerminationNil sets the value for L2vpnTermination to be an explicit nil +func (o *VLAN) SetL2vpnTerminationNil() { + o.L2vpnTermination.Set(nil) +} +// UnsetL2vpnTermination ensures that no value is present for L2vpnTermination, not even an explicit nil +func (o *VLAN) UnsetL2vpnTermination() { + o.L2vpnTermination.Unset() +} // GetTags returns the Tags field value if set, zero value otherwise. func (o *VLAN) GetTags() []NestedTag { @@ -583,18 +595,16 @@ func (o *VLAN) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VLAN) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VLAN) GetCreatedOk() (*time.Time, bool) { @@ -604,24 +614,39 @@ func (o *VLAN) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *VLAN) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *VLAN) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *VLAN) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *VLAN) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VLAN) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VLAN) GetLastUpdatedOk() (*time.Time, bool) { @@ -631,11 +656,28 @@ func (o *VLAN) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *VLAN) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *VLAN) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *VLAN) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *VLAN) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetPrefixCount returns the PrefixCount field value if set, zero value otherwise. func (o *VLAN) GetPrefixCount() int64 { @@ -708,15 +750,21 @@ func (o VLAN) ToMap() (map[string]interface{}, error) { if !IsNil(o.Comments) { toSerialize["comments"] = o.Comments } - toSerialize["l2vpn_termination"] = o.L2vpnTermination.Get() + if o.L2vpnTermination.IsSet() { + toSerialize["l2vpn_termination"] = o.L2vpnTermination.Get() + } if !IsNil(o.Tags) { toSerialize["tags"] = o.Tags } if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } if !IsNil(o.PrefixCount) { toSerialize["prefix_count"] = o.PrefixCount } @@ -738,9 +786,6 @@ func (o *VLAN) UnmarshalJSON(data []byte) (err error) { "display", "vid", "name", - "l2vpn_termination", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_vlan_group.go b/netbox/model_vlan_group.go index e1cba963e..3b2ce9f8e 100644 --- a/netbox/model_vlan_group.go +++ b/netbox/model_vlan_group.go @@ -29,12 +29,12 @@ type VLANGroup struct { Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` ScopeType NullableString `json:"scope_type,omitempty"` ScopeId NullableInt32 `json:"scope_id,omitempty"` - Scope interface{} `json:"scope"` + Scope interface{} `json:"scope,omitempty"` Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` VlanCount *int64 `json:"vlan_count,omitempty"` Utilization string `json:"utilization"` AdditionalProperties map[string]interface{} @@ -46,16 +46,13 @@ type _VLANGroup VLANGroup // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewVLANGroup(id int32, url string, display string, name string, slug string, scope interface{}, created NullableTime, lastUpdated NullableTime, utilization string) *VLANGroup { +func NewVLANGroup(id int32, url string, display string, name string, slug string, utilization string) *VLANGroup { this := VLANGroup{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Scope = scope - this.Created = created - this.LastUpdated = lastUpdated this.Utilization = utilization return &this } @@ -309,18 +306,16 @@ func (o *VLANGroup) UnsetScopeId() { o.ScopeId.Unset() } -// GetScope returns the Scope field value -// If the value is explicit nil, the zero value for interface{} will be returned +// GetScope returns the Scope field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VLANGroup) GetScope() interface{} { if o == nil { var ret interface{} return ret } - return o.Scope } -// GetScopeOk returns a tuple with the Scope field value +// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VLANGroup) GetScopeOk() (*interface{}, bool) { @@ -330,12 +325,20 @@ func (o *VLANGroup) GetScopeOk() (*interface{}, bool) { return &o.Scope, true } -// SetScope sets field value +// HasScope returns a boolean if a field has been set. +func (o *VLANGroup) HasScope() bool { + if o != nil && !IsNil(o.Scope) { + return true + } + + return false +} + +// SetScope gets a reference to the given interface{} and assigns it to the Scope field. func (o *VLANGroup) SetScope(v interface{}) { o.Scope = v } - // GetDescription returns the Description field value if set, zero value otherwise. func (o *VLANGroup) GetDescription() string { if o == nil || IsNil(o.Description) { @@ -432,18 +435,16 @@ func (o *VLANGroup) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VLANGroup) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VLANGroup) GetCreatedOk() (*time.Time, bool) { @@ -453,24 +454,39 @@ func (o *VLANGroup) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *VLANGroup) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *VLANGroup) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *VLANGroup) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *VLANGroup) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VLANGroup) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VLANGroup) GetLastUpdatedOk() (*time.Time, bool) { @@ -480,11 +496,28 @@ func (o *VLANGroup) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *VLANGroup) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *VLANGroup) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *VLANGroup) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *VLANGroup) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetVlanCount returns the VlanCount field value if set, zero value otherwise. func (o *VLANGroup) GetVlanCount() int64 { @@ -579,8 +612,12 @@ func (o VLANGroup) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } if !IsNil(o.VlanCount) { toSerialize["vlan_count"] = o.VlanCount } @@ -603,9 +640,6 @@ func (o *VLANGroup) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "scope", - "created", - "last_updated", "utilization", } diff --git a/netbox/model_vm_interface.go b/netbox/model_vm_interface.go index 81dee6ec6..98307e416 100644 --- a/netbox/model_vm_interface.go +++ b/netbox/model_vm_interface.go @@ -37,11 +37,11 @@ type VMInterface struct { UntaggedVlan NullableBriefVLAN `json:"untagged_vlan,omitempty"` TaggedVlans []VLAN `json:"tagged_vlans,omitempty"` Vrf NullableBriefVRF `json:"vrf,omitempty"` - L2vpnTermination NullableBriefL2VPNTermination `json:"l2vpn_termination"` + L2vpnTermination NullableBriefL2VPNTermination `json:"l2vpn_termination,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` CountIpaddresses int32 `json:"count_ipaddresses"` CountFhrpGroups int32 `json:"count_fhrp_groups"` AdditionalProperties map[string]interface{} @@ -53,16 +53,13 @@ type _VMInterface VMInterface // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewVMInterface(id int32, url string, display string, virtualMachine BriefVirtualMachine, name string, l2vpnTermination NullableBriefL2VPNTermination, created NullableTime, lastUpdated NullableTime, countIpaddresses int32, countFhrpGroups int32) *VMInterface { +func NewVMInterface(id int32, url string, display string, virtualMachine BriefVirtualMachine, name string, countIpaddresses int32, countFhrpGroups int32) *VMInterface { this := VMInterface{} this.Id = id this.Url = url this.Display = display this.VirtualMachine = virtualMachine this.Name = name - this.L2vpnTermination = l2vpnTermination - this.Created = created - this.LastUpdated = lastUpdated this.CountIpaddresses = countIpaddresses this.CountFhrpGroups = countFhrpGroups return &this @@ -613,18 +610,16 @@ func (o *VMInterface) UnsetVrf() { o.Vrf.Unset() } -// GetL2vpnTermination returns the L2vpnTermination field value -// If the value is explicit nil, the zero value for BriefL2VPNTermination will be returned +// GetL2vpnTermination returns the L2vpnTermination field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VMInterface) GetL2vpnTermination() BriefL2VPNTermination { - if o == nil || o.L2vpnTermination.Get() == nil { + if o == nil || IsNil(o.L2vpnTermination.Get()) { var ret BriefL2VPNTermination return ret } - return *o.L2vpnTermination.Get() } -// GetL2vpnTerminationOk returns a tuple with the L2vpnTermination field value +// GetL2vpnTerminationOk returns a tuple with the L2vpnTermination field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VMInterface) GetL2vpnTerminationOk() (*BriefL2VPNTermination, bool) { @@ -634,11 +629,28 @@ func (o *VMInterface) GetL2vpnTerminationOk() (*BriefL2VPNTermination, bool) { return o.L2vpnTermination.Get(), o.L2vpnTermination.IsSet() } -// SetL2vpnTermination sets field value +// HasL2vpnTermination returns a boolean if a field has been set. +func (o *VMInterface) HasL2vpnTermination() bool { + if o != nil && o.L2vpnTermination.IsSet() { + return true + } + + return false +} + +// SetL2vpnTermination gets a reference to the given NullableBriefL2VPNTermination and assigns it to the L2vpnTermination field. func (o *VMInterface) SetL2vpnTermination(v BriefL2VPNTermination) { o.L2vpnTermination.Set(&v) } +// SetL2vpnTerminationNil sets the value for L2vpnTermination to be an explicit nil +func (o *VMInterface) SetL2vpnTerminationNil() { + o.L2vpnTermination.Set(nil) +} +// UnsetL2vpnTermination ensures that no value is present for L2vpnTermination, not even an explicit nil +func (o *VMInterface) UnsetL2vpnTermination() { + o.L2vpnTermination.Unset() +} // GetTags returns the Tags field value if set, zero value otherwise. func (o *VMInterface) GetTags() []NestedTag { @@ -704,18 +716,16 @@ func (o *VMInterface) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VMInterface) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VMInterface) GetCreatedOk() (*time.Time, bool) { @@ -725,24 +735,39 @@ func (o *VMInterface) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *VMInterface) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *VMInterface) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *VMInterface) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *VMInterface) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VMInterface) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VMInterface) GetLastUpdatedOk() (*time.Time, bool) { @@ -752,11 +777,28 @@ func (o *VMInterface) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *VMInterface) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *VMInterface) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *VMInterface) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *VMInterface) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetCountIpaddresses returns the CountIpaddresses field value func (o *VMInterface) GetCountIpaddresses() int32 { @@ -856,15 +898,21 @@ func (o VMInterface) ToMap() (map[string]interface{}, error) { if o.Vrf.IsSet() { toSerialize["vrf"] = o.Vrf.Get() } - toSerialize["l2vpn_termination"] = o.L2vpnTermination.Get() + if o.L2vpnTermination.IsSet() { + toSerialize["l2vpn_termination"] = o.L2vpnTermination.Get() + } if !IsNil(o.Tags) { toSerialize["tags"] = o.Tags } if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["count_ipaddresses"] = o.CountIpaddresses toSerialize["count_fhrp_groups"] = o.CountFhrpGroups @@ -885,9 +933,6 @@ func (o *VMInterface) UnmarshalJSON(data []byte) (err error) { "display", "virtual_machine", "name", - "l2vpn_termination", - "created", - "last_updated", "count_ipaddresses", "count_fhrp_groups", } diff --git a/netbox/model_vrf.go b/netbox/model_vrf.go index 08997a34f..18c402ac1 100644 --- a/netbox/model_vrf.go +++ b/netbox/model_vrf.go @@ -37,8 +37,8 @@ type VRF struct { ExportTargets []RouteTarget `json:"export_targets,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` IpaddressCount int64 `json:"ipaddress_count"` PrefixCount *int64 `json:"prefix_count,omitempty"` AdditionalProperties map[string]interface{} @@ -50,14 +50,12 @@ type _VRF VRF // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewVRF(id int32, url string, display string, name string, created NullableTime, lastUpdated NullableTime, ipaddressCount int64) *VRF { +func NewVRF(id int32, url string, display string, name string, ipaddressCount int64) *VRF { this := VRF{} this.Id = id this.Url = url this.Display = display this.Name = name - this.Created = created - this.LastUpdated = lastUpdated this.IpaddressCount = ipaddressCount return &this } @@ -510,18 +508,16 @@ func (o *VRF) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VRF) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VRF) GetCreatedOk() (*time.Time, bool) { @@ -531,24 +527,39 @@ func (o *VRF) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *VRF) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *VRF) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *VRF) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *VRF) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VRF) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VRF) GetLastUpdatedOk() (*time.Time, bool) { @@ -558,11 +569,28 @@ func (o *VRF) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *VRF) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *VRF) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *VRF) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *VRF) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetIpaddressCount returns the IpaddressCount field value func (o *VRF) GetIpaddressCount() int64 { @@ -665,8 +693,12 @@ func (o VRF) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["ipaddress_count"] = o.IpaddressCount if !IsNil(o.PrefixCount) { toSerialize["prefix_count"] = o.PrefixCount @@ -688,8 +720,6 @@ func (o *VRF) UnmarshalJSON(data []byte) (err error) { "url", "display", "name", - "created", - "last_updated", "ipaddress_count", } diff --git a/netbox/model_webhook.go b/netbox/model_webhook.go index 92efce408..349c5d886 100644 --- a/netbox/model_webhook.go +++ b/netbox/model_webhook.go @@ -44,8 +44,8 @@ type Webhook struct { CaFilePath NullableString `json:"ca_file_path,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` Tags []NestedTag `json:"tags,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -55,15 +55,13 @@ type _Webhook Webhook // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewWebhook(id int32, url string, display string, name string, payloadUrl string, created NullableTime, lastUpdated NullableTime) *Webhook { +func NewWebhook(id int32, url string, display string, name string, payloadUrl string) *Webhook { this := Webhook{} this.Id = id this.Url = url this.Display = display this.Name = name this.PayloadUrl = payloadUrl - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -562,18 +560,16 @@ func (o *Webhook) SetTags(v []NestedTag) { o.Tags = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Webhook) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Webhook) GetCreatedOk() (*time.Time, bool) { @@ -583,24 +579,39 @@ func (o *Webhook) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *Webhook) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *Webhook) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *Webhook) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *Webhook) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Webhook) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Webhook) GetLastUpdatedOk() (*time.Time, bool) { @@ -610,11 +621,28 @@ func (o *Webhook) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *Webhook) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *Webhook) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *Webhook) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *Webhook) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o Webhook) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -664,8 +692,12 @@ func (o Webhook) ToMap() (map[string]interface{}, error) { if !IsNil(o.Tags) { toSerialize["tags"] = o.Tags } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -684,8 +716,6 @@ func (o *Webhook) UnmarshalJSON(data []byte) (err error) { "display", "name", "payload_url", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_wireless_lan.go b/netbox/model_wireless_lan.go index 9b2d4675d..d5f404bb7 100644 --- a/netbox/model_wireless_lan.go +++ b/netbox/model_wireless_lan.go @@ -37,8 +37,8 @@ type WirelessLAN struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -48,14 +48,12 @@ type _WirelessLAN WirelessLAN // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewWirelessLAN(id int32, url string, display string, ssid string, created NullableTime, lastUpdated NullableTime) *WirelessLAN { +func NewWirelessLAN(id int32, url string, display string, ssid string) *WirelessLAN { this := WirelessLAN{} this.Id = id this.Url = url this.Display = display this.Ssid = ssid - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -581,18 +579,16 @@ func (o *WirelessLAN) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *WirelessLAN) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *WirelessLAN) GetCreatedOk() (*time.Time, bool) { @@ -602,24 +598,39 @@ func (o *WirelessLAN) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *WirelessLAN) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *WirelessLAN) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *WirelessLAN) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *WirelessLAN) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *WirelessLAN) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *WirelessLAN) GetLastUpdatedOk() (*time.Time, bool) { @@ -629,11 +640,28 @@ func (o *WirelessLAN) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *WirelessLAN) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *WirelessLAN) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *WirelessLAN) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *WirelessLAN) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o WirelessLAN) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -685,8 +713,12 @@ func (o WirelessLAN) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -704,8 +736,6 @@ func (o *WirelessLAN) UnmarshalJSON(data []byte) (err error) { "url", "display", "ssid", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_wireless_lan_group.go b/netbox/model_wireless_lan_group.go index 4300cd52e..9a4d17d06 100644 --- a/netbox/model_wireless_lan_group.go +++ b/netbox/model_wireless_lan_group.go @@ -31,8 +31,8 @@ type WirelessLANGroup struct { Description *string `json:"description,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` WirelesslanCount int32 `json:"wirelesslan_count"` Depth int32 `json:"_depth"` AdditionalProperties map[string]interface{} @@ -44,15 +44,13 @@ type _WirelessLANGroup WirelessLANGroup // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewWirelessLANGroup(id int32, url string, display string, name string, slug string, created NullableTime, lastUpdated NullableTime, wirelesslanCount int32, depth int32) *WirelessLANGroup { +func NewWirelessLANGroup(id int32, url string, display string, name string, slug string, wirelesslanCount int32, depth int32) *WirelessLANGroup { this := WirelessLANGroup{} this.Id = id this.Url = url this.Display = display this.Name = name this.Slug = slug - this.Created = created - this.LastUpdated = lastUpdated this.WirelesslanCount = wirelesslanCount this.Depth = depth return &this @@ -361,18 +359,16 @@ func (o *WirelessLANGroup) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *WirelessLANGroup) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *WirelessLANGroup) GetCreatedOk() (*time.Time, bool) { @@ -382,24 +378,39 @@ func (o *WirelessLANGroup) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *WirelessLANGroup) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *WirelessLANGroup) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *WirelessLANGroup) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *WirelessLANGroup) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *WirelessLANGroup) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *WirelessLANGroup) GetLastUpdatedOk() (*time.Time, bool) { @@ -409,11 +420,28 @@ func (o *WirelessLANGroup) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *WirelessLANGroup) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *WirelessLANGroup) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *WirelessLANGroup) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *WirelessLANGroup) UnsetLastUpdated() { + o.LastUpdated.Unset() +} // GetWirelesslanCount returns the WirelesslanCount field value func (o *WirelessLANGroup) GetWirelesslanCount() int32 { @@ -495,8 +523,12 @@ func (o WirelessLANGroup) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } toSerialize["wirelesslan_count"] = o.WirelesslanCount toSerialize["_depth"] = o.Depth @@ -517,8 +549,6 @@ func (o *WirelessLANGroup) UnmarshalJSON(data []byte) (err error) { "display", "name", "slug", - "created", - "last_updated", "wirelesslan_count", "_depth", } diff --git a/netbox/model_wireless_link.go b/netbox/model_wireless_link.go index cb9cc0dca..85b46b855 100644 --- a/netbox/model_wireless_link.go +++ b/netbox/model_wireless_link.go @@ -39,8 +39,8 @@ type WirelessLink struct { Comments *string `json:"comments,omitempty"` Tags []NestedTag `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` - Created NullableTime `json:"created"` - LastUpdated NullableTime `json:"last_updated"` + Created NullableTime `json:"created,omitempty"` + LastUpdated NullableTime `json:"last_updated,omitempty"` AdditionalProperties map[string]interface{} } @@ -50,15 +50,13 @@ type _WirelessLink WirelessLink // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewWirelessLink(id int32, url string, display string, interfaceA BriefInterface, interfaceB BriefInterface, created NullableTime, lastUpdated NullableTime) *WirelessLink { +func NewWirelessLink(id int32, url string, display string, interfaceA BriefInterface, interfaceB BriefInterface) *WirelessLink { this := WirelessLink{} this.Id = id this.Url = url this.Display = display this.InterfaceA = interfaceA this.InterfaceB = interfaceB - this.Created = created - this.LastUpdated = lastUpdated return &this } @@ -641,18 +639,16 @@ func (o *WirelessLink) SetCustomFields(v map[string]interface{}) { o.CustomFields = v } -// GetCreated returns the Created field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetCreated returns the Created field value if set, zero value otherwise (both if not set or set to explicit null). func (o *WirelessLink) GetCreated() time.Time { - if o == nil || o.Created.Get() == nil { + if o == nil || IsNil(o.Created.Get()) { var ret time.Time return ret } - return *o.Created.Get() } -// GetCreatedOk returns a tuple with the Created field value +// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *WirelessLink) GetCreatedOk() (*time.Time, bool) { @@ -662,24 +658,39 @@ func (o *WirelessLink) GetCreatedOk() (*time.Time, bool) { return o.Created.Get(), o.Created.IsSet() } -// SetCreated sets field value +// HasCreated returns a boolean if a field has been set. +func (o *WirelessLink) HasCreated() bool { + if o != nil && o.Created.IsSet() { + return true + } + + return false +} + +// SetCreated gets a reference to the given NullableTime and assigns it to the Created field. func (o *WirelessLink) SetCreated(v time.Time) { o.Created.Set(&v) } +// SetCreatedNil sets the value for Created to be an explicit nil +func (o *WirelessLink) SetCreatedNil() { + o.Created.Set(nil) +} +// UnsetCreated ensures that no value is present for Created, not even an explicit nil +func (o *WirelessLink) UnsetCreated() { + o.Created.Unset() +} -// GetLastUpdated returns the LastUpdated field value -// If the value is explicit nil, the zero value for time.Time will be returned +// GetLastUpdated returns the LastUpdated field value if set, zero value otherwise (both if not set or set to explicit null). func (o *WirelessLink) GetLastUpdated() time.Time { - if o == nil || o.LastUpdated.Get() == nil { + if o == nil || IsNil(o.LastUpdated.Get()) { var ret time.Time return ret } - return *o.LastUpdated.Get() } -// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// GetLastUpdatedOk returns a tuple with the LastUpdated field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *WirelessLink) GetLastUpdatedOk() (*time.Time, bool) { @@ -689,11 +700,28 @@ func (o *WirelessLink) GetLastUpdatedOk() (*time.Time, bool) { return o.LastUpdated.Get(), o.LastUpdated.IsSet() } -// SetLastUpdated sets field value +// HasLastUpdated returns a boolean if a field has been set. +func (o *WirelessLink) HasLastUpdated() bool { + if o != nil && o.LastUpdated.IsSet() { + return true + } + + return false +} + +// SetLastUpdated gets a reference to the given NullableTime and assigns it to the LastUpdated field. func (o *WirelessLink) SetLastUpdated(v time.Time) { o.LastUpdated.Set(&v) } +// SetLastUpdatedNil sets the value for LastUpdated to be an explicit nil +func (o *WirelessLink) SetLastUpdatedNil() { + o.LastUpdated.Set(nil) +} +// UnsetLastUpdated ensures that no value is present for LastUpdated, not even an explicit nil +func (o *WirelessLink) UnsetLastUpdated() { + o.LastUpdated.Unset() +} func (o WirelessLink) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() @@ -749,8 +777,12 @@ func (o WirelessLink) ToMap() (map[string]interface{}, error) { if !IsNil(o.CustomFields) { toSerialize["custom_fields"] = o.CustomFields } - toSerialize["created"] = o.Created.Get() - toSerialize["last_updated"] = o.LastUpdated.Get() + if o.Created.IsSet() { + toSerialize["created"] = o.Created.Get() + } + if o.LastUpdated.IsSet() { + toSerialize["last_updated"] = o.LastUpdated.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -769,8 +801,6 @@ func (o *WirelessLink) UnmarshalJSON(data []byte) (err error) { "display", "interface_a", "interface_b", - "created", - "last_updated", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_writable_contact_group_request.go b/netbox/model_writable_contact_group_request.go index 4706e1900..6777cbe09 100644 --- a/netbox/model_writable_contact_group_request.go +++ b/netbox/model_writable_contact_group_request.go @@ -22,7 +22,7 @@ var _ MappedNullable = &WritableContactGroupRequest{} type WritableContactGroupRequest struct { Name string `json:"name"` Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` - Parent NullableInt32 `json:"parent"` + Parent NullableInt32 `json:"parent,omitempty"` Description *string `json:"description,omitempty"` Tags []NestedTagRequest `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` @@ -35,11 +35,10 @@ type _WritableContactGroupRequest WritableContactGroupRequest // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewWritableContactGroupRequest(name string, slug string, parent NullableInt32) *WritableContactGroupRequest { +func NewWritableContactGroupRequest(name string, slug string) *WritableContactGroupRequest { this := WritableContactGroupRequest{} this.Name = name this.Slug = slug - this.Parent = parent return &this } @@ -101,18 +100,16 @@ func (o *WritableContactGroupRequest) SetSlug(v string) { } -// GetParent returns the Parent field value -// If the value is explicit nil, the zero value for int32 will be returned +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). func (o *WritableContactGroupRequest) GetParent() int32 { - if o == nil || o.Parent.Get() == nil { + if o == nil || IsNil(o.Parent.Get()) { var ret int32 return ret } - return *o.Parent.Get() } -// GetParentOk returns a tuple with the Parent field value +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *WritableContactGroupRequest) GetParentOk() (*int32, bool) { @@ -122,11 +119,28 @@ func (o *WritableContactGroupRequest) GetParentOk() (*int32, bool) { return o.Parent.Get(), o.Parent.IsSet() } -// SetParent sets field value +// HasParent returns a boolean if a field has been set. +func (o *WritableContactGroupRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. func (o *WritableContactGroupRequest) SetParent(v int32) { o.Parent.Set(&v) } +// SetParentNil sets the value for Parent to be an explicit nil +func (o *WritableContactGroupRequest) SetParentNil() { + o.Parent.Set(nil) +} +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *WritableContactGroupRequest) UnsetParent() { + o.Parent.Unset() +} // GetDescription returns the Description field value if set, zero value otherwise. func (o *WritableContactGroupRequest) GetDescription() string { @@ -236,7 +250,9 @@ func (o WritableContactGroupRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["name"] = o.Name toSerialize["slug"] = o.Slug - toSerialize["parent"] = o.Parent.Get() + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } if !IsNil(o.Description) { toSerialize["description"] = o.Description } @@ -261,7 +277,6 @@ func (o *WritableContactGroupRequest) UnmarshalJSON(data []byte) (err error) { requiredProperties := []string{ "name", "slug", - "parent", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_writable_location_request.go b/netbox/model_writable_location_request.go index 77ca8a7a1..28a3fa23e 100644 --- a/netbox/model_writable_location_request.go +++ b/netbox/model_writable_location_request.go @@ -23,7 +23,7 @@ type WritableLocationRequest struct { Name string `json:"name"` Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` Site BriefSiteRequest `json:"site"` - Parent NullableInt32 `json:"parent"` + Parent NullableInt32 `json:"parent,omitempty"` Status *LocationStatusValue `json:"status,omitempty"` Tenant NullableBriefTenantRequest `json:"tenant,omitempty"` // Local facility ID or description @@ -40,12 +40,11 @@ type _WritableLocationRequest WritableLocationRequest // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewWritableLocationRequest(name string, slug string, site BriefSiteRequest, parent NullableInt32) *WritableLocationRequest { +func NewWritableLocationRequest(name string, slug string, site BriefSiteRequest) *WritableLocationRequest { this := WritableLocationRequest{} this.Name = name this.Slug = slug this.Site = site - this.Parent = parent return &this } @@ -132,18 +131,16 @@ func (o *WritableLocationRequest) SetSite(v BriefSiteRequest) { } -// GetParent returns the Parent field value -// If the value is explicit nil, the zero value for int32 will be returned +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). func (o *WritableLocationRequest) GetParent() int32 { - if o == nil || o.Parent.Get() == nil { + if o == nil || IsNil(o.Parent.Get()) { var ret int32 return ret } - return *o.Parent.Get() } -// GetParentOk returns a tuple with the Parent field value +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *WritableLocationRequest) GetParentOk() (*int32, bool) { @@ -153,11 +150,28 @@ func (o *WritableLocationRequest) GetParentOk() (*int32, bool) { return o.Parent.Get(), o.Parent.IsSet() } -// SetParent sets field value +// HasParent returns a boolean if a field has been set. +func (o *WritableLocationRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. func (o *WritableLocationRequest) SetParent(v int32) { o.Parent.Set(&v) } +// SetParentNil sets the value for Parent to be an explicit nil +func (o *WritableLocationRequest) SetParentNil() { + o.Parent.Set(nil) +} +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *WritableLocationRequest) UnsetParent() { + o.Parent.Unset() +} // GetStatus returns the Status field value if set, zero value otherwise. func (o *WritableLocationRequest) GetStatus() LocationStatusValue { @@ -374,7 +388,9 @@ func (o WritableLocationRequest) ToMap() (map[string]interface{}, error) { toSerialize["name"] = o.Name toSerialize["slug"] = o.Slug toSerialize["site"] = o.Site - toSerialize["parent"] = o.Parent.Get() + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } if !IsNil(o.Status) { toSerialize["status"] = o.Status } @@ -409,7 +425,6 @@ func (o *WritableLocationRequest) UnmarshalJSON(data []byte) (err error) { "name", "slug", "site", - "parent", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_writable_region_request.go b/netbox/model_writable_region_request.go index d6c25fb8c..e2f3fd884 100644 --- a/netbox/model_writable_region_request.go +++ b/netbox/model_writable_region_request.go @@ -22,7 +22,7 @@ var _ MappedNullable = &WritableRegionRequest{} type WritableRegionRequest struct { Name string `json:"name"` Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` - Parent NullableInt32 `json:"parent"` + Parent NullableInt32 `json:"parent,omitempty"` Description *string `json:"description,omitempty"` Tags []NestedTagRequest `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` @@ -35,11 +35,10 @@ type _WritableRegionRequest WritableRegionRequest // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewWritableRegionRequest(name string, slug string, parent NullableInt32) *WritableRegionRequest { +func NewWritableRegionRequest(name string, slug string) *WritableRegionRequest { this := WritableRegionRequest{} this.Name = name this.Slug = slug - this.Parent = parent return &this } @@ -101,18 +100,16 @@ func (o *WritableRegionRequest) SetSlug(v string) { } -// GetParent returns the Parent field value -// If the value is explicit nil, the zero value for int32 will be returned +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). func (o *WritableRegionRequest) GetParent() int32 { - if o == nil || o.Parent.Get() == nil { + if o == nil || IsNil(o.Parent.Get()) { var ret int32 return ret } - return *o.Parent.Get() } -// GetParentOk returns a tuple with the Parent field value +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *WritableRegionRequest) GetParentOk() (*int32, bool) { @@ -122,11 +119,28 @@ func (o *WritableRegionRequest) GetParentOk() (*int32, bool) { return o.Parent.Get(), o.Parent.IsSet() } -// SetParent sets field value +// HasParent returns a boolean if a field has been set. +func (o *WritableRegionRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. func (o *WritableRegionRequest) SetParent(v int32) { o.Parent.Set(&v) } +// SetParentNil sets the value for Parent to be an explicit nil +func (o *WritableRegionRequest) SetParentNil() { + o.Parent.Set(nil) +} +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *WritableRegionRequest) UnsetParent() { + o.Parent.Unset() +} // GetDescription returns the Description field value if set, zero value otherwise. func (o *WritableRegionRequest) GetDescription() string { @@ -236,7 +250,9 @@ func (o WritableRegionRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["name"] = o.Name toSerialize["slug"] = o.Slug - toSerialize["parent"] = o.Parent.Get() + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } if !IsNil(o.Description) { toSerialize["description"] = o.Description } @@ -261,7 +277,6 @@ func (o *WritableRegionRequest) UnmarshalJSON(data []byte) (err error) { requiredProperties := []string{ "name", "slug", - "parent", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_writable_site_group_request.go b/netbox/model_writable_site_group_request.go index 5c19c8c54..bbf5fa775 100644 --- a/netbox/model_writable_site_group_request.go +++ b/netbox/model_writable_site_group_request.go @@ -22,7 +22,7 @@ var _ MappedNullable = &WritableSiteGroupRequest{} type WritableSiteGroupRequest struct { Name string `json:"name"` Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` - Parent NullableInt32 `json:"parent"` + Parent NullableInt32 `json:"parent,omitempty"` Description *string `json:"description,omitempty"` Tags []NestedTagRequest `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` @@ -35,11 +35,10 @@ type _WritableSiteGroupRequest WritableSiteGroupRequest // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewWritableSiteGroupRequest(name string, slug string, parent NullableInt32) *WritableSiteGroupRequest { +func NewWritableSiteGroupRequest(name string, slug string) *WritableSiteGroupRequest { this := WritableSiteGroupRequest{} this.Name = name this.Slug = slug - this.Parent = parent return &this } @@ -101,18 +100,16 @@ func (o *WritableSiteGroupRequest) SetSlug(v string) { } -// GetParent returns the Parent field value -// If the value is explicit nil, the zero value for int32 will be returned +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). func (o *WritableSiteGroupRequest) GetParent() int32 { - if o == nil || o.Parent.Get() == nil { + if o == nil || IsNil(o.Parent.Get()) { var ret int32 return ret } - return *o.Parent.Get() } -// GetParentOk returns a tuple with the Parent field value +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *WritableSiteGroupRequest) GetParentOk() (*int32, bool) { @@ -122,11 +119,28 @@ func (o *WritableSiteGroupRequest) GetParentOk() (*int32, bool) { return o.Parent.Get(), o.Parent.IsSet() } -// SetParent sets field value +// HasParent returns a boolean if a field has been set. +func (o *WritableSiteGroupRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. func (o *WritableSiteGroupRequest) SetParent(v int32) { o.Parent.Set(&v) } +// SetParentNil sets the value for Parent to be an explicit nil +func (o *WritableSiteGroupRequest) SetParentNil() { + o.Parent.Set(nil) +} +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *WritableSiteGroupRequest) UnsetParent() { + o.Parent.Unset() +} // GetDescription returns the Description field value if set, zero value otherwise. func (o *WritableSiteGroupRequest) GetDescription() string { @@ -236,7 +250,9 @@ func (o WritableSiteGroupRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["name"] = o.Name toSerialize["slug"] = o.Slug - toSerialize["parent"] = o.Parent.Get() + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } if !IsNil(o.Description) { toSerialize["description"] = o.Description } @@ -261,7 +277,6 @@ func (o *WritableSiteGroupRequest) UnmarshalJSON(data []byte) (err error) { requiredProperties := []string{ "name", "slug", - "parent", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_writable_tunnel_termination_request.go b/netbox/model_writable_tunnel_termination_request.go index 69f07cd3f..1216ce709 100644 --- a/netbox/model_writable_tunnel_termination_request.go +++ b/netbox/model_writable_tunnel_termination_request.go @@ -23,7 +23,7 @@ type WritableTunnelTerminationRequest struct { Tunnel BriefTunnelRequest `json:"tunnel"` Role *PatchedWritableTunnelTerminationRequestRole `json:"role,omitempty"` TerminationType string `json:"termination_type"` - TerminationId NullableInt64 `json:"termination_id"` + TerminationId NullableInt64 `json:"termination_id,omitempty"` OutsideIp NullableBriefIPAddressRequest `json:"outside_ip,omitempty"` Tags []NestedTagRequest `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` @@ -36,11 +36,10 @@ type _WritableTunnelTerminationRequest WritableTunnelTerminationRequest // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewWritableTunnelTerminationRequest(tunnel BriefTunnelRequest, terminationType string, terminationId NullableInt64) *WritableTunnelTerminationRequest { +func NewWritableTunnelTerminationRequest(tunnel BriefTunnelRequest, terminationType string) *WritableTunnelTerminationRequest { this := WritableTunnelTerminationRequest{} this.Tunnel = tunnel this.TerminationType = terminationType - this.TerminationId = terminationId return &this } @@ -134,18 +133,16 @@ func (o *WritableTunnelTerminationRequest) SetTerminationType(v string) { } -// GetTerminationId returns the TerminationId field value -// If the value is explicit nil, the zero value for int64 will be returned +// GetTerminationId returns the TerminationId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *WritableTunnelTerminationRequest) GetTerminationId() int64 { - if o == nil || o.TerminationId.Get() == nil { + if o == nil || IsNil(o.TerminationId.Get()) { var ret int64 return ret } - return *o.TerminationId.Get() } -// GetTerminationIdOk returns a tuple with the TerminationId field value +// GetTerminationIdOk returns a tuple with the TerminationId field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *WritableTunnelTerminationRequest) GetTerminationIdOk() (*int64, bool) { @@ -155,11 +152,28 @@ func (o *WritableTunnelTerminationRequest) GetTerminationIdOk() (*int64, bool) { return o.TerminationId.Get(), o.TerminationId.IsSet() } -// SetTerminationId sets field value +// HasTerminationId returns a boolean if a field has been set. +func (o *WritableTunnelTerminationRequest) HasTerminationId() bool { + if o != nil && o.TerminationId.IsSet() { + return true + } + + return false +} + +// SetTerminationId gets a reference to the given NullableInt64 and assigns it to the TerminationId field. func (o *WritableTunnelTerminationRequest) SetTerminationId(v int64) { o.TerminationId.Set(&v) } +// SetTerminationIdNil sets the value for TerminationId to be an explicit nil +func (o *WritableTunnelTerminationRequest) SetTerminationIdNil() { + o.TerminationId.Set(nil) +} +// UnsetTerminationId ensures that no value is present for TerminationId, not even an explicit nil +func (o *WritableTunnelTerminationRequest) UnsetTerminationId() { + o.TerminationId.Unset() +} // GetOutsideIp returns the OutsideIp field value if set, zero value otherwise (both if not set or set to explicit null). func (o *WritableTunnelTerminationRequest) GetOutsideIp() BriefIPAddressRequest { @@ -282,7 +296,9 @@ func (o WritableTunnelTerminationRequest) ToMap() (map[string]interface{}, error toSerialize["role"] = o.Role } toSerialize["termination_type"] = o.TerminationType - toSerialize["termination_id"] = o.TerminationId.Get() + if o.TerminationId.IsSet() { + toSerialize["termination_id"] = o.TerminationId.Get() + } if o.OutsideIp.IsSet() { toSerialize["outside_ip"] = o.OutsideIp.Get() } @@ -307,7 +323,6 @@ func (o *WritableTunnelTerminationRequest) UnmarshalJSON(data []byte) (err error requiredProperties := []string{ "tunnel", "termination_type", - "termination_id", } // defaultValueFuncMap captures the default values for required properties. diff --git a/netbox/model_writable_wireless_lan_group_request.go b/netbox/model_writable_wireless_lan_group_request.go index 4f10bcb40..7871ac772 100644 --- a/netbox/model_writable_wireless_lan_group_request.go +++ b/netbox/model_writable_wireless_lan_group_request.go @@ -22,7 +22,7 @@ var _ MappedNullable = &WritableWirelessLANGroupRequest{} type WritableWirelessLANGroupRequest struct { Name string `json:"name"` Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` - Parent NullableInt32 `json:"parent"` + Parent NullableInt32 `json:"parent,omitempty"` Description *string `json:"description,omitempty"` Tags []NestedTagRequest `json:"tags,omitempty"` CustomFields map[string]interface{} `json:"custom_fields,omitempty"` @@ -35,11 +35,10 @@ type _WritableWirelessLANGroupRequest WritableWirelessLANGroupRequest // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewWritableWirelessLANGroupRequest(name string, slug string, parent NullableInt32) *WritableWirelessLANGroupRequest { +func NewWritableWirelessLANGroupRequest(name string, slug string) *WritableWirelessLANGroupRequest { this := WritableWirelessLANGroupRequest{} this.Name = name this.Slug = slug - this.Parent = parent return &this } @@ -101,18 +100,16 @@ func (o *WritableWirelessLANGroupRequest) SetSlug(v string) { } -// GetParent returns the Parent field value -// If the value is explicit nil, the zero value for int32 will be returned +// GetParent returns the Parent field value if set, zero value otherwise (both if not set or set to explicit null). func (o *WritableWirelessLANGroupRequest) GetParent() int32 { - if o == nil || o.Parent.Get() == nil { + if o == nil || IsNil(o.Parent.Get()) { var ret int32 return ret } - return *o.Parent.Get() } -// GetParentOk returns a tuple with the Parent field value +// GetParentOk returns a tuple with the Parent field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *WritableWirelessLANGroupRequest) GetParentOk() (*int32, bool) { @@ -122,11 +119,28 @@ func (o *WritableWirelessLANGroupRequest) GetParentOk() (*int32, bool) { return o.Parent.Get(), o.Parent.IsSet() } -// SetParent sets field value +// HasParent returns a boolean if a field has been set. +func (o *WritableWirelessLANGroupRequest) HasParent() bool { + if o != nil && o.Parent.IsSet() { + return true + } + + return false +} + +// SetParent gets a reference to the given NullableInt32 and assigns it to the Parent field. func (o *WritableWirelessLANGroupRequest) SetParent(v int32) { o.Parent.Set(&v) } +// SetParentNil sets the value for Parent to be an explicit nil +func (o *WritableWirelessLANGroupRequest) SetParentNil() { + o.Parent.Set(nil) +} +// UnsetParent ensures that no value is present for Parent, not even an explicit nil +func (o *WritableWirelessLANGroupRequest) UnsetParent() { + o.Parent.Unset() +} // GetDescription returns the Description field value if set, zero value otherwise. func (o *WritableWirelessLANGroupRequest) GetDescription() string { @@ -236,7 +250,9 @@ func (o WritableWirelessLANGroupRequest) ToMap() (map[string]interface{}, error) toSerialize := map[string]interface{}{} toSerialize["name"] = o.Name toSerialize["slug"] = o.Slug - toSerialize["parent"] = o.Parent.Get() + if o.Parent.IsSet() { + toSerialize["parent"] = o.Parent.Get() + } if !IsNil(o.Description) { toSerialize["description"] = o.Description } @@ -261,7 +277,6 @@ func (o *WritableWirelessLANGroupRequest) UnmarshalJSON(data []byte) (err error) requiredProperties := []string{ "name", "slug", - "parent", } // defaultValueFuncMap captures the default values for required properties. diff --git a/scripts/fix-spec.py b/scripts/fix-spec.py index 7bb879da6..f7da0b193 100755 --- a/scripts/fix-spec.py +++ b/scripts/fix-spec.py @@ -12,6 +12,9 @@ if 'components' in data and 'schemas' in data['components']: for name, schema in data['components']['schemas'].items(): if 'properties' in schema: + # List to store dynamically found nullable properties + dynamic_non_required_props = [] + # Remove "null" item from nullable enums for propName, prop in schema['properties'].items(): if 'enum' in prop and None in prop['enum']: @@ -19,6 +22,10 @@ if 'properties' in prop and 'value' in prop['properties'] and 'enum' in prop['properties']['value'] and None in prop['properties']['value']['enum']: prop['properties']['value']['enum'].remove(None) + # If property is nullable, add to non-required props + if prop.get('nullable', False): + dynamic_non_required_props.append(propName) + # Fix nullable types nullable_types = [ 'parent_device', @@ -28,6 +35,9 @@ for ntype in nullable_types: if ntype in schema['properties']: schema['properties'][ntype]['nullable'] = True + # Add to non-required if marked as nullable + if ntype not in dynamic_non_required_props: + dynamic_non_required_props.append(ntype) # Fix non-nullable types # See: https://github.com/OpenAPITools/openapi-generator/issues/18006 @@ -41,21 +51,27 @@ if schema['properties'][ntype]['format'] == 'binary': schema['properties'][ntype].pop('nullable', None) - if 'required' in schema: - non_required_props = [ - 'devicetype_count', - 'device_count', - 'virtualmachine_count', - 'prefix_count', - 'vlan_count', - 'rack_count', - 'vrf_count', - 'display_url', - 'cluster_count', - ] + # Combine the original non-required props with dynamically found nullable properties + non_required_props = [ + 'devicetype_count', + 'device_count', + 'virtualmachine_count', + 'prefix_count', + 'vlan_count', + 'rack_count', + 'vrf_count', + 'display_url', + 'cluster_count', + 'site_count', + 'created', # for sites + 'provider_count', # ASNs + ] + dynamic_non_required_props + if 'required' in schema: + # Filter out nullable properties from the required list schema['required'] = [prop for prop in schema['required'] if prop not in non_required_props] +# Add required fields to the Device schema data['components']['schemas']['Device']['required'] = [ 'id', 'url', diff --git a/tests/sites_test.go b/tests/sites_test.go new file mode 100644 index 000000000..2b628060c --- /dev/null +++ b/tests/sites_test.go @@ -0,0 +1,20 @@ +package main + +import ( + "context" + "io" + "testing" +) + +func TestListNetboxSites(t *testing.T) { + client := HGetClient(t) + + _, r, err := client.DcimAPI.DcimSitesList(context.TODO()).Execute() + if err != nil { + if r != nil { + bodyBytes, _ := io.ReadAll(r.Body) + t.Error(string(bodyBytes)) + t.Fatal(err) + } + } +} diff --git a/tests/tenant_test.go b/tests/tenant_test.go new file mode 100644 index 000000000..1f051c52e --- /dev/null +++ b/tests/tenant_test.go @@ -0,0 +1,18 @@ +package main + +import ( + "context" + "testing" +) + +func TestListTenants(t *testing.T) { + client := HGetClient(t) + + _, r, err := client.TenancyAPI.TenancyTenantsList(context.TODO()).Execute() + if err != nil { + if r != nil { + t.Fatal(r) + } + t.Fatal(err) + } +} From 800580fce9dcabd14b6726f22934a8b251023293 Mon Sep 17 00:00:00 2001 From: Antoine Date: Tue, 1 Oct 2024 19:42:06 +0000 Subject: [PATCH 2/2] Update docs --- readme.md | 111 ++++++------------------------------------------------ 1 file changed, 12 insertions(+), 99 deletions(-) diff --git a/readme.md b/readme.md index 2dc955322..a80ec9b33 100644 --- a/readme.md +++ b/readme.md @@ -1,24 +1,18 @@ # go-netbox -[![GoDoc](https://pkg.go.dev/badge/github.com/netbox-community/go-netbox/v4)](https://pkg.go.dev/github.com/netbox-community/go-netbox/v4) [![Build Status](https://github.com/netbox-community/go-netbox/workflows/main/badge.svg?branch=master)](https://github.com/netbox-community/go-netbox/actions) [![Report Card](https://goreportcard.com/badge/github.com/netbox-community/go-netbox)](https://goreportcard.com/report/github.com/netbox-community/go-netbox) +[![GoDoc](https://pkg.go.dev/badge/github.com/sherweb/go-netbox/v4)](https://pkg.go.dev/github.com/netbox-community/sherweb/v4) -_go-netbox_ is —to nobody's surprise— the official [Go](https://go.dev) API client for the [Netbox](https://github.com/netbox-community/netbox) IPAM and DCIM service. - -This project follows [Semantic Versioning](https://semver.org). The version of the library built for a Netbox version has the same tag, followed by a hyphen and the build number (an incremental integer), as several versions of the library may exist for the same version of Netbox. +This is a fork of [netbox-community/go-netbox](https://github.com/netbox-community/go-netbox) as it's not very maintainted. ## Installation Use `go get` to add the library as a dependency to your project. Do not forget to run `go mod init` first if necessary. ```shell -go get github.com/netbox-community/go-netbox/v4 +go get github.com/sherweb/go-netbox/v4 -# Or install a specific version -go get github.com/netbox-community/go-netbox/v4@v4.0.3-0 ``` -**Note:** dependencies should be managed with [Go modules](https://go.dev/doc/modules/managing-dependencies). - ## Usage ### Instantiate the client @@ -32,103 +26,22 @@ import ( "context" "log" - "github.com/netbox-community/go-netbox/v4" + "github.com/sherweb/go-netbox/v4/netbox" ) func main() { - ctx := context.Background() - - c := netbox.NewAPIClientFor("https://demo.netbox.dev", "v3ry$3cr3t") - - log.Printf("%+v", c) -} - -``` - -### Use the client - -With the client already instantiated, it is possible to consume any API feature. - -For example, to list the first 10 active virtual machines: - -```golang -package main - -import ( - "context" - "log" - - "github.com/netbox-community/go-netbox/v4" -) - -func main() { - ctx := context.Background() - - c := netbox.NewAPIClientFor("https://demo.netbox.dev", "v3ry$3cr3t") - - res, _, err := c.VirtualizationAPI. - VirtualizationVirtualMachinesList(ctx). - Status([]string{"active"}). - Limit(10). - Execute() + cfg := netbox.NewConfiguration() + cfg.Servers[0].URL = "Netbox URL" + cfg.AddDefaultHeader("Authorization", "Token sometoken") - if err != nil { - log.Fatal(err) - } - - log.Printf("%v", res.Results) + client := netbox.NewAPIClient(cfg) + } -``` - -See [docs](docs) or [reference](https://pkg.go.dev/github.com/netbox-community/go-netbox) for more information on all possible usages. - -## Development - -The project comes with a containerized development environment that may be used on any platform. It is only required to have [Git](https://git-scm.com) and [Docker Desktop](https://www.docker.com/products/docker-desktop/) (or, separately, [Docker](https://docs.docker.com/engine/install) and [Docker Compose](https://docs.docker.com/compose/install/)) installed on the machine. - -To start the development environment, run the following command. - -```bash -make -``` - -Then, to attach a shell in the container, run the command below. - -```bash -make shell -``` - -Finally, to stop the development environment, run the following command. -```bash -make down ``` -### Considerations +# Important ! -The library is entirely generated from the Netbox [OpenAPI](https://www.openapis.org/) specification using _[openapi-generator](https://github.com/OpenAPITools/openapi-generator)_. Therefore, files listed [here](.openapi-generator/files) should not be directly modified, as they will be overwritten in the next regeneration (see next section). +We'd recommend you look at the tests/ folder to look at what we've tested works... -In order to fix a bug in the generated code, the corresponding error in the OpenAPI spec must be fixed. To do so, the following steps may be followed: - -1. Optional. Patch the OpenAPI spec in this repo by editing [this script](scripts/fix-spec.py), so that a corrected version can be published as soon as possible. -2. Fix the OpenAPI spec in the [Netbox repository](https://github.com/netbox-community/netbox), either by reporting an issue or by creating a pull request. - -### Regenerate the library - -To update the OpenAPI specification to the latest Netbox version and regenerate the library, run the following command. - -```bash -make build -``` - -If regeneration of the library is needed for a specific Netbox version other than the latest one, pass the corresponding argument. - -```bash -make build NETBOX_VERSION=3.0.0 -``` - -In order to obtain the OpenAPI specification, the version of _[netbox-docker](https://github.com/netbox-community/netbox-docker)_ corresponding to the given Netbox version is used. However, it is also possible to provide a specific version of _netbox-docker_. - -```bash -make build NETBOX_VERSION=3.0.0 NETBOX_DOCKER_VERSION=1.3.1 -``` +Contribs welcome. \ No newline at end of file