Skip to content

Commit

Permalink
feat(specs): add support for widgets / banners in search for the csha…
Browse files Browse the repository at this point in the history
…rp client (generated)

algolia/api-clients-automation#3870

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Jonas <42573917+Kalmar99@users.noreply.github.com>
Co-authored-by: Jonas Kalmar Rønning <jonaskalmar.ronning@komplett.com>
Co-authored-by: Pierre Millot <pierre.millot@algolia.com>
  • Loading branch information
4 people committed Oct 6, 2024
1 parent 53d04e7 commit 6974514
Show file tree
Hide file tree
Showing 14 changed files with 1,130 additions and 2 deletions.
100 changes: 100 additions & 0 deletions algoliasearch/Models/Recommend/Banner.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
//
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
//
using System;
using System.Text;
using System.Linq;
using System.Text.Json.Serialization;
using System.Collections.Generic;
using Algolia.Search.Serializer;
using System.Text.Json;

namespace Algolia.Search.Models.Recommend;

/// <summary>
/// a search banner with image and url.
/// </summary>
public partial class Banner
{
/// <summary>
/// Initializes a new instance of the Banner class.
/// </summary>
public Banner()
{
}

/// <summary>
/// Gets or Sets Image
/// </summary>
[JsonPropertyName("image")]
public BannerImage Image { get; set; }

/// <summary>
/// Gets or Sets Link
/// </summary>
[JsonPropertyName("link")]
public BannerLink Link { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class Banner {\n");
sb.Append(" Image: ").Append(Image).Append("\n");
sb.Append(" Link: ").Append(Link).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonSerializer.Serialize(this, JsonConfig.Options);
}

/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
if (obj is not Banner input)
{
return false;
}

return
(Image == input.Image || (Image != null && Image.Equals(input.Image))) &&
(Link == input.Link || (Link != null && Link.Equals(input.Link)));
}

/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (Image != null)
{
hashCode = (hashCode * 59) + Image.GetHashCode();
}
if (Link != null)
{
hashCode = (hashCode * 59) + Link.GetHashCode();
}
return hashCode;
}
}

}

100 changes: 100 additions & 0 deletions algoliasearch/Models/Recommend/BannerImage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
//
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
//
using System;
using System.Text;
using System.Linq;
using System.Text.Json.Serialization;
using System.Collections.Generic;
using Algolia.Search.Serializer;
using System.Text.Json;

namespace Algolia.Search.Models.Recommend;

/// <summary>
/// image of a search banner.
/// </summary>
public partial class BannerImage
{
/// <summary>
/// Initializes a new instance of the BannerImage class.
/// </summary>
public BannerImage()
{
}

/// <summary>
/// Gets or Sets Urls
/// </summary>
[JsonPropertyName("urls")]
public BannerImageUrl Urls { get; set; }

/// <summary>
/// Gets or Sets Title
/// </summary>
[JsonPropertyName("title")]
public string Title { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class BannerImage {\n");
sb.Append(" Urls: ").Append(Urls).Append("\n");
sb.Append(" Title: ").Append(Title).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonSerializer.Serialize(this, JsonConfig.Options);
}

/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
if (obj is not BannerImage input)
{
return false;
}

return
(Urls == input.Urls || (Urls != null && Urls.Equals(input.Urls))) &&
(Title == input.Title || (Title != null && Title.Equals(input.Title)));
}

/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (Urls != null)
{
hashCode = (hashCode * 59) + Urls.GetHashCode();
}
if (Title != null)
{
hashCode = (hashCode * 59) + Title.GetHashCode();
}
return hashCode;
}
}

}

88 changes: 88 additions & 0 deletions algoliasearch/Models/Recommend/BannerImageUrl.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
//
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
//
using System;
using System.Text;
using System.Linq;
using System.Text.Json.Serialization;
using System.Collections.Generic;
using Algolia.Search.Serializer;
using System.Text.Json;

namespace Algolia.Search.Models.Recommend;

/// <summary>
/// url for a search banner image.
/// </summary>
public partial class BannerImageUrl
{
/// <summary>
/// Initializes a new instance of the BannerImageUrl class.
/// </summary>
public BannerImageUrl()
{
}

/// <summary>
/// Gets or Sets Url
/// </summary>
[JsonPropertyName("url")]
public string Url { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class BannerImageUrl {\n");
sb.Append(" Url: ").Append(Url).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonSerializer.Serialize(this, JsonConfig.Options);
}

/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
if (obj is not BannerImageUrl input)
{
return false;
}

return
(Url == input.Url || (Url != null && Url.Equals(input.Url)));
}

/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (Url != null)
{
hashCode = (hashCode * 59) + Url.GetHashCode();
}
return hashCode;
}
}

}

88 changes: 88 additions & 0 deletions algoliasearch/Models/Recommend/BannerLink.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
//
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
//
using System;
using System.Text;
using System.Linq;
using System.Text.Json.Serialization;
using System.Collections.Generic;
using Algolia.Search.Serializer;
using System.Text.Json;

namespace Algolia.Search.Models.Recommend;

/// <summary>
/// link for a banner defined in merchandising studio.
/// </summary>
public partial class BannerLink
{
/// <summary>
/// Initializes a new instance of the BannerLink class.
/// </summary>
public BannerLink()
{
}

/// <summary>
/// Gets or Sets Url
/// </summary>
[JsonPropertyName("url")]
public string Url { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class BannerLink {\n");
sb.Append(" Url: ").Append(Url).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonSerializer.Serialize(this, JsonConfig.Options);
}

/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="obj">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object obj)
{
if (obj is not BannerLink input)
{
return false;
}

return
(Url == input.Url || (Url != null && Url.Equals(input.Url)));
}

/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (Url != null)
{
hashCode = (hashCode * 59) + Url.GetHashCode();
}
return hashCode;
}
}

}

Loading

0 comments on commit 6974514

Please sign in to comment.