From 273468dfdc010410fee27f6acb90baa9a43c5336 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 8 Jan 2026 10:09:29 +0000 Subject: [PATCH] feat: update immutable zkEVM API package --- .../Documentation~/PassportProfileApi.md | 93 ++++++++++ .../Documentation~/ProfileResponse.md | 11 ++ .../Runtime/Api/PassportProfileApi.cs | 164 ++++++++++++++++++ .../ZkEvmApi/Runtime/Model/ProfileResponse.cs | 83 +++++++++ .../Runtime/Model/ProfileResponse.cs.meta | 11 ++ src/Packages/ZkEvmApi/api~/openapi.yaml | 45 +++++ 6 files changed, 407 insertions(+) create mode 100644 src/Packages/ZkEvmApi/Documentation~/ProfileResponse.md create mode 100644 src/Packages/ZkEvmApi/Runtime/Model/ProfileResponse.cs create mode 100644 src/Packages/ZkEvmApi/Runtime/Model/ProfileResponse.cs.meta diff --git a/src/Packages/ZkEvmApi/Documentation~/PassportProfileApi.md b/src/Packages/ZkEvmApi/Documentation~/PassportProfileApi.md index bc5d3a5b..b2da9092 100644 --- a/src/Packages/ZkEvmApi/Documentation~/PassportProfileApi.md +++ b/src/Packages/ZkEvmApi/Documentation~/PassportProfileApi.md @@ -4,12 +4,105 @@ All URIs are relative to *https://api.sandbox.immutable.com* | Method | HTTP request | Description | |--------|--------------|-------------| +| [**GetProfileByAuthenticatedWallet**](PassportProfileApi.md#getprofilebyauthenticatedwallet) | **GET** /passport-profile/v1/profile | Get profile for authenticated user | | [**GetUserInfo**](PassportProfileApi.md#getuserinfo) | **GET** /passport-profile/v1/user/info | Get all info for a Passport user | | [**LinkWalletV2**](PassportProfileApi.md#linkwalletv2) | **POST** /passport-profile/v2/linked-wallets | Link wallet v2 | | [**SendPhoneOtp**](PassportProfileApi.md#sendphoneotp) | **POST** /passport-profile/v1/phone-otp | Send phone OTP code for user supplied phone number | | [**UpdateUsername**](PassportProfileApi.md#updateusername) | **POST** /passport-profile/v1/username | Update username | | [**VerifyPhoneOtp**](PassportProfileApi.md#verifyphoneotp) | **POST** /passport-profile/v1/phone-otp/verify | Verify phone OTP code against user phone number | + +# **GetProfileByAuthenticatedWallet** +> ProfileResponse GetProfileByAuthenticatedWallet () + +Get profile for authenticated user + +Get profile for the authenticated user's Passport wallet + +### Example +```csharp +using System.Collections.Generic; +using System.Diagnostics; +using Immutable.Api.ZkEvm.Api; +using Immutable.Api.ZkEvm.Client; +using Immutable.Api.ZkEvm.Model; + +namespace Example +{ + public class GetProfileByAuthenticatedWalletExample + { + public static void Main() + { + Configuration config = new Configuration(); + config.BasePath = "https://api.sandbox.immutable.com"; + // Configure Bearer token for authorization: BearerAuth + config.AccessToken = "YOUR_BEARER_TOKEN"; + + var apiInstance = new PassportProfileApi(config); + + try + { + // Get profile for authenticated user + ProfileResponse result = apiInstance.GetProfileByAuthenticatedWallet(); + Debug.WriteLine(result); + } + catch (ApiException e) + { + Debug.Print("Exception when calling PassportProfileApi.GetProfileByAuthenticatedWallet: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); + } + } + } +} +``` + +#### Using the GetProfileByAuthenticatedWalletWithHttpInfo variant +This returns an ApiResponse object which contains the response data, status code and headers. + +```csharp +try +{ + // Get profile for authenticated user + ApiResponse response = apiInstance.GetProfileByAuthenticatedWalletWithHttpInfo(); + Debug.Write("Status Code: " + response.StatusCode); + Debug.Write("Response Headers: " + response.Headers); + Debug.Write("Response Body: " + response.Data); +} +catch (ApiException e) +{ + Debug.Print("Exception when calling PassportProfileApi.GetProfileByAuthenticatedWalletWithHttpInfo: " + e.Message); + Debug.Print("Status Code: " + e.ErrorCode); + Debug.Print(e.StackTrace); +} +``` + +### Parameters +This endpoint does not need any parameter. +### Return type + +[**ProfileResponse**](ProfileResponse.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **401** | UnauthorizedError | - | +| **429** | TooManyRequestsError | - | +| **500** | InternalServerError | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **GetUserInfo** > UserInfo GetUserInfo () diff --git a/src/Packages/ZkEvmApi/Documentation~/ProfileResponse.md b/src/Packages/ZkEvmApi/Documentation~/ProfileResponse.md new file mode 100644 index 00000000..5d538400 --- /dev/null +++ b/src/Packages/ZkEvmApi/Documentation~/ProfileResponse.md @@ -0,0 +1,11 @@ +# Immutable.Api.ZkEvm.Model.ProfileResponse +Get profile by wallet response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Username** | **string** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/src/Packages/ZkEvmApi/Runtime/Api/PassportProfileApi.cs b/src/Packages/ZkEvmApi/Runtime/Api/PassportProfileApi.cs index c27b3dba..46357391 100644 --- a/src/Packages/ZkEvmApi/Runtime/Api/PassportProfileApi.cs +++ b/src/Packages/ZkEvmApi/Runtime/Api/PassportProfileApi.cs @@ -28,6 +28,25 @@ public interface IPassportProfileApiSync : IApiAccessor { #region Synchronous Operations /// + /// Get profile for authenticated user + /// + /// + /// Get profile for the authenticated user's Passport wallet + /// + /// Thrown when fails to make API call + /// ProfileResponse + ProfileResponse GetProfileByAuthenticatedWallet(); + + /// + /// Get profile for authenticated user + /// + /// + /// Get profile for the authenticated user's Passport wallet + /// + /// Thrown when fails to make API call + /// ApiResponse of ProfileResponse + ApiResponse GetProfileByAuthenticatedWalletWithHttpInfo(); + /// /// Get all info for a Passport user /// /// @@ -140,6 +159,27 @@ public interface IPassportProfileApiAsync : IApiAccessor { #region Asynchronous Operations /// + /// Get profile for authenticated user + /// + /// + /// Get profile for the authenticated user's Passport wallet + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ProfileResponse + System.Threading.Tasks.Task GetProfileByAuthenticatedWalletAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + + /// + /// Get profile for authenticated user + /// + /// + /// Get profile for the authenticated user's Passport wallet + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ProfileResponse) + System.Threading.Tasks.Task> GetProfileByAuthenticatedWalletWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)); + /// /// Get all info for a Passport user /// /// @@ -396,6 +436,130 @@ public Immutable.Api.ZkEvm.Client.ExceptionFactory ExceptionFactory set { _exceptionFactory = value; } } + /// + /// Get profile for authenticated user Get profile for the authenticated user's Passport wallet + /// + /// Thrown when fails to make API call + /// ProfileResponse + public ProfileResponse GetProfileByAuthenticatedWallet() + { + Immutable.Api.ZkEvm.Client.ApiResponse localVarResponse = GetProfileByAuthenticatedWalletWithHttpInfo(); + return localVarResponse.Data; + } + + /// + /// Get profile for authenticated user Get profile for the authenticated user's Passport wallet + /// + /// Thrown when fails to make API call + /// ApiResponse of ProfileResponse + public Immutable.Api.ZkEvm.Client.ApiResponse GetProfileByAuthenticatedWalletWithHttpInfo() + { + Immutable.Api.ZkEvm.Client.RequestOptions localVarRequestOptions = new Immutable.Api.ZkEvm.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + var localVarContentType = Immutable.Api.ZkEvm.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Immutable.Api.ZkEvm.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + var localVarResponse = this.Client.Get("/passport-profile/v1/profile", localVarRequestOptions, this.Configuration); + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetProfileByAuthenticatedWallet", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + + /// + /// Get profile for authenticated user Get profile for the authenticated user's Passport wallet + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ProfileResponse + public async System.Threading.Tasks.Task GetProfileByAuthenticatedWalletAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + var task = GetProfileByAuthenticatedWalletWithHttpInfoAsync(cancellationToken); +#if UNITY_EDITOR || !UNITY_WEBGL + Immutable.Api.ZkEvm.Client.ApiResponse localVarResponse = await task.ConfigureAwait(false); +#else + Immutable.Api.ZkEvm.Client.ApiResponse localVarResponse = await task; +#endif + return localVarResponse.Data; + } + + /// + /// Get profile for authenticated user Get profile for the authenticated user's Passport wallet + /// + /// Thrown when fails to make API call + /// Cancellation Token to cancel the request. + /// Task of ApiResponse (ProfileResponse) + public async System.Threading.Tasks.Task> GetProfileByAuthenticatedWalletWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + + Immutable.Api.ZkEvm.Client.RequestOptions localVarRequestOptions = new Immutable.Api.ZkEvm.Client.RequestOptions(); + + string[] _contentTypes = new string[] { + }; + + // to determine the Accept header + string[] _accepts = new string[] { + "application/json" + }; + + + var localVarContentType = Immutable.Api.ZkEvm.Client.ClientUtils.SelectHeaderContentType(_contentTypes); + if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = Immutable.Api.ZkEvm.Client.ClientUtils.SelectHeaderAccept(_accepts); + if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + + + // authentication (BearerAuth) required + // bearer authentication required + if (!string.IsNullOrEmpty(this.Configuration.AccessToken) && !localVarRequestOptions.HeaderParameters.ContainsKey("Authorization")) + { + localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken); + } + + // make the HTTP request + + var task = this.AsynchronousClient.GetAsync("/passport-profile/v1/profile", localVarRequestOptions, this.Configuration, cancellationToken); + +#if UNITY_EDITOR || !UNITY_WEBGL + var localVarResponse = await task.ConfigureAwait(false); +#else + var localVarResponse = await task; +#endif + + if (this.ExceptionFactory != null) + { + Exception _exception = this.ExceptionFactory("GetProfileByAuthenticatedWallet", localVarResponse); + if (_exception != null) throw _exception; + } + + return localVarResponse; + } + /// /// Get all info for a Passport user Get all the info for an authenticated Passport user /// diff --git a/src/Packages/ZkEvmApi/Runtime/Model/ProfileResponse.cs b/src/Packages/ZkEvmApi/Runtime/Model/ProfileResponse.cs new file mode 100644 index 00000000..31ba2062 --- /dev/null +++ b/src/Packages/ZkEvmApi/Runtime/Model/ProfileResponse.cs @@ -0,0 +1,83 @@ +/* + * Immutable zkEVM API + * + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using OpenAPIDateConverter = Immutable.Api.ZkEvm.Client.OpenAPIDateConverter; + +namespace Immutable.Api.ZkEvm.Model +{ + /// + /// Get profile by wallet response + /// + [DataContract(Name = "ProfileResponse")] + public partial class ProfileResponse + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ProfileResponse() { } + /// + /// Initializes a new instance of the class. + /// + /// username (required). + public ProfileResponse(string username = default(string)) + { + // to ensure "username" is required (not null) + if (username == null) + { + throw new ArgumentNullException("username is a required property for ProfileResponse and cannot be null"); + } + this.Username = username; + } + + /// + /// Gets or Sets Username + /// + [DataMember(Name = "username", IsRequired = true, EmitDefaultValue = true)] + public string Username { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class ProfileResponse {\n"); + sb.Append(" Username: ").Append(Username).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + } + +} diff --git a/src/Packages/ZkEvmApi/Runtime/Model/ProfileResponse.cs.meta b/src/Packages/ZkEvmApi/Runtime/Model/ProfileResponse.cs.meta new file mode 100644 index 00000000..5ef30c42 --- /dev/null +++ b/src/Packages/ZkEvmApi/Runtime/Model/ProfileResponse.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d6c4537798aca7e0ab3cb15c48334b60 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/ZkEvmApi/api~/openapi.yaml b/src/Packages/ZkEvmApi/api~/openapi.yaml index e09c0cb3..c33bc16d 100644 --- a/src/Packages/ZkEvmApi/api~/openapi.yaml +++ b/src/Packages/ZkEvmApi/api~/openapi.yaml @@ -3363,6 +3363,41 @@ paths: summary: Verify phone OTP code against user phone number tags: - passport profile + /passport-profile/v1/profile: + get: + description: Get profile for the authenticated user's Passport wallet + operationId: get-profile-by-authenticated-wallet + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileResponse' + description: OK + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/APIError401' + description: UnauthorizedError + "429": + content: + application/json: + schema: + $ref: '#/components/schemas/APIError429' + description: TooManyRequestsError + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/APIError500' + description: InternalServerError + security: + - BearerAuth: + - openid + summary: Get profile for authenticated user + tags: + - passport profile /passport-profile/v1/username: post: description: Update username for the authenticated user's Passport wallet @@ -9425,6 +9460,16 @@ components: - title - type - url + ProfileResponse: + description: Get profile by wallet response + example: + username: username + properties: + username: + type: string + required: + - username + type: object UsernameUpdateRequest: description: Request to update username example: