Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions src/Packages/ZkEvmApi/Documentation~/PassportProfileApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

<a id="getprofilebyauthenticatedwallet"></a>
# **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<ProfileResponse> 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)

<a id="getuserinfo"></a>
# **GetUserInfo**
> UserInfo GetUserInfo ()
Expand Down
11 changes: 11 additions & 0 deletions src/Packages/ZkEvmApi/Documentation~/ProfileResponse.md
Original file line number Diff line number Diff line change
@@ -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)

164 changes: 164 additions & 0 deletions src/Packages/ZkEvmApi/Runtime/Api/PassportProfileApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@ public interface IPassportProfileApiSync : IApiAccessor
{
#region Synchronous Operations
/// <summary>
/// Get profile for authenticated user
/// </summary>
/// <remarks>
/// Get profile for the authenticated user&#39;s Passport wallet
/// </remarks>
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>ProfileResponse</returns>
ProfileResponse GetProfileByAuthenticatedWallet();

/// <summary>
/// Get profile for authenticated user
/// </summary>
/// <remarks>
/// Get profile for the authenticated user&#39;s Passport wallet
/// </remarks>
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>ApiResponse of ProfileResponse</returns>
ApiResponse<ProfileResponse> GetProfileByAuthenticatedWalletWithHttpInfo();
/// <summary>
/// Get all info for a Passport user
/// </summary>
/// <remarks>
Expand Down Expand Up @@ -140,6 +159,27 @@ public interface IPassportProfileApiAsync : IApiAccessor
{
#region Asynchronous Operations
/// <summary>
/// Get profile for authenticated user
/// </summary>
/// <remarks>
/// Get profile for the authenticated user&#39;s Passport wallet
/// </remarks>
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ProfileResponse</returns>
System.Threading.Tasks.Task<ProfileResponse> GetProfileByAuthenticatedWalletAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));

/// <summary>
/// Get profile for authenticated user
/// </summary>
/// <remarks>
/// Get profile for the authenticated user&#39;s Passport wallet
/// </remarks>
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (ProfileResponse)</returns>
System.Threading.Tasks.Task<ApiResponse<ProfileResponse>> GetProfileByAuthenticatedWalletWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
/// <summary>
/// Get all info for a Passport user
/// </summary>
/// <remarks>
Expand Down Expand Up @@ -396,6 +436,130 @@ public Immutable.Api.ZkEvm.Client.ExceptionFactory ExceptionFactory
set { _exceptionFactory = value; }
}

/// <summary>
/// Get profile for authenticated user Get profile for the authenticated user&#39;s Passport wallet
/// </summary>
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>ProfileResponse</returns>
public ProfileResponse GetProfileByAuthenticatedWallet()
{
Immutable.Api.ZkEvm.Client.ApiResponse<ProfileResponse> localVarResponse = GetProfileByAuthenticatedWalletWithHttpInfo();
return localVarResponse.Data;
}

/// <summary>
/// Get profile for authenticated user Get profile for the authenticated user&#39;s Passport wallet
/// </summary>
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>ApiResponse of ProfileResponse</returns>
public Immutable.Api.ZkEvm.Client.ApiResponse<ProfileResponse> 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<ProfileResponse>("/passport-profile/v1/profile", localVarRequestOptions, this.Configuration);

if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("GetProfileByAuthenticatedWallet", localVarResponse);
if (_exception != null) throw _exception;
}

return localVarResponse;
}

/// <summary>
/// Get profile for authenticated user Get profile for the authenticated user&#39;s Passport wallet
/// </summary>
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ProfileResponse</returns>
public async System.Threading.Tasks.Task<ProfileResponse> GetProfileByAuthenticatedWalletAsync(System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
var task = GetProfileByAuthenticatedWalletWithHttpInfoAsync(cancellationToken);
#if UNITY_EDITOR || !UNITY_WEBGL
Immutable.Api.ZkEvm.Client.ApiResponse<ProfileResponse> localVarResponse = await task.ConfigureAwait(false);
#else
Immutable.Api.ZkEvm.Client.ApiResponse<ProfileResponse> localVarResponse = await task;
#endif
return localVarResponse.Data;
}

/// <summary>
/// Get profile for authenticated user Get profile for the authenticated user&#39;s Passport wallet
/// </summary>
/// <exception cref="Immutable.Api.ZkEvm.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (ProfileResponse)</returns>
public async System.Threading.Tasks.Task<Immutable.Api.ZkEvm.Client.ApiResponse<ProfileResponse>> 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<ProfileResponse>("/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;
}

/// <summary>
/// Get all info for a Passport user Get all the info for an authenticated Passport user
/// </summary>
Expand Down
83 changes: 83 additions & 0 deletions src/Packages/ZkEvmApi/Runtime/Model/ProfileResponse.cs
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// Get profile by wallet response
/// </summary>
[DataContract(Name = "ProfileResponse")]
public partial class ProfileResponse
{
/// <summary>
/// Initializes a new instance of the <see cref="ProfileResponse" /> class.
/// </summary>
[JsonConstructorAttribute]
protected ProfileResponse() { }
/// <summary>
/// Initializes a new instance of the <see cref="ProfileResponse" /> class.
/// </summary>
/// <param name="username">username (required).</param>
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;
}

/// <summary>
/// Gets or Sets Username
/// </summary>
[DataMember(Name = "username", IsRequired = true, EmitDefaultValue = true)]
public string Username { 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 ProfileResponse {\n");
sb.Append(" Username: ").Append(Username).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 Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}

}

}
11 changes: 11 additions & 0 deletions src/Packages/ZkEvmApi/Runtime/Model/ProfileResponse.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading