/* Libre Graph API Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. API version: v1.0.8 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package libregraph import ( "encoding/json" ) // checks if the SearchHit type satisfies the MappedNullable interface at compile time var _ MappedNullable = &SearchHit{} // SearchHit Represents an individual search result. Follows the [MS Graph searchHit](https://learn.microsoft.com/en-us/graph/api/resources/searchhit) resource type. type SearchHit struct { // The internal identifier for the item. HitId *string `json:"hitId,omitempty"` // The rank or the order of the result. Rank *int32 `json:"rank,omitempty"` // A summary of the result, if a summary is available. Summary *string `json:"summary,omitempty"` Resource *DriveItem `json:"resource,omitempty"` } // NewSearchHit instantiates a new SearchHit object // 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 NewSearchHit() *SearchHit { this := SearchHit{} return &this } // NewSearchHitWithDefaults instantiates a new SearchHit object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set func NewSearchHitWithDefaults() *SearchHit { this := SearchHit{} return &this } // GetHitId returns the HitId field value if set, zero value otherwise. func (o *SearchHit) GetHitId() string { if o == nil || IsNil(o.HitId) { var ret string return ret } return *o.HitId } // GetHitIdOk returns a tuple with the HitId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SearchHit) GetHitIdOk() (*string, bool) { if o == nil || IsNil(o.HitId) { return nil, false } return o.HitId, true } // HasHitId returns a boolean if a field has been set. func (o *SearchHit) HasHitId() bool { if o != nil && !IsNil(o.HitId) { return true } return false } // SetHitId gets a reference to the given string and assigns it to the HitId field. func (o *SearchHit) SetHitId(v string) { o.HitId = &v } // GetRank returns the Rank field value if set, zero value otherwise. func (o *SearchHit) GetRank() int32 { if o == nil || IsNil(o.Rank) { var ret int32 return ret } return *o.Rank } // GetRankOk returns a tuple with the Rank field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SearchHit) GetRankOk() (*int32, bool) { if o == nil || IsNil(o.Rank) { return nil, false } return o.Rank, true } // HasRank returns a boolean if a field has been set. func (o *SearchHit) HasRank() bool { if o != nil && !IsNil(o.Rank) { return true } return false } // SetRank gets a reference to the given int32 and assigns it to the Rank field. func (o *SearchHit) SetRank(v int32) { o.Rank = &v } // GetSummary returns the Summary field value if set, zero value otherwise. func (o *SearchHit) GetSummary() string { if o == nil || IsNil(o.Summary) { var ret string return ret } return *o.Summary } // GetSummaryOk returns a tuple with the Summary field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SearchHit) GetSummaryOk() (*string, bool) { if o == nil || IsNil(o.Summary) { return nil, false } return o.Summary, true } // HasSummary returns a boolean if a field has been set. func (o *SearchHit) HasSummary() bool { if o != nil && !IsNil(o.Summary) { return true } return false } // SetSummary gets a reference to the given string and assigns it to the Summary field. func (o *SearchHit) SetSummary(v string) { o.Summary = &v } // GetResource returns the Resource field value if set, zero value otherwise. func (o *SearchHit) GetResource() DriveItem { if o == nil || IsNil(o.Resource) { var ret DriveItem return ret } return *o.Resource } // GetResourceOk returns a tuple with the Resource field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SearchHit) GetResourceOk() (*DriveItem, bool) { if o == nil || IsNil(o.Resource) { return nil, false } return o.Resource, true } // HasResource returns a boolean if a field has been set. func (o *SearchHit) HasResource() bool { if o != nil && !IsNil(o.Resource) { return true } return false } // SetResource gets a reference to the given DriveItem and assigns it to the Resource field. func (o *SearchHit) SetResource(v DriveItem) { o.Resource = &v } func (o SearchHit) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o SearchHit) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !IsNil(o.HitId) { toSerialize["hitId"] = o.HitId } if !IsNil(o.Rank) { toSerialize["rank"] = o.Rank } if !IsNil(o.Summary) { toSerialize["summary"] = o.Summary } if !IsNil(o.Resource) { toSerialize["resource"] = o.Resource } return toSerialize, nil } type NullableSearchHit struct { value *SearchHit isSet bool } func (v NullableSearchHit) Get() *SearchHit { return v.value } func (v *NullableSearchHit) Set(val *SearchHit) { v.value = val v.isSet = true } func (v NullableSearchHit) IsSet() bool { return v.isSet } func (v *NullableSearchHit) Unset() { v.value = nil v.isSet = false } func NewNullableSearchHit(val *SearchHit) *NullableSearchHit { return &NullableSearchHit{value: val, isSet: true} } func (v NullableSearchHit) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableSearchHit) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }