> For the complete documentation index, see [llms.txt](/llms.txt)

# GS2-Guild SDK API Reference

Specification of models and API references for GS2-Guild SDK for various programming languages



## Models

### Namespace

Namespace

A Namespace allows multiple independent instances of the same service within a single project by separating data spaces and usage contexts.
Each GS2 service is managed on a per-namespace basis. Even when using the same service, if the Namespace differs, the data is treated as a completely independent data space.

Therefore, you must create a Namespace before you can start using each service.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceId | string |  | * |  |  ~ 1024 chars | Namespace GRN<br>* Set automatically by the server |
| name | string |  | ✓ |  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| description | string |  |  |  |  ~ 1024 chars | Description |
| transactionSetting | [TransactionSetting](#transactionsetting) |  |  |  |  | Transaction Setting<br>Configuration for controlling how distributed transactions are executed when processing guild operations. Supports auto-run, atomic commit, and async processing options. |
| changeNotification | [NotificationSetting](#notificationsetting) |  |  |  |  | Guild Change Notification<br>Push notification sent via GS2-Gateway when guild information (display name, attributes, join policy, etc.) is updated. Allows guild members to receive real-time updates about changes to their guild. |
| joinNotification | [NotificationSetting](#notificationsetting) |  |  |  |  | Member Join Notification<br>Push notification sent via GS2-Gateway when a new member joins the guild, either through direct join (open policy) or after approval of a join request. Enables existing members to be notified of new additions. |
| leaveNotification | [NotificationSetting](#notificationsetting) |  |  |  |  | Member Leave Notification<br>Push notification sent via GS2-Gateway when a member leaves or is removed from the guild. Covers both voluntary departures and expulsions by guild masters. |
| changeMemberNotification | [NotificationSetting](#notificationsetting) |  |  |  |  | Member Change Notification<br>Push notification sent via GS2-Gateway when a guild member's information (role, metadata) is updated. Whether metadata changes trigger this notification can be controlled with changeMemberNotificationIgnoreChangeMetadata. |
| changeMemberNotificationIgnoreChangeMetadata | bool? |  |  | false |  | Whether to ignore changes in metadata when issuing notifications when member metadata is updated |
| receiveRequestNotification | [NotificationSetting](#notificationsetting) |  |  |  |  | Receive Request Notification<br>Push notification sent via GS2-Gateway when the guild receives a new join request from a user. Allows guild masters and authorized members to be notified of pending requests that require approval. |
| removeRequestNotification | [NotificationSetting](#notificationsetting) |  |  |  |  | Remove Request Notification<br>Push notification sent via GS2-Gateway when a guild join request is deleted, either by cancellation from the sender, rejection by the guild, or approval (which removes the request and adds the member). |
| createGuildScript | [ScriptSetting](#scriptsetting) |  |  |  |  | Script setting to execute when creating a Guild<br>Script Trigger Reference - [`createGuild`](../script/#createguild) |
| updateGuildScript | [ScriptSetting](#scriptsetting) |  |  |  |  | Script setting to execute when updating a guild<br>Script Trigger Reference - [`updateGuild`](../script/#updateguild) |
| joinGuildScript | [ScriptSetting](#scriptsetting) |  |  |  |  | Script setting to execute when joining a guild<br>Script Trigger Reference - [`joinGuild`](../script/#joinguild) |
| receiveJoinRequestScript | [ScriptSetting](#scriptsetting) |  |  |  |  | Script setting to execute when receiving a guild join request<br>Script Trigger Reference - [`receiveJoinRequest`](../script/#receivejoinrequest) |
| leaveGuildScript | [ScriptSetting](#scriptsetting) |  |  |  |  | Script setting to execute when leaving a guild<br>Script Trigger Reference - [`leaveGuild`](../script/#leaveguild) |
| changeRoleScript | [ScriptSetting](#scriptsetting) |  |  |  |  | Script setting to execute when changing the role assigned to a member<br>Script Trigger Reference - [`changeRole`](../script/#changerole) |
| deleteGuildScript | [ScriptSetting](#scriptsetting) |  |  |  |  | Script setting to execute when deleting a guild<br>Script Trigger Reference - [`deleteGuild`](../script/#deleteguild) |
| logSetting | [LogSetting](#logsetting) |  |  |  |  | Log Output Setting<br>Configuration for outputting log data of guild operations to GS2-Log. By specifying a GS2-Log Namespace, API request and response logs for guild creation, joining, leaving, and role changes can be collected. |
| createdAt | long |  | * | Current time |  | Creation Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |
| updatedAt | long |  | * | Current time |  | Last Updated Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | Revision |

**Related methods:**
describeNamespaces - List Namespaces
createNamespace - Create Namespace
getNamespace - Get Namespace
updateNamespace - Update Namespace
deleteNamespace - Delete Namespace



---

### TransactionSetting

Transaction Setting

Transaction Setting controls execution methods, consistency, asynchronous processing, and conflict avoidance mechanisms of transactions.
Combining features like AutoRun, AtomicCommit, asynchronous execution using GS2-Distributor, batch application of script results, and asynchronous processing of Acquire Actions via GS2-JobQueue enables robust transaction management tailored to game logic.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| enableAutoRun | bool |  |  | false |  | Whether to automatically execute issued transactions on the server side |
| enableAtomicCommit | bool | {enableAutoRun} == true |  | false |  | Whether to commit transactions atomically<br>* Enabled only if enableAutoRun is true |
| transactionUseDistributor | bool | {enableAtomicCommit} == true |  | false |  | Whether to execute transactions asynchronously<br>* Enabled only if enableAtomicCommit is true |
| commitScriptResultInUseDistributor | bool | {transactionUseDistributor} == true |  | false |  | Whether to execute the commit processing of the script result asynchronously<br>* Enabled only if transactionUseDistributor is true |
| acquireActionUseJobQueue | bool | {enableAtomicCommit} == true |  | false |  | Whether to use GS2-JobQueue to execute the acquire action<br>* Enabled only if enableAtomicCommit is true |
| distributorNamespaceId | string |  |  | "grn:gs2:{region}:{ownerId}:distributor:default" |  ~ 1024 chars | GS2-Distributor Namespace GRN used to execute transactions |
| queueNamespaceId | string |  |  | "grn:gs2:{region}:{ownerId}:queue:default" |  ~ 1024 chars | GS2-JobQueue Namespace GRN used to execute transactions |

**Related methods:**
createNamespace - Create Namespace
updateNamespace - Update Namespace


**Related models:**
Namespace - Namespace



---

### ScriptSetting

Script Setting

In GS2, you can associate custom scripts with microservice events and execute them.
This model holds the settings for triggering script execution.

There are two main ways to execute a script: synchronous execution and asynchronous execution.
Because synchronous execution blocks processing until the script finishes executing,
you can use the script result to stop the API execution or control the API response.

In contrast, asynchronous execution does not block processing until the script has finished executing.
However, because the script result cannot be used to stop the API execution or modify the API response,
asynchronous execution does not affect the API response flow and is generally recommended.

There are two types of asynchronous execution methods: GS2-Script and Amazon EventBridge.
By using Amazon EventBridge, you can write processing in languages other than Lua.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| triggerScriptId | string |  |  |  |  ~ 1024 chars | GS2-Script script GRN executed synchronously when the API is executed<br>Must be specified in GRN format starting with "grn:gs2:". |
| doneTriggerTargetType | string (enum)<br>enum {<br>"none",<br>"gs2_script",<br>"aws"<br>}<br> |  |  | "none" |  | Asynchronous script execution method<br>Specifies the type of script to use for asynchronous execution.<br>You can choose from "Do not use an asynchronous execution script (none)", "Use GS2-Script (gs2_script)", and "Use Amazon EventBridge (aws)"."none": None / "gs2_script": GS2-Script / "aws": Amazon EventBridge /  |
| doneTriggerScriptId | string | {doneTriggerTargetType} == "gs2_script" |  |  |  ~ 1024 chars | GS2-Script script GRN for asynchronous execution<br>Must be specified in GRN format starting with "grn:gs2:".<br>* Enabled only if doneTriggerTargetType is "gs2_script" |
| doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == "gs2_script" |  |  |  ~ 1024 chars | GS2-JobQueue Namespace GRN used to execute asynchronous scripts<br>If you want to execute asynchronous execution scripts via GS2-JobQueue instead of executing them directly, specify the GS2-JobQueue Namespace GRN.<br>GS2-JobQueue is generally not required unless you have a specific reason to use it.<br>* Enabled only if doneTriggerTargetType is "gs2_script" |

**Related methods:**
createNamespace - Create Namespace
updateNamespace - Update Namespace


**Related models:**
Namespace - Namespace



---

### NotificationSetting

Push Notification Setting

Configuration for sending push notifications when events occur in GS2 microservices.
The push notification here refers to the processing via the WebSocket interface provided by GS2-Gateway, and is different from the push notification of a smartphone.
For example, when matchmaking is completed or a friend request is received, the GS2-Gateway can send a push notification via the WebSocket interface, and the game client can detect the change of the state.

GS2-Gateway's push notifications can be used to forward notifications to mobile push notification services when the destination device is offline.
By properly utilizing mobile push notifications, you can implement a flow in which players are notified even if they exit the game during matchmaking and later return to it.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| gatewayNamespaceId | string |  |  | "grn:gs2:{region}:{ownerId}:gateway:default" |  ~ 1024 chars | GS2-Gateway Namespace to use for push notifications<br>Specify the GS2-Gateway Namespace ID in GRN format starting with "grn:gs2:". |
| enableTransferMobileNotification | bool? |  |  | false |  | Whether to forward the notification as a mobile push notification<br>When an attempt is made to send this notification and the destination device is offline, specify whether it should be forwarded as a mobile push notification. |
| sound | string | {enableTransferMobileNotification} == true |  |  |  ~ 1024 chars | Sound file name to be used for mobile push notifications<br>The sound file name specified here is used when sending mobile push notifications, and you can send notifications with a special sound.<br>* Enabled only if enableTransferMobileNotification is true |
| enable | string (enum)<br>enum {<br>"Enabled",<br>"Disabled"<br>}<br> |  |  | "Enabled" |  | Whether to enable push notifications"Enabled": Enabled / "Disabled": Disabled /  |

**Related methods:**
createNamespace - Create Namespace
updateNamespace - Update Namespace


**Related models:**
Namespace - Namespace



---

### LogSetting

Log Output Setting

Log Output Setting defines how log data is exported. This type holds the GS2-Log Namespace identifier (Namespace ID), which is used to export log data.
Specify the GS2-Log Namespace where log data is collected and stored in the GRN format for the Log Namespace ID (loggingNamespaceId).
Configuring this setting ensures that log data for API requests and responses occurring within the specified Namespace is output to the target GS2-Log Namespace.
GS2-Log provides real-time logs that can be used for system monitoring, analysis, debugging, and other operational purposes.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| loggingNamespaceId | string |  | ✓ |  |  ~ 1024 chars | GS2-Log Namespace GRN to output logs<br>Must be specified in GRN format starting with "grn:gs2:". |

**Related methods:**
createNamespace - Create Namespace
updateNamespace - Update Namespace


**Related models:**
Namespace - Namespace



---

### GitHubCheckoutSetting

Setting for checking out master data from GitHub


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| apiKeyId | string |  | ✓ |  |  ~ 1024 chars | GitHub API Key GRN |
| repositoryName | string |  | ✓ |  |  ~ 1024 chars | Repository Name |
| sourcePath | string |  | ✓ |  |  ~ 1024 chars | Master data (JSON) file path |
| referenceType | string (enum)<br>enum {<br>"commit_hash",<br>"branch",<br>"tag"<br>}<br> |  | ✓ |  |  | Source of code"commit_hash": Commit hash / "branch": Branch / "tag": Tag /  |
| commitHash | string | {referenceType} == "commit_hash" | ✓* |  |  ~ 1024 chars | Commit hash<br>* Required if referenceType is "commit_hash" |
| branchName | string | {referenceType} == "branch" | ✓* |  |  ~ 1024 chars | Branch Name<br>* Required if referenceType is "branch" |
| tagName | string | {referenceType} == "tag" | ✓* |  |  ~ 1024 chars | Tag Name<br>* Required if referenceType is "tag" |

**Related methods:**
updateCurrentGuildMasterFromGitHub - Update the currently active guild settings from GitHub



---

### Guild

Guild

A guild can have up to 5 attributes, which can be used when searching for guilds and displaying guild lists.

A guild can set a participation policy, allowing for either open participation or approval-based participation.
If open participation is selected, a user who requests to join the guild will immediately become a guild member.
If approval-based participation is selected, a user who requests to join the guild will not become a guild member until approved by the guild master or a guild member.

Guild members can be assigned roles, including guild master, guild member, and up to 10 custom roles defined by the guild.
A default role can be assigned to guild members when they join the guild.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| guildId | string |  | * |  |  ~ 1024 chars | Guild GRN<br>* Set automatically by the server |
| guildModelName | string |  | ✓ |  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| name | string |  | ✓ | UUID |  ~ 36 chars | Guild Name<br>Maintains a unique name for each guild.<br>The name is automatically generated in UUID (Universally Unique Identifier) format and used to identify each guild. |
| displayName | string |  | ✓ |  |  ~ 64 chars | Display Name<br>A human-readable name for the guild shown to players in the UI. Unlike the guild name (which is a system-generated UUID), the display name is set by the guild creator and can be updated. Used for guild search results, member lists, and other player-facing displays. |
| attribute1 | int |  |  |  | 0 ~ 2147483645 | Attribute 1<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. Up to 5 attributes are available for developers to define custom guild properties such as level, region, play style, or activity requirements. |
| attribute2 | int |  |  |  | 0 ~ 2147483645 | Attribute 2<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| attribute3 | int |  |  |  | 0 ~ 2147483645 | Attribute 3<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| attribute4 | int |  |  |  | 0 ~ 2147483645 | Attribute 4<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| attribute5 | int |  |  |  | 0 ~ 2147483645 | Attribute 5<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| metadata | string |  |  |  |  ~ 1024 chars | Guild Metadata<br>Arbitrary data associated with the guild that does not affect GS2 behavior. Can be used to store game-specific information such as guild emblems, descriptions, recruitment messages, or other custom data. |
| joinPolicy | string (enum)<br>enum {<br>"anybody",<br>"approval"<br>}<br> |  | ✓ |  |  | Join Policy<br>Controls how users can join this guild. "anybody" allows any user to join immediately without approval. "approval" requires the guild master or authorized members to approve join requests before the user becomes a member. This can be changed by the guild master at any time."anybody": Anybody can join / "approval": Approval required /  |
| customRoles | [List&lt;RoleModel&gt;](#rolemodel) |  |  | [] | 0 ~ 10 items | Custom Roles List<br>A list of guild-specific custom role definitions that override or extend the model-level roles. Each guild can define up to 10 custom roles with unique permission sets. These roles can be assigned to members in addition to the model-level roles. |
| guildMemberDefaultRole | string |  |  |  |  ~ 128 chars | Default Custom Role<br>The custom role automatically assigned to new members when they join this specific guild. If set, overrides the guild model's guildMemberDefaultRole for this guild. Must reference a role defined in the customRoles list. |
| currentMaximumMemberCount | int |  | ✓ |  | 1 ~ 2147483646 | Current Maximum Member Count<br>The current maximum number of members this guild can have. Initialized with the guild model's defaultMaximumMemberCount when the guild is created, and can be increased up to maximumMemberCount through guild operations or acquire actions (e.g., guild expansion items). |
| members | [List&lt;Member&gt;](#member) |  |  | [] | 0 ~ 100 items | Guild Member List<br>The list of all current members of this guild, including guild masters and regular members. Each entry contains the member's user ID, assigned role, metadata, and join timestamp. The number of members cannot exceed currentMaximumMemberCount. |
| createdAt | long |  | * | Current time |  | Creation Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |
| updatedAt | long |  | * | Current time |  | Last Updated Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | Revision |

**Related methods:**
searchGuilds - Search Guilds
searchGuildsByUserId - Search Guilds by User ID
createGuild - Create Guild
createGuildByUserId - Create Guild by User ID
getGuild - Get Guild
getGuildByUserId - Get Guild by User ID
updateGuild - Update Guild
updateGuildByGuildName - Update Guild by specifying a Guild name
deleteMember - Expel member
deleteMemberByGuildName - Expel member by specifying a Guild name
updateMemberRole - Update member role
updateMemberRoleByGuildName - Update member role by specifying a Guild name
batchUpdateMemberRole - Update member role in bulk
batchUpdateMemberRoleByGuildName - Update member role in bulk by specifying a Guild name
deleteGuild - Delete Guild
deleteGuildByGuildName - Delete Guild by specifying a Guild name
increaseMaximumCurrentMaximumMemberCountByGuildName - Add the maximum number of members by specifying a Guild name
decreaseMaximumCurrentMaximumMemberCount - Decrease the maximum number of members
decreaseMaximumCurrentMaximumMemberCountByGuildName - Decrease the maximum number of members by specifying a Guild name
verifyCurrentMaximumMemberCount - Verify the maximum number of guild members
verifyCurrentMaximumMemberCountByGuildName - Verify the maximum number of guild members by specifying a Guild name
verifyIncludeMember - Verify if guild members include user ID
verifyIncludeMemberByUserId - Verify if guild members include user ID by User ID
setMaximumCurrentMaximumMemberCountByGuildName - Set the maximum number of guild members by specifying a Guild name
updateMemberMetadata - Update member metadata
updateMemberMetadataByUserId - Update member metadata by User ID
withdrawal - Withdrawal from the Guild
withdrawalByUserId - Withdrawal from the Guild by specifying the user ID
getLastGuildMasterActivity - Get last activity date and time of guild master
getLastGuildMasterActivityByGuildName - Get last activity date and time of guild master by specifying a Guild name
promoteSeniorMember - Promote the most senior guild member to guild master if the guild master has not logged in for a certain period of time
promoteSeniorMemberByGuildName - Replace an inactive guild master with the longest-serving member by guild name
acceptRequest - Accept join request
acceptRequestByGuildName - Accept join request by specifying a Guild name
sendRequest - Send a join request
sendRequestByUserId - Send a join request by specifying the user ID
addIgnoreUser - Add User ID that refuse to participate
addIgnoreUserByGuildName - Add User ID that refuse to participate by specifying a Guild name



---

### JoinedGuild

Joined Guild

Represents a user's membership in a specific guild. Created when a user joins a guild (either directly or through approved request) and deleted when the user leaves or is expelled. Used to track which guilds a user currently belongs to, enabling enforcement of the maxConcurrentJoinGuilds limit.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| joinedGuildId | string |  | * |  |  ~ 1024 chars | Joined Guild GRN<br>* Set automatically by the server |
| guildModelName | string |  | ✓ |  |  ~ 128 chars | Guild Model Name<br>The name of the guild model that the joined guild belongs to. References the guild model definition which contains membership limits, role configurations, and other guild type settings. |
| guildName | string |  | ✓ |  |  ~ 128 chars | Guild Name<br>The unique name (UUID) of the guild that the user has joined. Used to identify the specific guild instance within the guild model. |
| userId | string |  | ✓ |  |  ~ 128 chars | User ID |
| createdAt | long |  | * | Current time |  | Creation Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |

**Related methods:**
describeJoinedGuilds - List joined Guilds
describeJoinedGuildsByUserId - List joined Guilds by User ID
getJoinedGuild - Get Joining Guild
getJoinedGuildByUserId - Get Joining Guild by User ID
withdrawal - Withdrawal from the Guild
withdrawalByUserId - Withdrawal from the Guild by specifying the user ID



---

### LastGuildMasterActivity

Last Guild Master Activity

Tracks the last time any guild master performed an activity within the guild. This timestamp is used by the inactivity-based succession system: when the configured inactivityPeriodDays in the guild model elapses without any guild master activity, leadership can be automatically transferred to another member. Each guild has one activity record that is updated whenever a guild master performs a guild operation.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| userId | string |  | ✓ |  |  ~ 128 chars | User ID |
| updatedAt | long |  | * | Current time |  | Last Updated Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |

**Related methods:**
getLastGuildMasterActivity - Get last activity date and time of guild master
getLastGuildMasterActivityByGuildName - Get last activity date and time of guild master by specifying a Guild name
promoteSeniorMember - Promote the most senior guild member to guild master if the guild master has not logged in for a certain period of time
promoteSeniorMemberByGuildName - Replace an inactive guild master with the longest-serving member by guild name



---

### ReceiveMemberRequest

Received Join Request

This entity represents a received guild join request that is awaiting approval.
This is a join request received by the target guild.
Once the relevant guild approves it, the participation request is deleted and the member is added to the member list.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| userId | string |  | ✓ |  |  ~ 128 chars | User ID<br>The GS2 user ID of the player who sent this join request to the guild. This identifies the applicant and is used to add them to the guild's member list upon approval, or to notify them upon rejection. |
| targetGuildName | string |  | ✓ |  |  ~ 128 chars | Target Guild Name<br>The unique name (UUID) of the guild that received this join request. This identifies the specific guild instance whose inbox contains this pending request, and is used to match the request with the guild's member management operations. |
| metadata | string |  |  |  |  ~ 512 chars | Metadata<br>Optional arbitrary data attached to this join request by the applicant, such as an introduction message or application reason. Guild masters can review this data when deciding whether to approve or reject the request. Maximum 512 characters. |
| createdAt | long |  | * | Current time |  | Creation Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |

**Related methods:**
describeReceiveRequests - List Received Join Requests
describeReceiveRequestsByGuildName - List Received Join Requests by specifying a Guild name
getReceiveRequest - Get Received Join Request
getReceiveRequestByGuildName - Get Received Join Request by specifying a Guild name
acceptRequest - Accept join request
acceptRequestByGuildName - Accept join request by specifying a Guild name
rejectRequest - Reject join request
rejectRequestByGuildName - Reject join request by specifying a Guild name



---

### SendMemberRequest

Sent Join Request

This entity represents the state of a member registration application in progress.
This entity represents a guild join request sent by the user.
When the target guild approves it, the join request is deleted and the user is added to the member list.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| userId | string |  | ✓ |  |  ~ 128 chars | User ID<br>The GS2 user ID of the player who sent this guild join request. This identifies the requesting user and is used to add them to the guild's member list upon approval. |
| targetGuildName | string |  | ✓ |  |  ~ 128 chars | Target Guild Name<br>The unique name (UUID) of the guild to which the join request was sent. This identifies the specific guild instance that the user is requesting to join, and is used to locate the guild's inbox for request processing. |
| metadata | string |  |  |  |  ~ 512 chars | Metadata<br>Optional arbitrary data attached to this join request, such as an introduction message or application reason. This data is visible to guild masters when reviewing the request, allowing them to make informed approval decisions. Maximum 512 characters. |
| createdAt | long |  | * | Current time |  | Creation Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |

**Related methods:**
describeSendRequests - List Sent Join Requests
describeSendRequestsByUserId - List Sent Join Requests by User ID
getSendRequest - Get Sent Join Request
getSendRequestByUserId - Get Sent Join Request by User ID
sendRequest - Send a join request
sendRequestByUserId - Send a join request by specifying the user ID
deleteRequest - Cancel a sent join request
deleteRequestByUserId - Cancel a sent join request by User ID



---

### IgnoreUser

Ignore User

Represents a user who is blocked from joining a specific guild. When a user is added to the ignore list, their join requests are automatically rejected, and they cannot join the guild even if the join policy is set to open. Used by guild masters to manage unwanted members.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| userId | string |  | ✓ |  |  ~ 128 chars | User ID |
| createdAt | long |  | * | Current time |  | Creation Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |

**Related methods:**
describeIgnoreUsers - List User IDs that refuse to participate
describeIgnoreUsersByGuildName - List User IDs that refuse to participate by specifying a Guild name
getIgnoreUser - Get User ID that refuse to participate
getIgnoreUserByGuildName - Get User ID that refuse to participate by specifying a Guild name
addIgnoreUser - Add User ID that refuse to participate
addIgnoreUserByGuildName - Add User ID that refuse to participate by specifying a Guild name
deleteIgnoreUser - Delete User ID that refuse to participate
deleteIgnoreUserByGuildName - Delete User ID that refuse to participate by specifying a Guild name



---

### GuildModel

Guild Model

A Guild Model is an entity that sets the maximum number of people who can join the guild and the permission settings for each position within the guild.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| guildModelId | string |  | * |  |  ~ 1024 chars | Guild Model GRN<br>* Set automatically by the server |
| name | string |  | ✓ |  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| metadata | string |  |  |  |  ~ 2048 chars | Metadata<br>Arbitrary values can be set in the metadata.<br>Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
| defaultMaximumMemberCount | int |  | ✓ |  | 1 ~ 2147483646 | Default Maximum Member Count<br>The initial maximum number of members allowed when a new guild is created. This value is used as the starting currentMaximumMemberCount for new guilds. Can be increased later up to the maximumMemberCount limit through guild operations or acquire actions. |
| maximumMemberCount | int |  | ✓ |  | 1 ~ 2147483646 | Maximum Member Count<br>The absolute upper limit for the number of members a guild can have. The guild's currentMaximumMemberCount cannot exceed this value. This serves as a hard cap to prevent guilds from growing beyond the intended size. |
| inactivityPeriodDays | int |  |  | 7 | 1 ~ 365 | Inactivity Period Days<br>The number of days of guild master inactivity after which a new guild master is automatically selected from the remaining guild members. This prevents guilds from becoming unmanageable when the guild master stops playing. |
| roles | [List&lt;RoleModel&gt;](#rolemodel) |  | ✓ |  | 1 ~ 10 items | List of Role Models<br>The list of role definitions available within guilds of this type. Must include at least the roles referenced by guildMasterRole and guildMemberDefaultRole. Each role defines a unique set of permissions via a policy document. Up to 10 roles can be defined. |
| guildMasterRole | string |  | ✓ |  |  ~ 128 chars | Guild Master Role Name<br>The name of the role assigned to guild masters. Must reference a role defined in the roles list. Guild masters typically have full permissions to manage the guild, including approving join requests, expelling members, changing roles, and updating guild settings. |
| guildMemberDefaultRole | string |  | ✓ |  |  ~ 128 chars | Default Member Role Name<br>The name of the role automatically assigned to new guild members when they join. Must reference a role defined in the roles list. This is the baseline permission set for regular members before any role changes by the guild master. |
| rejoinCoolTimeMinutes | int |  |  | 0 | 0 ~ 2147483646 | Rejoin Cool Time (Minutes)<br>The cooldown period in minutes before a user can rejoin a guild after leaving. Set to 0 to allow immediate rejoining. This prevents abuse patterns where users repeatedly join and leave guilds. |
| maxConcurrentJoinGuilds | int |  |  |  | 1 ~ 10 | Maximum Concurrent Guild Memberships<br>The maximum number of guilds of this type that a user can be a member of simultaneously. Allows for designs where players can belong to multiple guilds at the same time (e.g., a combat guild and a social guild). The value ranges from 1 to 10. |
| maxConcurrentGuildMasterCount | int |  |  |  | 1 ~ 100 | Maximum Concurrent Guild Master Count<br>The maximum number of guild masters that can exist in a single guild at the same time. Allows for co-leadership designs where multiple players share guild master responsibilities and permissions. The value ranges from 1 to 100. |

**Related methods:**
describeGuildModels - List Guild Models
getGuildModel - Get Guild Model



---

### RoleModel

Role Model

The role model defines the role within the guild and sets the permissions for each role.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| name | string |  | ✓ |  |  ~ 128 chars | Role Model name<br>Unique Role Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| metadata | string |  |  |  |  ~ 2048 chars | Metadata<br>Arbitrary values can be set in the metadata.<br>Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
| policyDocument | string |  | ✓ |  |  ~ 10240 chars | Policy Document<br>A JSON-formatted policy document that defines the permissions for this role. Specifies which guild operations (such as accepting/rejecting join requests, expelling members, updating guild info, changing member roles) are allowed or denied for members assigned to this role. |

**Related models:**
Guild - Guild
GuildModel - Guild Model
GuildModelMaster - Guild Model Master



---

### Member

Member

An entity that manages a list of guild members


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| userId | string |  | ✓ |  |  ~ 128 chars | User ID |
| roleName | string |  | ✓ |  |  ~ 128 chars | Role Model name<br>Unique Role Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| metadata | string |  |  |  |  ~ 512 chars | Guild Member Metadata<br>Arbitrary data associated with this guild member that does not affect GS2 behavior. Can be used to store member-specific information such as contribution points, last login time, or notes visible to guild officers. |
| joinedAt | long |  | * | Current time |  | Date and time of joining the guild<br>Unix time, milliseconds |

**Related models:**
Guild - Guild



---

### VerifyActionResult

Verify Action execution result


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| action | string (enum)<br>enum {<br>}<br> |  | ✓ |  |  | Type of Verify Action |
| verifyRequest | string |  | ✓ |  |  ~ 524288 chars | JSON string of the request used when executing the action |
| statusCode | int |  |  |  | 0 ~ 999 | Status code |
| verifyResult | string |  |  |  |  ~ 1048576 chars | Result content |

**Related models:**
TransactionResult - Transaction Execution Result



---

### ConsumeActionResult

Consume Action execution result


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| action | string (enum)<br>enum {<br>}<br> |  | ✓ |  |  | Type of Consume Action |
| consumeRequest | string |  | ✓ |  |  ~ 524288 chars | JSON string of the request used when executing the action |
| statusCode | int |  |  |  | 0 ~ 999 | Status code |
| consumeResult | string |  |  |  |  ~ 1048576 chars | Result content |

**Related models:**
TransactionResult - Transaction Execution Result



---

### AcquireActionResult

Acquire Action execution result


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| action | string (enum)<br>enum {<br>}<br> |  | ✓ |  |  | Type of Acquire Action |
| acquireRequest | string |  | ✓ |  |  ~ 524288 chars | JSON string of the request used when executing the action |
| statusCode | int |  |  |  | 0 ~ 999 | Status code |
| acquireResult | string |  |  |  |  ~ 1048576 chars | Result content |

**Related models:**
TransactionResult - Transaction Execution Result



---

### TransactionResult

Transaction Execution Result

Result of a transaction executed using the server-side automatic execution feature


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| transactionId | string |  | ✓ |  | 36 ~ 36 chars | Transaction ID |
| verifyResults | [List&lt;VerifyActionResult&gt;](#verifyactionresult) |  |  |  | 0 ~ 10 items | List of verify action execution results |
| consumeResults | [List&lt;ConsumeActionResult&gt;](#consumeactionresult) |  |  | [] | 0 ~ 10 items | List of Consume Action execution results |
| acquireResults | [List&lt;AcquireActionResult&gt;](#acquireactionresult) |  |  | [] | 0 ~ 100 items | List of Acquire Action execution results |
| hasError | bool |  |  | false |  | Whether an error occurred during transaction execution |


---

### CurrentGuildMaster

Currently active Guild Model master data

This master data defines the Guild Models currently active within the Namespace.
GS2 uses JSON format files for managing master data.
By uploading these files, you can apply the master data to the server.

To create JSON files, GS2 provides a master data editor within the management console.
Additionally, you can create tools better suited for game operations and export JSON files in the appropriate format.
**ℹ️ Note**

Please refer to [GS2-Guild Master Data Reference](api_reference/guild/master_data/) for the JSON file format.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceId | string |  | * |  |  ~ 1024 chars | Namespace GRN<br>* Set automatically by the server |
| settings | string |  | ✓ |  |  ~ 5242880 bytes (5MB) | Master Data |

**Related methods:**
exportMaster - Export Guild Model Master in a master data format that can be activated
getCurrentGuildMaster - Get currently active Guild Model master data
updateCurrentGuildMaster - Update currently active Guild Model master data
updateCurrentGuildMasterFromGitHub - Update the currently active guild settings from GitHub



---

### GuildModelMaster

Guild Model Master

Guild Model Master is data used to edit and manage Guild Model within the game. It is temporarily stored in the Management Console's Master Data Editor.
By performing import and update processes, it is reflected as Guild Model actually referenced by the game.

A Guild Model Master is an entity that sets the maximum number of people who can join the guild and the permission settings for each position within the guild.


|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| guildModelId | string |  | * |  |  ~ 1024 chars | Guild Model Master GRN<br>* Set automatically by the server |
| name | string |  | ✓ |  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| description | string |  |  |  |  ~ 1024 chars | Description |
| metadata | string |  |  |  |  ~ 1024 chars | Metadata<br>Arbitrary values can be set in the metadata.<br>Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
| defaultMaximumMemberCount | int |  | ✓ |  | 0 ~ 2147483646 | Default Maximum Member Count<br>The initial maximum number of members allowed when a new guild is created. This value is used as the starting currentMaximumMemberCount for new guilds. Can be increased later up to the maximumMemberCount limit through guild operations or acquire actions. |
| maximumMemberCount | int |  | ✓ |  | 0 ~ 2147483646 | Maximum Member Count<br>The absolute upper limit for the number of members a guild can have. The guild's currentMaximumMemberCount cannot exceed this value. This serves as a hard cap to prevent guilds from growing beyond the intended size. |
| inactivityPeriodDays | int |  |  | 7 | 1 ~ 365 | Inactivity Period Days<br>The number of days of guild master inactivity after which a new guild master is automatically selected from the remaining guild members. This prevents guilds from becoming unmanageable when the guild master stops playing. |
| roles | [List&lt;RoleModel&gt;](#rolemodel) |  | ✓ |  | 1 ~ 10 items | List of Role Models<br>The list of role definitions available within guilds of this type. Must include at least the roles referenced by guildMasterRole and guildMemberDefaultRole. Up to 10 roles can be defined. |
| guildMasterRole | string |  | ✓ |  |  ~ 128 chars | Guild Master Role Name<br>The name of the role assigned to guild masters. Must reference a role defined in the roles list. Guild masters typically have full permissions to manage the guild. |
| guildMemberDefaultRole | string |  | ✓ |  |  ~ 128 chars | Default Member Role Name<br>The name of the role automatically assigned to new guild members when they join. Must reference a role defined in the roles list. |
| rejoinCoolTimeMinutes | int |  |  | 0 | 0 ~ 2147483646 | Rejoin Cool Time (Minutes)<br>The cooldown period in minutes before a user can rejoin a guild after leaving. Set to 0 to allow immediate rejoining. This prevents abuse patterns where users repeatedly join and leave guilds. |
| maxConcurrentJoinGuilds | int |  |  |  | 1 ~ 10 | Maximum Concurrent Guild Memberships<br>The maximum number of guilds of this type that a user can be a member of simultaneously. The value ranges from 1 to 10. |
| maxConcurrentGuildMasterCount | int |  |  |  | 1 ~ 100 | Maximum Concurrent Guild Master Count<br>The maximum number of guild masters that can exist in a single guild at the same time. Allows for co-leadership designs. The value ranges from 1 to 100. |
| createdAt | long |  | * | Current time |  | Creation Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |
| updatedAt | long |  | * | Current time |  | Last Updated Timestamp<br>Unix time, milliseconds<br>* Set automatically by the server |
| revision | long |  |  | 0 | 0 ~ 9223372036854775805 | Revision |

**Related methods:**
describeGuildModelMasters - List Guild Model Masters
createGuildModelMaster - Create Guild Model Master
getGuildModelMaster - Get Guild Model Master
updateGuildModelMaster - Update Guild Model Master
deleteGuildModelMaster - Delete Guild Model Master



---
## Methods

### describeNamespaces

List Namespaces

Retrieves a list of Namespaces that have been created on a per-service basis within the project.
You can use the optional page token to start acquiring data from a specific location in the list.
You can also limit the number of Namespaces to be acquired.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namePrefix | string |  | |  |  ~ 64 chars | Filter by Namespace name prefix |
| pageToken | string |  | |  |  ~ 1024 chars | Token specifying the position from which to start acquiring data |
| limit | int |  | | 30 | 1 ~ 1000 | Number of data items to retrieve |

#### Result

|  | Type | Description |
| --- | --- | --- |
| items | [List&lt;Namespace&gt;](#namespace) | List of Namespaces |
| nextPageToken | string | Page token to retrieve the rest of the listing |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &guild.DescribeNamespacesRequest {
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DescribeNamespacesRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->describeNamespaces(
        (new DescribeNamespacesRequest())
            ->withNamePrefix(null)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DescribeNamespacesRequest;
import io.gs2.guild.result.DescribeNamespacesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DescribeNamespacesResult result = client.describeNamespaces(
        new DescribeNamespacesRequest()
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<Namespace> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Guild.Request.DescribeNamespacesRequest()
        .WithNamePrefix(null)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.describeNamespaces(
        new Gs2Guild.DescribeNamespacesRequest()
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.describe_namespaces(
        guild.DescribeNamespacesRequest()
            .with_name_prefix(None)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.describe_namespaces({
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.describe_namespaces_async({
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```



---

### createNamespace

Create Namespace

You must specify detailed information including the name, description, and various settings of the Namespace.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| name | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| description | string |  | |  |  ~ 1024 chars | Description |
| transactionSetting | [TransactionSetting](#transactionsetting) |  | |  |  | Transaction Setting<br>Configuration for controlling how distributed transactions are executed when processing guild operations. Supports auto-run, atomic commit, and async processing options. |
| changeNotification | [NotificationSetting](#notificationsetting) |  | |  |  | Guild Change Notification<br>Push notification sent via GS2-Gateway when guild information (display name, attributes, join policy, etc.) is updated. Allows guild members to receive real-time updates about changes to their guild. |
| joinNotification | [NotificationSetting](#notificationsetting) |  | |  |  | Member Join Notification<br>Push notification sent via GS2-Gateway when a new member joins the guild, either through direct join (open policy) or after approval of a join request. Enables existing members to be notified of new additions. |
| leaveNotification | [NotificationSetting](#notificationsetting) |  | |  |  | Member Leave Notification<br>Push notification sent via GS2-Gateway when a member leaves or is removed from the guild. Covers both voluntary departures and expulsions by guild masters. |
| changeMemberNotification | [NotificationSetting](#notificationsetting) |  | |  |  | Member Change Notification<br>Push notification sent via GS2-Gateway when a guild member's information (role, metadata) is updated. Whether metadata changes trigger this notification can be controlled with changeMemberNotificationIgnoreChangeMetadata. |
| changeMemberNotificationIgnoreChangeMetadata | bool? |  | | false |  | Whether to ignore changes in metadata when issuing notifications when member metadata is updated |
| receiveRequestNotification | [NotificationSetting](#notificationsetting) |  | |  |  | Receive Request Notification<br>Push notification sent via GS2-Gateway when the guild receives a new join request from a user. Allows guild masters and authorized members to be notified of pending requests that require approval. |
| removeRequestNotification | [NotificationSetting](#notificationsetting) |  | |  |  | Remove Request Notification<br>Push notification sent via GS2-Gateway when a guild join request is deleted, either by cancellation from the sender, rejection by the guild, or approval (which removes the request and adds the member). |
| createGuildScript | [ScriptSetting](#scriptsetting) |  | |  |  | Script setting to execute when creating a Guild<br>Script Trigger Reference - [`createGuild`](../script/#createguild) |
| updateGuildScript | [ScriptSetting](#scriptsetting) |  | |  |  | Script setting to execute when updating a guild<br>Script Trigger Reference - [`updateGuild`](../script/#updateguild) |
| joinGuildScript | [ScriptSetting](#scriptsetting) |  | |  |  | Script setting to execute when joining a guild<br>Script Trigger Reference - [`joinGuild`](../script/#joinguild) |
| receiveJoinRequestScript | [ScriptSetting](#scriptsetting) |  | |  |  | Script setting to execute when receiving a guild join request<br>Script Trigger Reference - [`receiveJoinRequest`](../script/#receivejoinrequest) |
| leaveGuildScript | [ScriptSetting](#scriptsetting) |  | |  |  | Script setting to execute when leaving a guild<br>Script Trigger Reference - [`leaveGuild`](../script/#leaveguild) |
| changeRoleScript | [ScriptSetting](#scriptsetting) |  | |  |  | Script setting to execute when changing the role assigned to a member<br>Script Trigger Reference - [`changeRole`](../script/#changerole) |
| deleteGuildScript | [ScriptSetting](#scriptsetting) |  | |  |  | Script setting to execute when deleting a guild<br>Script Trigger Reference - [`deleteGuild`](../script/#deleteguild) |
| logSetting | [LogSetting](#logsetting) |  | |  |  | Log Output Setting<br>Configuration for outputting log data of guild operations to GS2-Log. By specifying a GS2-Log Namespace, API request and response logs for guild creation, joining, leaving, and role changes can be collected. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Namespace](#namespace) | Namespace created |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &guild.CreateNamespaceRequest {
        Name: pointy.String("namespace-0001"),
        Description: nil,
        TransactionSetting: &guild.TransactionSetting{
            EnableAutoRun: pointy.Bool(false),
            QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"),
        },
        ChangeNotification: nil,
        JoinNotification: nil,
        LeaveNotification: nil,
        ChangeMemberNotification: nil,
        ChangeMemberNotificationIgnoreChangeMetadata: nil,
        ReceiveRequestNotification: nil,
        RemoveRequestNotification: nil,
        CreateGuildScript: nil,
        UpdateGuildScript: nil,
        JoinGuildScript: nil,
        ReceiveJoinRequestScript: nil,
        LeaveGuildScript: nil,
        ChangeRoleScript: nil,
        DeleteGuildScript: nil,
        LogSetting: &guild.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\CreateNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withDescription(null)
            ->withTransactionSetting((new \Gs2\Guild\Model\TransactionSetting())
                ->withEnableAutoRun(false)
                ->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"))
            ->withChangeNotification(null)
            ->withJoinNotification(null)
            ->withLeaveNotification(null)
            ->withChangeMemberNotification(null)
            ->withChangeMemberNotificationIgnoreChangeMetadata(null)
            ->withReceiveRequestNotification(null)
            ->withRemoveRequestNotification(null)
            ->withCreateGuildScript(null)
            ->withUpdateGuildScript(null)
            ->withJoinGuildScript(null)
            ->withReceiveJoinRequestScript(null)
            ->withLeaveGuildScript(null)
            ->withChangeRoleScript(null)
            ->withDeleteGuildScript(null)
            ->withLogSetting((new \Gs2\Guild\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.CreateNamespaceRequest;
import io.gs2.guild.result.CreateNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(new io.gs2.guild.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"))
            .withChangeNotification(null)
            .withJoinNotification(null)
            .withLeaveNotification(null)
            .withChangeMemberNotification(null)
            .withChangeMemberNotificationIgnoreChangeMetadata(null)
            .withReceiveRequestNotification(null)
            .withRemoveRequestNotification(null)
            .withCreateGuildScript(null)
            .withUpdateGuildScript(null)
            .withJoinGuildScript(null)
            .withReceiveJoinRequestScript(null)
            .withLeaveGuildScript(null)
            .withChangeRoleScript(null)
            .withDeleteGuildScript(null)
            .withLogSetting(new io.gs2.guild.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Guild.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithDescription(null)
        .WithTransactionSetting(new Gs2.Gs2Guild.Model.TransactionSetting()
            .WithEnableAutoRun(false)
            .WithQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"))
        .WithChangeNotification(null)
        .WithJoinNotification(null)
        .WithLeaveNotification(null)
        .WithChangeMemberNotification(null)
        .WithChangeMemberNotificationIgnoreChangeMetadata(null)
        .WithReceiveRequestNotification(null)
        .WithRemoveRequestNotification(null)
        .WithCreateGuildScript(null)
        .WithUpdateGuildScript(null)
        .WithJoinGuildScript(null)
        .WithReceiveJoinRequestScript(null)
        .WithLeaveGuildScript(null)
        .WithChangeRoleScript(null)
        .WithDeleteGuildScript(null)
        .WithLogSetting(new Gs2.Gs2Guild.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.createNamespace(
        new Gs2Guild.CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(new Gs2Guild.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"))
            .withChangeNotification(null)
            .withJoinNotification(null)
            .withLeaveNotification(null)
            .withChangeMemberNotification(null)
            .withChangeMemberNotificationIgnoreChangeMetadata(null)
            .withReceiveRequestNotification(null)
            .withRemoveRequestNotification(null)
            .withCreateGuildScript(null)
            .withUpdateGuildScript(null)
            .withJoinGuildScript(null)
            .withReceiveJoinRequestScript(null)
            .withLeaveGuildScript(null)
            .withChangeRoleScript(null)
            .withDeleteGuildScript(null)
            .withLogSetting(new Gs2Guild.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.create_namespace(
        guild.CreateNamespaceRequest()
            .with_name('namespace-0001')
            .with_description(None)
            .with_transaction_setting(
                guild.TransactionSetting()
                    .with_enable_auto_run(False)
                    .with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001'))
            .with_change_notification(None)
            .with_join_notification(None)
            .with_leave_notification(None)
            .with_change_member_notification(None)
            .with_change_member_notification_ignore_change_metadata(None)
            .with_receive_request_notification(None)
            .with_remove_request_notification(None)
            .with_create_guild_script(None)
            .with_update_guild_script(None)
            .with_join_guild_script(None)
            .with_receive_join_request_script(None)
            .with_leave_guild_script(None)
            .with_change_role_script(None)
            .with_delete_guild_script(None)
            .with_log_setting(
                guild.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.create_namespace({
    name="namespace-0001",
    description=nil,
    transactionSetting={
        enableAutoRun=false,
        queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
    },
    changeNotification=nil,
    joinNotification=nil,
    leaveNotification=nil,
    changeMemberNotification=nil,
    changeMemberNotificationIgnoreChangeMetadata=nil,
    receiveRequestNotification=nil,
    removeRequestNotification=nil,
    createGuildScript=nil,
    updateGuildScript=nil,
    joinGuildScript=nil,
    receiveJoinRequestScript=nil,
    leaveGuildScript=nil,
    changeRoleScript=nil,
    deleteGuildScript=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.create_namespace_async({
    name="namespace-0001",
    description=nil,
    transactionSetting={
        enableAutoRun=false,
        queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
    },
    changeNotification=nil,
    joinNotification=nil,
    leaveNotification=nil,
    changeMemberNotification=nil,
    changeMemberNotificationIgnoreChangeMetadata=nil,
    receiveRequestNotification=nil,
    removeRequestNotification=nil,
    createGuildScript=nil,
    updateGuildScript=nil,
    joinGuildScript=nil,
    receiveJoinRequestScript=nil,
    leaveGuildScript=nil,
    changeRoleScript=nil,
    deleteGuildScript=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### getNamespaceStatus

Get Namespace Status

Get the current status of the specified Namespace.
This includes whether the Namespace is active, pending, or in some other state.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |

#### Result

|  | Type | Description |
| --- | --- | --- |
| status | string | Namespace Status<br>"ACTIVE": Active / "DELETED": Deleted /  |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &guild.GetNamespaceStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
status := result.Status

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\GetNamespaceStatusRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->getNamespaceStatus(
        (new GetNamespaceStatusRequest())
            ->withNamespaceName("namespace-0001")
    );
    $status = $result->getStatus();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.GetNamespaceStatusRequest;
import io.gs2.guild.result.GetNamespaceStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    GetNamespaceStatusResult result = client.getNamespaceStatus(
        new GetNamespaceStatusRequest()
            .withNamespaceName("namespace-0001")
    );
    String status = result.getStatus();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Guild.Request.GetNamespaceStatusRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.getNamespaceStatus(
        new Gs2Guild.GetNamespaceStatusRequest()
            .withNamespaceName("namespace-0001")
    );
    const status = result.getStatus();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.get_namespace_status(
        guild.GetNamespaceStatusRequest()
            .with_namespace_name('namespace-0001')
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.get_namespace_status({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
status = result.status;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.get_namespace_status_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
status = result.status;

```



---

### getNamespace

Get Namespace

Get detailed information about the specified Namespace.
This includes the name, description, and other settings of the Namespace.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Namespace](#namespace) | Namespace |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &guild.GetNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\GetNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->getNamespace(
        (new GetNamespaceRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.GetNamespaceRequest;
import io.gs2.guild.result.GetNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    GetNamespaceResult result = client.getNamespace(
        new GetNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Guild.Request.GetNamespaceRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.getNamespace(
        new Gs2Guild.GetNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.get_namespace(
        guild.GetNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.get_namespace({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.get_namespace_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### updateNamespace

Update Namespace

Update the settings of the specified Namespace.
You can change the description and other settings of the Namespace.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| description | string |  | |  |  ~ 1024 chars | Description |
| transactionSetting | [TransactionSetting](#transactionsetting) |  | |  |  | Transaction Setting<br>Configuration for controlling how distributed transactions are executed when processing guild operations. Supports auto-run, atomic commit, and async processing options. |
| changeNotification | [NotificationSetting](#notificationsetting) |  | |  |  | Guild Change Notification<br>Push notification sent via GS2-Gateway when guild information (display name, attributes, join policy, etc.) is updated. Allows guild members to receive real-time updates about changes to their guild. |
| joinNotification | [NotificationSetting](#notificationsetting) |  | |  |  | Member Join Notification<br>Push notification sent via GS2-Gateway when a new member joins the guild, either through direct join (open policy) or after approval of a join request. Enables existing members to be notified of new additions. |
| leaveNotification | [NotificationSetting](#notificationsetting) |  | |  |  | Member Leave Notification<br>Push notification sent via GS2-Gateway when a member leaves or is removed from the guild. Covers both voluntary departures and expulsions by guild masters. |
| changeMemberNotification | [NotificationSetting](#notificationsetting) |  | |  |  | Member Change Notification<br>Push notification sent via GS2-Gateway when a guild member's information (role, metadata) is updated. Whether metadata changes trigger this notification can be controlled with changeMemberNotificationIgnoreChangeMetadata. |
| changeMemberNotificationIgnoreChangeMetadata | bool? |  | | false |  | Whether to ignore changes in metadata when issuing notifications when member metadata is updated |
| receiveRequestNotification | [NotificationSetting](#notificationsetting) |  | |  |  | Receive Request Notification<br>Push notification sent via GS2-Gateway when the guild receives a new join request from a user. Allows guild masters and authorized members to be notified of pending requests that require approval. |
| removeRequestNotification | [NotificationSetting](#notificationsetting) |  | |  |  | Remove Request Notification<br>Push notification sent via GS2-Gateway when a guild join request is deleted, either by cancellation from the sender, rejection by the guild, or approval (which removes the request and adds the member). |
| createGuildScript | [ScriptSetting](#scriptsetting) |  | |  |  | Script setting to execute when creating a Guild<br>Script Trigger Reference - [`createGuild`](../script/#createguild) |
| updateGuildScript | [ScriptSetting](#scriptsetting) |  | |  |  | Script setting to execute when updating a guild<br>Script Trigger Reference - [`updateGuild`](../script/#updateguild) |
| joinGuildScript | [ScriptSetting](#scriptsetting) |  | |  |  | Script setting to execute when joining a guild<br>Script Trigger Reference - [`joinGuild`](../script/#joinguild) |
| receiveJoinRequestScript | [ScriptSetting](#scriptsetting) |  | |  |  | Script setting to execute when receiving a guild join request<br>Script Trigger Reference - [`receiveJoinRequest`](../script/#receivejoinrequest) |
| leaveGuildScript | [ScriptSetting](#scriptsetting) |  | |  |  | Script setting to execute when leaving a guild<br>Script Trigger Reference - [`leaveGuild`](../script/#leaveguild) |
| changeRoleScript | [ScriptSetting](#scriptsetting) |  | |  |  | Script setting to execute when changing the role assigned to a member<br>Script Trigger Reference - [`changeRole`](../script/#changerole) |
| deleteGuildScript | [ScriptSetting](#scriptsetting) |  | |  |  | Script setting to execute when deleting a guild<br>Script Trigger Reference - [`deleteGuild`](../script/#deleteguild) |
| logSetting | [LogSetting](#logsetting) |  | |  |  | Log Output Setting<br>Configuration for outputting log data of guild operations to GS2-Log. By specifying a GS2-Log Namespace, API request and response logs for guild creation, joining, leaving, and role changes can be collected. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Namespace](#namespace) | Namespace updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &guild.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSetting: &guild.TransactionSetting{
            EnableAutoRun: pointy.Bool(false),
            QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002"),
        },
        ChangeNotification: nil,
        JoinNotification: nil,
        LeaveNotification: nil,
        ChangeMemberNotification: nil,
        ChangeMemberNotificationIgnoreChangeMetadata: nil,
        ReceiveRequestNotification: nil,
        RemoveRequestNotification: nil,
        CreateGuildScript: nil,
        UpdateGuildScript: nil,
        JoinGuildScript: nil,
        ReceiveJoinRequestScript: nil,
        LeaveGuildScript: nil,
        ChangeRoleScript: nil,
        DeleteGuildScript: nil,
        LogSetting: &guild.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\UpdateNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName("namespace-0001")
            ->withDescription("description1")
            ->withTransactionSetting((new \Gs2\Guild\Model\TransactionSetting())
                ->withEnableAutoRun(false)
                ->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002"))
            ->withChangeNotification(null)
            ->withJoinNotification(null)
            ->withLeaveNotification(null)
            ->withChangeMemberNotification(null)
            ->withChangeMemberNotificationIgnoreChangeMetadata(null)
            ->withReceiveRequestNotification(null)
            ->withRemoveRequestNotification(null)
            ->withCreateGuildScript(null)
            ->withUpdateGuildScript(null)
            ->withJoinGuildScript(null)
            ->withReceiveJoinRequestScript(null)
            ->withLeaveGuildScript(null)
            ->withChangeRoleScript(null)
            ->withDeleteGuildScript(null)
            ->withLogSetting((new \Gs2\Guild\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.UpdateNamespaceRequest;
import io.gs2.guild.result.UpdateNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(new io.gs2.guild.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002"))
            .withChangeNotification(null)
            .withJoinNotification(null)
            .withLeaveNotification(null)
            .withChangeMemberNotification(null)
            .withChangeMemberNotificationIgnoreChangeMetadata(null)
            .withReceiveRequestNotification(null)
            .withRemoveRequestNotification(null)
            .withCreateGuildScript(null)
            .withUpdateGuildScript(null)
            .withJoinGuildScript(null)
            .withReceiveJoinRequestScript(null)
            .withLeaveGuildScript(null)
            .withChangeRoleScript(null)
            .withDeleteGuildScript(null)
            .withLogSetting(new io.gs2.guild.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Guild.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithDescription("description1")
        .WithTransactionSetting(new Gs2.Gs2Guild.Model.TransactionSetting()
            .WithEnableAutoRun(false)
            .WithQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002"))
        .WithChangeNotification(null)
        .WithJoinNotification(null)
        .WithLeaveNotification(null)
        .WithChangeMemberNotification(null)
        .WithChangeMemberNotificationIgnoreChangeMetadata(null)
        .WithReceiveRequestNotification(null)
        .WithRemoveRequestNotification(null)
        .WithCreateGuildScript(null)
        .WithUpdateGuildScript(null)
        .WithJoinGuildScript(null)
        .WithReceiveJoinRequestScript(null)
        .WithLeaveGuildScript(null)
        .WithChangeRoleScript(null)
        .WithDeleteGuildScript(null)
        .WithLogSetting(new Gs2.Gs2Guild.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.updateNamespace(
        new Gs2Guild.UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(new Gs2Guild.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002"))
            .withChangeNotification(null)
            .withJoinNotification(null)
            .withLeaveNotification(null)
            .withChangeMemberNotification(null)
            .withChangeMemberNotificationIgnoreChangeMetadata(null)
            .withReceiveRequestNotification(null)
            .withRemoveRequestNotification(null)
            .withCreateGuildScript(null)
            .withUpdateGuildScript(null)
            .withJoinGuildScript(null)
            .withReceiveJoinRequestScript(null)
            .withLeaveGuildScript(null)
            .withChangeRoleScript(null)
            .withDeleteGuildScript(null)
            .withLogSetting(new Gs2Guild.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.update_namespace(
        guild.UpdateNamespaceRequest()
            .with_namespace_name('namespace-0001')
            .with_description('description1')
            .with_transaction_setting(
                guild.TransactionSetting()
                    .with_enable_auto_run(False)
                    .with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002'))
            .with_change_notification(None)
            .with_join_notification(None)
            .with_leave_notification(None)
            .with_change_member_notification(None)
            .with_change_member_notification_ignore_change_metadata(None)
            .with_receive_request_notification(None)
            .with_remove_request_notification(None)
            .with_create_guild_script(None)
            .with_update_guild_script(None)
            .with_join_guild_script(None)
            .with_receive_join_request_script(None)
            .with_leave_guild_script(None)
            .with_change_role_script(None)
            .with_delete_guild_script(None)
            .with_log_setting(
                guild.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.update_namespace({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting={
        enableAutoRun=false,
        queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002",
    },
    changeNotification=nil,
    joinNotification=nil,
    leaveNotification=nil,
    changeMemberNotification=nil,
    changeMemberNotificationIgnoreChangeMetadata=nil,
    receiveRequestNotification=nil,
    removeRequestNotification=nil,
    createGuildScript=nil,
    updateGuildScript=nil,
    joinGuildScript=nil,
    receiveJoinRequestScript=nil,
    leaveGuildScript=nil,
    changeRoleScript=nil,
    deleteGuildScript=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting={
        enableAutoRun=false,
        queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002",
    },
    changeNotification=nil,
    joinNotification=nil,
    leaveNotification=nil,
    changeMemberNotification=nil,
    changeMemberNotificationIgnoreChangeMetadata=nil,
    receiveRequestNotification=nil,
    removeRequestNotification=nil,
    createGuildScript=nil,
    updateGuildScript=nil,
    joinGuildScript=nil,
    receiveJoinRequestScript=nil,
    leaveGuildScript=nil,
    changeRoleScript=nil,
    deleteGuildScript=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### deleteNamespace

Delete Namespace

Delete the specified Namespace.
This operation is irreversible and all data associated with the deleted Namespace will be lost.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Namespace](#namespace) | Deleted Namespace |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &guild.DeleteNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DeleteNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->deleteNamespace(
        (new DeleteNamespaceRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DeleteNamespaceRequest;
import io.gs2.guild.result.DeleteNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DeleteNamespaceResult result = client.deleteNamespace(
        new DeleteNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Guild.Request.DeleteNamespaceRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.deleteNamespace(
        new Gs2Guild.DeleteNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.delete_namespace(
        guild.DeleteNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.delete_namespace({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.delete_namespace_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### getServiceVersion

Get Microservice Version


#### Request

Request parameters: None

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | string | Version |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.GetServiceVersion(
    &guild.GetServiceVersionRequest {
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\GetServiceVersionRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->getServiceVersion(
        (new GetServiceVersionRequest())
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.GetServiceVersionRequest;
import io.gs2.guild.result.GetServiceVersionResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    GetServiceVersionResult result = client.getServiceVersion(
        new GetServiceVersionRequest()
    );
    String item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
    new Gs2.Gs2Guild.Request.GetServiceVersionRequest(),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.getServiceVersion(
        new Gs2Guild.GetServiceVersionRequest()
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.get_service_version(
        guild.GetServiceVersionRequest()
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.get_service_version({
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.get_service_version_async({
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### dumpUserDataByUserId

Dump data associated with the specified user ID

Can be used to meet legal requirements for the protection of personal information, or to back up or migrate data.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

Return value: None

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &guild.DumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DumpUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->dumpUserDataByUserId(
        (new DumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DumpUserDataByUserIdRequest;
import io.gs2.guild.result.DumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DumpUserDataByUserIdResult result = client.dumpUserDataByUserId(
        new DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
    new Gs2.Gs2Guild.Request.DumpUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.dumpUserDataByUserId(
        new Gs2Guild.DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.dump_user_data_by_user_id(
        guild.DumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.dump_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.dump_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

```



---

### checkDumpUserDataByUserId

Check if the dump of the data associated with the specified user ID is complete


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| url | string | URL of output data |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &guild.CheckDumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\CheckDumpUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->checkDumpUserDataByUserId(
        (new CheckDumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.guild.result.CheckDumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    CheckDumpUserDataByUserIdResult result = client.checkDumpUserDataByUserId(
        new CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    String url = result.getUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
    new Gs2.Gs2Guild.Request.CheckDumpUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.checkDumpUserDataByUserId(
        new Gs2Guild.CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.check_dump_user_data_by_user_id(
        guild.CheckDumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.check_dump_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
url = result.url;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.check_dump_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
url = result.url;

```



---

### cleanUserDataByUserId

Clean User Data by User ID

Execute cleaning of data associated with the specified user ID.
This allows you to safely delete specific user data from the project.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

Return value: None

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &guild.CleanUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\CleanUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->cleanUserDataByUserId(
        (new CleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.CleanUserDataByUserIdRequest;
import io.gs2.guild.result.CleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    CleanUserDataByUserIdResult result = client.cleanUserDataByUserId(
        new CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
    new Gs2.Gs2Guild.Request.CleanUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.cleanUserDataByUserId(
        new Gs2Guild.CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.clean_user_data_by_user_id(
        guild.CleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.clean_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.clean_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

```



---

### checkCleanUserDataByUserId

Check if the cleaning of the data associated with the specified user ID is complete


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

Return value: None

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &guild.CheckCleanUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\CheckCleanUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->checkCleanUserDataByUserId(
        (new CheckCleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.guild.result.CheckCleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    CheckCleanUserDataByUserIdResult result = client.checkCleanUserDataByUserId(
        new CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
    new Gs2.Gs2Guild.Request.CheckCleanUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.checkCleanUserDataByUserId(
        new Gs2Guild.CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.check_clean_user_data_by_user_id(
        guild.CheckCleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.check_clean_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.check_clean_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

```



---

### prepareImportUserDataByUserId

Prepare User Data Import by User ID

The data that can be used for import is limited to the data exported by GS2, and old data may fail to import.
You can import data with a user ID different from the one you exported, but if the user ID is included in the payload of the user data, this may not be the case.

You can start the actual import process by uploading the exported zip file to the URL returned in the return value of this API and calling importUserDataByUserId.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| uploadToken | string | Token used to reflect results after upload |
| uploadUrl | string | URL used to upload user data |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &guild.PrepareImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\PrepareImportUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->prepareImportUserDataByUserId(
        (new PrepareImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $uploadToken = $result->getUploadToken();
    $uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.guild.result.PrepareImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    PrepareImportUserDataByUserIdResult result = client.prepareImportUserDataByUserId(
        new PrepareImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
    new Gs2.Gs2Guild.Request.PrepareImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.prepareImportUserDataByUserId(
        new Gs2Guild.PrepareImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.prepare_import_user_data_by_user_id(
        guild.PrepareImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.prepare_import_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.prepare_import_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

```



---

### importUserDataByUserId

Execute import of data associated with the specified user ID

The data that can be used for import is limited to the data exported by GS2, and old data may fail to import.
You can import data with a user ID different from the one you exported, but if the user ID is included in the payload of the user data, this may not be the case.

Before calling this API, you must call prepareImportUserDataByUserId to complete the upload preparation.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| uploadToken | string |  | ✓|  |  ~ 1024 chars | Token received in preparation for upload |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

Return value: None

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &guild.ImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\ImportUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->importUserDataByUserId(
        (new ImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.ImportUserDataByUserIdRequest;
import io.gs2.guild.result.ImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    ImportUserDataByUserIdResult result = client.importUserDataByUserId(
        new ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
    new Gs2.Gs2Guild.Request.ImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithUploadToken("upload-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.importUserDataByUserId(
        new Gs2Guild.ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.import_user_data_by_user_id(
        guild.ImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_upload_token('upload-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.import_user_data_by_user_id({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.import_user_data_by_user_id_async({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result

```



---

### checkImportUserDataByUserId

Check if the import of the data associated with the specified user ID is complete


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| uploadToken | string |  | ✓|  |  ~ 1024 chars | Token received in preparation for upload |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| url | string | URL of log data |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &guild.CheckImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\CheckImportUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->checkImportUserDataByUserId(
        (new CheckImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.CheckImportUserDataByUserIdRequest;
import io.gs2.guild.result.CheckImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    CheckImportUserDataByUserIdResult result = client.checkImportUserDataByUserId(
        new CheckImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
    String url = result.getUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
    new Gs2.Gs2Guild.Request.CheckImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithUploadToken("upload-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.checkImportUserDataByUserId(
        new Gs2Guild.CheckImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.check_import_user_data_by_user_id(
        guild.CheckImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_upload_token('upload-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.check_import_user_data_by_user_id({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
url = result.url;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.check_import_user_data_by_user_id_async({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
url = result.url;

```



---

### searchGuilds

Search Guilds

Searches for guilds with various filter criteria.
Supports filtering by displayName (partial match), integer attributes (attributes1-5), and join policies.
Results can be sorted by number of players, attribute values (ascending/descending), or last updated time.
By default, guilds at full member capacity are excluded; set includeFullMembersGuild to true to include them.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |
| displayName | string |  | |  |  ~ 64 chars | Display name to search for guild |
| attributes1 | List&lt;int&gt; |  | |  | 0 ~ 10 items | List of guild operation policies to search for guild |
| attributes2 | List&lt;int&gt; |  | |  | 0 ~ 10 items | List of guild operation policies to search for guild |
| attributes3 | List&lt;int&gt; |  | |  | 0 ~ 10 items | List of guild operation policies to search for guild |
| attributes4 | List&lt;int&gt; |  | |  | 0 ~ 10 items | List of guild operation policies to search for guild |
| attributes5 | List&lt;int&gt; |  | |  | 0 ~ 10 items | List of guild operation policies to search for guild |
| joinPolicies | List&lt;string&gt; |  | |  | 0 ~ 10 items | List of guild join policies to search for guild |
| includeFullMembersGuild | bool? |  | | false |  | Whether to include full guilds in search results |
| orderBy | string (enum)<br>enum {<br>"number_of_players",<br>"attribute1_asc",<br>"attribute1_desc",<br>"attribute2_asc",<br>"attribute2_desc",<br>"attribute3_asc",<br>"attribute3_desc",<br>"attribute4_asc",<br>"attribute4_desc",<br>"attribute5_asc",<br>"attribute5_desc",<br>"last_updated"<br>}<br> |  | | "number_of_players" |  | Sort order"number_of_players": Number of players joined / "attribute1_asc": Attribute1 ascending / "attribute1_desc": Attribute1 descending / "attribute2_asc": Attribute2 ascending / "attribute2_desc": Attribute2 descending / "attribute3_asc": Attribute3 ascending / "attribute3_desc": Attribute3 descending / "attribute4_asc": Attribute4 ascending / "attribute4_desc": Attribute4 descending / "attribute5_asc": Attribute5 ascending / "attribute5_desc": Attribute5 descending / "last_updated": Last updated /  |
| pageToken | string |  | |  |  ~ 1024 chars | Token specifying the position from which to start acquiring data |
| limit | int |  | | 30 | 1 ~ 1000 | Number of data items to retrieve |

#### Result

|  | Type | Description |
| --- | --- | --- |
| items | [List&lt;Guild&gt;](#guild) | List of Guild |
| nextPageToken | string | Page token to retrieve the rest of the listing |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.SearchGuilds(
    &guild.SearchGuildsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        DisplayName: nil,
        Attributes1: nil,
        Attributes2: nil,
        Attributes3: nil,
        Attributes4: nil,
        Attributes5: nil,
        JoinPolicies: nil,
        IncludeFullMembersGuild: nil,
        OrderBy: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\SearchGuildsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->searchGuilds(
        (new SearchGuildsRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withAccessToken("accessToken-0001")
            ->withDisplayName(null)
            ->withAttributes1(null)
            ->withAttributes2(null)
            ->withAttributes3(null)
            ->withAttributes4(null)
            ->withAttributes5(null)
            ->withJoinPolicies(null)
            ->withIncludeFullMembersGuild(null)
            ->withOrderBy(null)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.SearchGuildsRequest;
import io.gs2.guild.result.SearchGuildsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    SearchGuildsResult result = client.searchGuilds(
        new SearchGuildsRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken("accessToken-0001")
            .withDisplayName(null)
            .withAttributes1(null)
            .withAttributes2(null)
            .withAttributes3(null)
            .withAttributes4(null)
            .withAttributes5(null)
            .withJoinPolicies(null)
            .withIncludeFullMembersGuild(null)
            .withOrderBy(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<Guild> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.SearchGuildsResult> asyncResult = null;
yield return client.SearchGuilds(
    new Gs2.Gs2Guild.Request.SearchGuildsRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithAccessToken("accessToken-0001")
        .WithDisplayName(null)
        .WithAttributes1(null)
        .WithAttributes2(null)
        .WithAttributes3(null)
        .WithAttributes4(null)
        .WithAttributes5(null)
        .WithJoinPolicies(null)
        .WithIncludeFullMembersGuild(null)
        .WithOrderBy(null)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.searchGuilds(
        new Gs2Guild.SearchGuildsRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken("accessToken-0001")
            .withDisplayName(null)
            .withAttributes1(null)
            .withAttributes2(null)
            .withAttributes3(null)
            .withAttributes4(null)
            .withAttributes5(null)
            .withJoinPolicies(null)
            .withIncludeFullMembersGuild(null)
            .withOrderBy(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.search_guilds(
        guild.SearchGuildsRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_access_token('accessToken-0001')
            .with_display_name(None)
            .with_attributes1(None)
            .with_attributes2(None)
            .with_attributes3(None)
            .with_attributes4(None)
            .with_attributes5(None)
            .with_join_policies(None)
            .with_include_full_members_guild(None)
            .with_order_by(None)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.search_guilds({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken="accessToken-0001",
    displayName=nil,
    attributes1=nil,
    attributes2=nil,
    attributes3=nil,
    attributes4=nil,
    attributes5=nil,
    joinPolicies=nil,
    includeFullMembersGuild=nil,
    orderBy=nil,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.search_guilds_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken="accessToken-0001",
    displayName=nil,
    attributes1=nil,
    attributes2=nil,
    attributes3=nil,
    attributes4=nil,
    attributes5=nil,
    joinPolicies=nil,
    includeFullMembersGuild=nil,
    orderBy=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```



---

### searchGuildsByUserId

Search Guilds by User ID

Searches for guilds with various filter criteria (server-side operation).
The same filtering, sorting, and full-member-guild exclusion options apply as in the user-facing version.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| displayName | string |  | |  |  ~ 64 chars | Display name to search for guild |
| attributes1 | List&lt;int&gt; |  | |  | 0 ~ 10 items | List of guild operation policies to search for guild |
| attributes2 | List&lt;int&gt; |  | |  | 0 ~ 10 items | List of guild operation policies to search for guild |
| attributes3 | List&lt;int&gt; |  | |  | 0 ~ 10 items | List of guild operation policies to search for guild |
| attributes4 | List&lt;int&gt; |  | |  | 0 ~ 10 items | List of guild operation policies to search for guild |
| attributes5 | List&lt;int&gt; |  | |  | 0 ~ 10 items | List of guild operation policies to search for guild |
| joinPolicies | List&lt;string&gt; |  | |  | 0 ~ 10 items | List of guild join policies to search for guild |
| includeFullMembersGuild | bool? |  | | false |  | Whether to include full guilds in search results |
| orderBy | string (enum)<br>enum {<br>"number_of_players",<br>"attribute1_asc",<br>"attribute1_desc",<br>"attribute2_asc",<br>"attribute2_desc",<br>"attribute3_asc",<br>"attribute3_desc",<br>"attribute4_asc",<br>"attribute4_desc",<br>"attribute5_asc",<br>"attribute5_desc",<br>"last_updated"<br>}<br> |  | | "number_of_players" |  | Sort order"number_of_players": Number of players joined / "attribute1_asc": Attribute1 ascending / "attribute1_desc": Attribute1 descending / "attribute2_asc": Attribute2 ascending / "attribute2_desc": Attribute2 descending / "attribute3_asc": Attribute3 ascending / "attribute3_desc": Attribute3 descending / "attribute4_asc": Attribute4 ascending / "attribute4_desc": Attribute4 descending / "attribute5_asc": Attribute5 ascending / "attribute5_desc": Attribute5 descending / "last_updated": Last updated /  |
| pageToken | string |  | |  |  ~ 1024 chars | Token specifying the position from which to start acquiring data |
| limit | int |  | | 30 | 1 ~ 1000 | Number of data items to retrieve |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| items | [List&lt;Guild&gt;](#guild) | List of Guild |
| nextPageToken | string | Page token to retrieve the rest of the listing |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.SearchGuildsByUserId(
    &guild.SearchGuildsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        UserId: pointy.String("user-0001"),
        DisplayName: nil,
        Attributes1: nil,
        Attributes2: nil,
        Attributes3: nil,
        Attributes4: nil,
        Attributes5: nil,
        JoinPolicies: nil,
        IncludeFullMembersGuild: nil,
        OrderBy: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\SearchGuildsByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->searchGuildsByUserId(
        (new SearchGuildsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withUserId("user-0001")
            ->withDisplayName(null)
            ->withAttributes1(null)
            ->withAttributes2(null)
            ->withAttributes3(null)
            ->withAttributes4(null)
            ->withAttributes5(null)
            ->withJoinPolicies(null)
            ->withIncludeFullMembersGuild(null)
            ->withOrderBy(null)
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.SearchGuildsByUserIdRequest;
import io.gs2.guild.result.SearchGuildsByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    SearchGuildsByUserIdResult result = client.searchGuildsByUserId(
        new SearchGuildsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withUserId("user-0001")
            .withDisplayName(null)
            .withAttributes1(null)
            .withAttributes2(null)
            .withAttributes3(null)
            .withAttributes4(null)
            .withAttributes5(null)
            .withJoinPolicies(null)
            .withIncludeFullMembersGuild(null)
            .withOrderBy(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Guild> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.SearchGuildsByUserIdResult> asyncResult = null;
yield return client.SearchGuildsByUserId(
    new Gs2.Gs2Guild.Request.SearchGuildsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithUserId("user-0001")
        .WithDisplayName(null)
        .WithAttributes1(null)
        .WithAttributes2(null)
        .WithAttributes3(null)
        .WithAttributes4(null)
        .WithAttributes5(null)
        .WithJoinPolicies(null)
        .WithIncludeFullMembersGuild(null)
        .WithOrderBy(null)
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.searchGuildsByUserId(
        new Gs2Guild.SearchGuildsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withUserId("user-0001")
            .withDisplayName(null)
            .withAttributes1(null)
            .withAttributes2(null)
            .withAttributes3(null)
            .withAttributes4(null)
            .withAttributes5(null)
            .withJoinPolicies(null)
            .withIncludeFullMembersGuild(null)
            .withOrderBy(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.search_guilds_by_user_id(
        guild.SearchGuildsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_user_id('user-0001')
            .with_display_name(None)
            .with_attributes1(None)
            .with_attributes2(None)
            .with_attributes3(None)
            .with_attributes4(None)
            .with_attributes5(None)
            .with_join_policies(None)
            .with_include_full_members_guild(None)
            .with_order_by(None)
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.search_guilds_by_user_id({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    userId="user-0001",
    displayName=nil,
    attributes1=nil,
    attributes2=nil,
    attributes3=nil,
    attributes4=nil,
    attributes5=nil,
    joinPolicies=nil,
    includeFullMembersGuild=nil,
    orderBy=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.search_guilds_by_user_id_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    userId="user-0001",
    displayName=nil,
    attributes1=nil,
    attributes2=nil,
    attributes3=nil,
    attributes4=nil,
    attributes5=nil,
    joinPolicies=nil,
    includeFullMembersGuild=nil,
    orderBy=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```



---

### createGuild

Create Guild

Creates a new guild and automatically registers the requesting user as the guild master.
Validates that the user's maxConcurrentJoinGuilds limit is not exceeded before creation.
The guild can be configured with a display name, custom attributes (attribute1-5), join policy, custom roles, and default member role.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| displayName | string |  | ✓|  |  ~ 64 chars | Display Name<br>A human-readable name for the guild shown to players in the UI. Unlike the guild name (which is a system-generated UUID), the display name is set by the guild creator and can be updated. Used for guild search results, member lists, and other player-facing displays. |
| attribute1 | int |  | |  | 0 ~ 2147483645 | Attribute 1<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. Up to 5 attributes are available for developers to define custom guild properties such as level, region, play style, or activity requirements. |
| attribute2 | int |  | |  | 0 ~ 2147483645 | Attribute 2<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| attribute3 | int |  | |  | 0 ~ 2147483645 | Attribute 3<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| attribute4 | int |  | |  | 0 ~ 2147483645 | Attribute 4<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| attribute5 | int |  | |  | 0 ~ 2147483645 | Attribute 5<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| metadata | string |  | |  |  ~ 1024 chars | Guild Metadata<br>Arbitrary data associated with the guild that does not affect GS2 behavior. Can be used to store game-specific information such as guild emblems, descriptions, recruitment messages, or other custom data. |
| memberMetadata | string |  | |  |  ~ 512 chars | Guild Member Metadata<br>Arbitrary data associated with this guild member that does not affect GS2 behavior. Can be used to store member-specific information such as contribution points, last login time, or notes visible to guild officers. |
| joinPolicy | string (enum)<br>enum {<br>"anybody",<br>"approval"<br>}<br> |  | ✓|  |  | Join Policy<br>Controls how users can join this guild. "anybody" allows any user to join immediately without approval. "approval" requires the guild master or authorized members to approve join requests before the user becomes a member. This can be changed by the guild master at any time."anybody": Anybody can join / "approval": Approval required /  |
| customRoles | [List&lt;RoleModel&gt;](#rolemodel) |  | | [] | 0 ~ 10 items | Custom Roles List<br>A list of guild-specific custom role definitions that override or extend the model-level roles. Each guild can define up to 10 custom roles with unique permission sets. These roles can be assigned to members in addition to the model-level roles. |
| guildMemberDefaultRole | string |  | |  |  ~ 128 chars | Default Custom Role<br>The custom role automatically assigned to new members when they join this specific guild. If set, overrides the guild model's guildMemberDefaultRole for this guild. Must reference a role defined in the customRoles list. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild created |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.CreateGuild(
    &guild.CreateGuildRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        DisplayName: pointy.String("My Guild"),
        Attribute1: pointy.Int32(1),
        Attribute2: nil,
        Attribute3: nil,
        Attribute4: nil,
        Attribute5: nil,
        Metadata: nil,
        MemberMetadata: nil,
        JoinPolicy: pointy.String("anybody"),
        CustomRoles: nil,
        GuildMemberDefaultRole: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\CreateGuildRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->createGuild(
        (new CreateGuildRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withGuildModelName("guild-model-0001")
            ->withDisplayName("My Guild")
            ->withAttribute1(1)
            ->withAttribute2(null)
            ->withAttribute3(null)
            ->withAttribute4(null)
            ->withAttribute5(null)
            ->withMetadata(null)
            ->withMemberMetadata(null)
            ->withJoinPolicy("anybody")
            ->withCustomRoles(null)
            ->withGuildMemberDefaultRole(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.CreateGuildRequest;
import io.gs2.guild.result.CreateGuildResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    CreateGuildResult result = client.createGuild(
        new CreateGuildRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-model-0001")
            .withDisplayName("My Guild")
            .withAttribute1(1)
            .withAttribute2(null)
            .withAttribute3(null)
            .withAttribute4(null)
            .withAttribute5(null)
            .withMetadata(null)
            .withMemberMetadata(null)
            .withJoinPolicy("anybody")
            .withCustomRoles(null)
            .withGuildMemberDefaultRole(null)
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.CreateGuildResult> asyncResult = null;
yield return client.CreateGuild(
    new Gs2.Gs2Guild.Request.CreateGuildRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithGuildModelName("guild-model-0001")
        .WithDisplayName("My Guild")
        .WithAttribute1(1)
        .WithAttribute2(null)
        .WithAttribute3(null)
        .WithAttribute4(null)
        .WithAttribute5(null)
        .WithMetadata(null)
        .WithMemberMetadata(null)
        .WithJoinPolicy("anybody")
        .WithCustomRoles(null)
        .WithGuildMemberDefaultRole(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.createGuild(
        new Gs2Guild.CreateGuildRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-model-0001")
            .withDisplayName("My Guild")
            .withAttribute1(1)
            .withAttribute2(null)
            .withAttribute3(null)
            .withAttribute4(null)
            .withAttribute5(null)
            .withMetadata(null)
            .withMemberMetadata(null)
            .withJoinPolicy("anybody")
            .withCustomRoles(null)
            .withGuildMemberDefaultRole(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.create_guild(
        guild.CreateGuildRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_guild_model_name('guild-model-0001')
            .with_display_name('My Guild')
            .with_attribute1(1)
            .with_attribute2(None)
            .with_attribute3(None)
            .with_attribute4(None)
            .with_attribute5(None)
            .with_metadata(None)
            .with_member_metadata(None)
            .with_join_policy('anybody')
            .with_custom_roles(None)
            .with_guild_member_default_role(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.create_guild({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-model-0001",
    displayName="My Guild",
    attribute1=1,
    attribute2=nil,
    attribute3=nil,
    attribute4=nil,
    attribute5=nil,
    metadata=nil,
    memberMetadata=nil,
    joinPolicy="anybody",
    customRoles=nil,
    guildMemberDefaultRole=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.create_guild_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-model-0001",
    displayName="My Guild",
    attribute1=1,
    attribute2=nil,
    attribute3=nil,
    attribute4=nil,
    attribute5=nil,
    metadata=nil,
    memberMetadata=nil,
    joinPolicy="anybody",
    customRoles=nil,
    guildMemberDefaultRole=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### createGuildByUserId

Create Guild by User ID

Creates a new guild with the specified user as the guild master (server-side operation).
The same maxConcurrentJoinGuilds validation applies as in the user-facing version.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| displayName | string |  | ✓|  |  ~ 64 chars | Display Name<br>A human-readable name for the guild shown to players in the UI. Unlike the guild name (which is a system-generated UUID), the display name is set by the guild creator and can be updated. Used for guild search results, member lists, and other player-facing displays. |
| attribute1 | int |  | |  | 0 ~ 2147483645 | Attribute 1<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. Up to 5 attributes are available for developers to define custom guild properties such as level, region, play style, or activity requirements. |
| attribute2 | int |  | |  | 0 ~ 2147483645 | Attribute 2<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| attribute3 | int |  | |  | 0 ~ 2147483645 | Attribute 3<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| attribute4 | int |  | |  | 0 ~ 2147483645 | Attribute 4<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| attribute5 | int |  | |  | 0 ~ 2147483645 | Attribute 5<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| metadata | string |  | |  |  ~ 1024 chars | Guild Metadata<br>Arbitrary data associated with the guild that does not affect GS2 behavior. Can be used to store game-specific information such as guild emblems, descriptions, recruitment messages, or other custom data. |
| memberMetadata | string |  | |  |  ~ 512 chars | Guild Member Metadata<br>Arbitrary data associated with this guild member that does not affect GS2 behavior. Can be used to store member-specific information such as contribution points, last login time, or notes visible to guild officers. |
| joinPolicy | string (enum)<br>enum {<br>"anybody",<br>"approval"<br>}<br> |  | ✓|  |  | Join Policy<br>Controls how users can join this guild. "anybody" allows any user to join immediately without approval. "approval" requires the guild master or authorized members to approve join requests before the user becomes a member. This can be changed by the guild master at any time."anybody": Anybody can join / "approval": Approval required /  |
| customRoles | [List&lt;RoleModel&gt;](#rolemodel) |  | | [] | 0 ~ 10 items | Custom Roles List<br>A list of guild-specific custom role definitions that override or extend the model-level roles. Each guild can define up to 10 custom roles with unique permission sets. These roles can be assigned to members in addition to the model-level roles. |
| guildMemberDefaultRole | string |  | |  |  ~ 128 chars | Default Custom Role<br>The custom role automatically assigned to new members when they join this specific guild. If set, overrides the guild model's guildMemberDefaultRole for this guild. Must reference a role defined in the customRoles list. |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild created |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.CreateGuildByUserId(
    &guild.CreateGuildByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        DisplayName: pointy.String("My Guild"),
        Attribute1: pointy.Int32(1),
        Attribute2: nil,
        Attribute3: nil,
        Attribute4: nil,
        Attribute5: nil,
        Metadata: nil,
        MemberMetadata: nil,
        JoinPolicy: pointy.String("anybody"),
        CustomRoles: nil,
        GuildMemberDefaultRole: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\CreateGuildByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->createGuildByUserId(
        (new CreateGuildByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withGuildModelName("guild-model-0001")
            ->withDisplayName("My Guild")
            ->withAttribute1(1)
            ->withAttribute2(null)
            ->withAttribute3(null)
            ->withAttribute4(null)
            ->withAttribute5(null)
            ->withMetadata(null)
            ->withMemberMetadata(null)
            ->withJoinPolicy("anybody")
            ->withCustomRoles(null)
            ->withGuildMemberDefaultRole(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.CreateGuildByUserIdRequest;
import io.gs2.guild.result.CreateGuildByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    CreateGuildByUserIdResult result = client.createGuildByUserId(
        new CreateGuildByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName("guild-model-0001")
            .withDisplayName("My Guild")
            .withAttribute1(1)
            .withAttribute2(null)
            .withAttribute3(null)
            .withAttribute4(null)
            .withAttribute5(null)
            .withMetadata(null)
            .withMemberMetadata(null)
            .withJoinPolicy("anybody")
            .withCustomRoles(null)
            .withGuildMemberDefaultRole(null)
            .withTimeOffsetToken(null)
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.CreateGuildByUserIdResult> asyncResult = null;
yield return client.CreateGuildByUserId(
    new Gs2.Gs2Guild.Request.CreateGuildByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithGuildModelName("guild-model-0001")
        .WithDisplayName("My Guild")
        .WithAttribute1(1)
        .WithAttribute2(null)
        .WithAttribute3(null)
        .WithAttribute4(null)
        .WithAttribute5(null)
        .WithMetadata(null)
        .WithMemberMetadata(null)
        .WithJoinPolicy("anybody")
        .WithCustomRoles(null)
        .WithGuildMemberDefaultRole(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.createGuildByUserId(
        new Gs2Guild.CreateGuildByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName("guild-model-0001")
            .withDisplayName("My Guild")
            .withAttribute1(1)
            .withAttribute2(null)
            .withAttribute3(null)
            .withAttribute4(null)
            .withAttribute5(null)
            .withMetadata(null)
            .withMemberMetadata(null)
            .withJoinPolicy("anybody")
            .withCustomRoles(null)
            .withGuildMemberDefaultRole(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.create_guild_by_user_id(
        guild.CreateGuildByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_guild_model_name('guild-model-0001')
            .with_display_name('My Guild')
            .with_attribute1(1)
            .with_attribute2(None)
            .with_attribute3(None)
            .with_attribute4(None)
            .with_attribute5(None)
            .with_metadata(None)
            .with_member_metadata(None)
            .with_join_policy('anybody')
            .with_custom_roles(None)
            .with_guild_member_default_role(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.create_guild_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName="guild-model-0001",
    displayName="My Guild",
    attribute1=1,
    attribute2=nil,
    attribute3=nil,
    attribute4=nil,
    attribute5=nil,
    metadata=nil,
    memberMetadata=nil,
    joinPolicy="anybody",
    customRoles=nil,
    guildMemberDefaultRole=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.create_guild_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName="guild-model-0001",
    displayName="My Guild",
    attribute1=1,
    attribute2=nil,
    attribute3=nil,
    attribute4=nil,
    attribute5=nil,
    metadata=nil,
    memberMetadata=nil,
    joinPolicy="anybody",
    customRoles=nil,
    guildMemberDefaultRole=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### getGuild

Get Guild

Retrieves the detailed information of a specific guild, including its members, custom attributes, join policy, and roles.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓| UUID |  ~ 36 chars | Guild Name<br>Maintains a unique name for each guild.<br>The name is automatically generated in UUID (Universally Unique Identifier) format and used to identify each guild. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.GetGuild(
    &guild.GetGuildRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\GetGuildRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->getGuild(
        (new GetGuildRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.GetGuildRequest;
import io.gs2.guild.result.GetGuildResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    GetGuildResult result = client.getGuild(
        new GetGuildRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.GetGuildResult> asyncResult = null;
yield return client.GetGuild(
    new Gs2.Gs2Guild.Request.GetGuildRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.getGuild(
        new Gs2Guild.GetGuildRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.get_guild(
        guild.GetGuildRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.get_guild({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.get_guild_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### getGuildByUserId

Get Guild by User ID

Retrieves the detailed information of a specific guild (server-side operation), including its members, custom attributes, join policy, and roles.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓| UUID |  ~ 36 chars | Guild Name<br>Maintains a unique name for each guild.<br>The name is automatically generated in UUID (Universally Unique Identifier) format and used to identify each guild. |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.GetGuildByUserId(
    &guild.GetGuildByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\GetGuildByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->getGuildByUserId(
        (new GetGuildByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.GetGuildByUserIdRequest;
import io.gs2.guild.result.GetGuildByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    GetGuildByUserIdResult result = client.getGuildByUserId(
        new GetGuildByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withTimeOffsetToken(null)
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.GetGuildByUserIdResult> asyncResult = null;
yield return client.GetGuildByUserId(
    new Gs2.Gs2Guild.Request.GetGuildByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.getGuildByUserId(
        new Gs2Guild.GetGuildByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.get_guild_by_user_id(
        guild.GetGuildByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.get_guild_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.get_guild_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### updateGuild

Update Guild

Updates the guild's configuration including display name, custom attributes (attribute1-5), metadata, join policy, custom roles, and default member role.
Executes the UpdateGuildScript callback with both the old and new guild data.
Sends a change notification to all guild members informing them of the update.
Please specify the access token of the guild user to Assume.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Guild Access Token<br>This is the token string obtained using `assume` (or `assumeByUserId`).<br>Permissions are determined by the `PolicyDocument` associated with the role of the member who called `assume`.<br>To update the guild, you need the `Gs2Guild:UpdateGuild` permission in that role's `PolicyDocument`. |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| displayName | string |  | ✓|  |  ~ 64 chars | Display Name<br>A human-readable name for the guild shown to players in the UI. Unlike the guild name (which is a system-generated UUID), the display name is set by the guild creator and can be updated. Used for guild search results, member lists, and other player-facing displays. |
| attribute1 | int |  | |  | 0 ~ 2147483645 | Attribute 1<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. Up to 5 attributes are available for developers to define custom guild properties such as level, region, play style, or activity requirements. |
| attribute2 | int |  | |  | 0 ~ 2147483645 | Attribute 2<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| attribute3 | int |  | |  | 0 ~ 2147483645 | Attribute 3<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| attribute4 | int |  | |  | 0 ~ 2147483645 | Attribute 4<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| attribute5 | int |  | |  | 0 ~ 2147483645 | Attribute 5<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| metadata | string |  | |  |  ~ 1024 chars | Guild Metadata<br>Arbitrary data associated with the guild that does not affect GS2 behavior. Can be used to store game-specific information such as guild emblems, descriptions, recruitment messages, or other custom data. |
| joinPolicy | string (enum)<br>enum {<br>"anybody",<br>"approval"<br>}<br> |  | ✓|  |  | Join Policy<br>Controls how users can join this guild. "anybody" allows any user to join immediately without approval. "approval" requires the guild master or authorized members to approve join requests before the user becomes a member. This can be changed by the guild master at any time."anybody": Anybody can join / "approval": Approval required /  |
| customRoles | [List&lt;RoleModel&gt;](#rolemodel) |  | | [] | 0 ~ 10 items | Custom Roles List<br>A list of guild-specific custom role definitions that override or extend the model-level roles. Each guild can define up to 10 custom roles with unique permission sets. These roles can be assigned to members in addition to the model-level roles. |
| guildMemberDefaultRole | string |  | |  |  ~ 128 chars | Default Custom Role<br>The custom role automatically assigned to new members when they join this specific guild. If set, overrides the guild model's guildMemberDefaultRole for this guild. Must reference a role defined in the customRoles list. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.UpdateGuild(
    &guild.UpdateGuildRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        DisplayName: pointy.String("My Guild"),
        Attribute1: pointy.Int32(1),
        Attribute2: nil,
        Attribute3: nil,
        Attribute4: nil,
        Attribute5: nil,
        Metadata: nil,
        JoinPolicy: pointy.String("anybody"),
        CustomRoles: nil,
        GuildMemberDefaultRole: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\UpdateGuildRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->updateGuild(
        (new UpdateGuildRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withGuildModelName("guild-model-0001")
            ->withDisplayName("My Guild")
            ->withAttribute1(1)
            ->withAttribute2(null)
            ->withAttribute3(null)
            ->withAttribute4(null)
            ->withAttribute5(null)
            ->withMetadata(null)
            ->withJoinPolicy("anybody")
            ->withCustomRoles(null)
            ->withGuildMemberDefaultRole(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.UpdateGuildRequest;
import io.gs2.guild.result.UpdateGuildResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    UpdateGuildResult result = client.updateGuild(
        new UpdateGuildRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-model-0001")
            .withDisplayName("My Guild")
            .withAttribute1(1)
            .withAttribute2(null)
            .withAttribute3(null)
            .withAttribute4(null)
            .withAttribute5(null)
            .withMetadata(null)
            .withJoinPolicy("anybody")
            .withCustomRoles(null)
            .withGuildMemberDefaultRole(null)
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.UpdateGuildResult> asyncResult = null;
yield return client.UpdateGuild(
    new Gs2.Gs2Guild.Request.UpdateGuildRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithGuildModelName("guild-model-0001")
        .WithDisplayName("My Guild")
        .WithAttribute1(1)
        .WithAttribute2(null)
        .WithAttribute3(null)
        .WithAttribute4(null)
        .WithAttribute5(null)
        .WithMetadata(null)
        .WithJoinPolicy("anybody")
        .WithCustomRoles(null)
        .WithGuildMemberDefaultRole(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.updateGuild(
        new Gs2Guild.UpdateGuildRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-model-0001")
            .withDisplayName("My Guild")
            .withAttribute1(1)
            .withAttribute2(null)
            .withAttribute3(null)
            .withAttribute4(null)
            .withAttribute5(null)
            .withMetadata(null)
            .withJoinPolicy("anybody")
            .withCustomRoles(null)
            .withGuildMemberDefaultRole(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.update_guild(
        guild.UpdateGuildRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_guild_model_name('guild-model-0001')
            .with_display_name('My Guild')
            .with_attribute1(1)
            .with_attribute2(None)
            .with_attribute3(None)
            .with_attribute4(None)
            .with_attribute5(None)
            .with_metadata(None)
            .with_join_policy('anybody')
            .with_custom_roles(None)
            .with_guild_member_default_role(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.update_guild({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-model-0001",
    displayName="My Guild",
    attribute1=1,
    attribute2=nil,
    attribute3=nil,
    attribute4=nil,
    attribute5=nil,
    metadata=nil,
    joinPolicy="anybody",
    customRoles=nil,
    guildMemberDefaultRole=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.update_guild_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-model-0001",
    displayName="My Guild",
    attribute1=1,
    attribute2=nil,
    attribute3=nil,
    attribute4=nil,
    attribute5=nil,
    metadata=nil,
    joinPolicy="anybody",
    customRoles=nil,
    guildMemberDefaultRole=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### updateGuildByGuildName

Update Guild by specifying a Guild name

Updates the specified guild's configuration (server-side operation).
The same UpdateGuildScript callback and member change notification apply as in the guild-user-facing version.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| displayName | string |  | ✓|  |  ~ 64 chars | Display Name<br>A human-readable name for the guild shown to players in the UI. Unlike the guild name (which is a system-generated UUID), the display name is set by the guild creator and can be updated. Used for guild search results, member lists, and other player-facing displays. |
| attribute1 | int |  | |  | 0 ~ 2147483645 | Attribute 1<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. Up to 5 attributes are available for developers to define custom guild properties such as level, region, play style, or activity requirements. |
| attribute2 | int |  | |  | 0 ~ 2147483645 | Attribute 2<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| attribute3 | int |  | |  | 0 ~ 2147483645 | Attribute 3<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| attribute4 | int |  | |  | 0 ~ 2147483645 | Attribute 4<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| attribute5 | int |  | |  | 0 ~ 2147483645 | Attribute 5<br>A numeric attribute for the guild that can be used for filtering and sorting in guild search. See attribute1 for details. |
| metadata | string |  | |  |  ~ 1024 chars | Guild Metadata<br>Arbitrary data associated with the guild that does not affect GS2 behavior. Can be used to store game-specific information such as guild emblems, descriptions, recruitment messages, or other custom data. |
| joinPolicy | string (enum)<br>enum {<br>"anybody",<br>"approval"<br>}<br> |  | ✓|  |  | Join Policy<br>Controls how users can join this guild. "anybody" allows any user to join immediately without approval. "approval" requires the guild master or authorized members to approve join requests before the user becomes a member. This can be changed by the guild master at any time."anybody": Anybody can join / "approval": Approval required /  |
| customRoles | [List&lt;RoleModel&gt;](#rolemodel) |  | | [] | 0 ~ 10 items | Custom Roles List<br>A list of guild-specific custom role definitions that override or extend the model-level roles. Each guild can define up to 10 custom roles with unique permission sets. These roles can be assigned to members in addition to the model-level roles. |
| guildMemberDefaultRole | string |  | |  |  ~ 128 chars | Default Custom Role<br>The custom role automatically assigned to new members when they join this specific guild. If set, overrides the guild model's guildMemberDefaultRole for this guild. Must reference a role defined in the customRoles list. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.UpdateGuildByGuildName(
    &guild.UpdateGuildByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildName: pointy.String("guild-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        DisplayName: pointy.String("My Guild"),
        Attribute1: pointy.Int32(1),
        Attribute2: nil,
        Attribute3: nil,
        Attribute4: nil,
        Attribute5: nil,
        Metadata: nil,
        JoinPolicy: pointy.String("anybody"),
        CustomRoles: nil,
        GuildMemberDefaultRole: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\UpdateGuildByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->updateGuildByGuildName(
        (new UpdateGuildByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildName("guild-0001")
            ->withGuildModelName("guild-model-0001")
            ->withDisplayName("My Guild")
            ->withAttribute1(1)
            ->withAttribute2(null)
            ->withAttribute3(null)
            ->withAttribute4(null)
            ->withAttribute5(null)
            ->withMetadata(null)
            ->withJoinPolicy("anybody")
            ->withCustomRoles(null)
            ->withGuildMemberDefaultRole(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.UpdateGuildByGuildNameRequest;
import io.gs2.guild.result.UpdateGuildByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    UpdateGuildByGuildNameResult result = client.updateGuildByGuildName(
        new UpdateGuildByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildName("guild-0001")
            .withGuildModelName("guild-model-0001")
            .withDisplayName("My Guild")
            .withAttribute1(1)
            .withAttribute2(null)
            .withAttribute3(null)
            .withAttribute4(null)
            .withAttribute5(null)
            .withMetadata(null)
            .withJoinPolicy("anybody")
            .withCustomRoles(null)
            .withGuildMemberDefaultRole(null)
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.UpdateGuildByGuildNameResult> asyncResult = null;
yield return client.UpdateGuildByGuildName(
    new Gs2.Gs2Guild.Request.UpdateGuildByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildName("guild-0001")
        .WithGuildModelName("guild-model-0001")
        .WithDisplayName("My Guild")
        .WithAttribute1(1)
        .WithAttribute2(null)
        .WithAttribute3(null)
        .WithAttribute4(null)
        .WithAttribute5(null)
        .WithMetadata(null)
        .WithJoinPolicy("anybody")
        .WithCustomRoles(null)
        .WithGuildMemberDefaultRole(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.updateGuildByGuildName(
        new Gs2Guild.UpdateGuildByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildName("guild-0001")
            .withGuildModelName("guild-model-0001")
            .withDisplayName("My Guild")
            .withAttribute1(1)
            .withAttribute2(null)
            .withAttribute3(null)
            .withAttribute4(null)
            .withAttribute5(null)
            .withMetadata(null)
            .withJoinPolicy("anybody")
            .withCustomRoles(null)
            .withGuildMemberDefaultRole(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.update_guild_by_guild_name(
        guild.UpdateGuildByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_name('guild-0001')
            .with_guild_model_name('guild-model-0001')
            .with_display_name('My Guild')
            .with_attribute1(1)
            .with_attribute2(None)
            .with_attribute3(None)
            .with_attribute4(None)
            .with_attribute5(None)
            .with_metadata(None)
            .with_join_policy('anybody')
            .with_custom_roles(None)
            .with_guild_member_default_role(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.update_guild_by_guild_name({
    namespaceName="namespace-0001",
    guildName="guild-0001",
    guildModelName="guild-model-0001",
    displayName="My Guild",
    attribute1=1,
    attribute2=nil,
    attribute3=nil,
    attribute4=nil,
    attribute5=nil,
    metadata=nil,
    joinPolicy="anybody",
    customRoles=nil,
    guildMemberDefaultRole=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.update_guild_by_guild_name_async({
    namespaceName="namespace-0001",
    guildName="guild-0001",
    guildModelName="guild-model-0001",
    displayName="My Guild",
    attribute1=1,
    attribute2=nil,
    attribute3=nil,
    attribute4=nil,
    attribute5=nil,
    metadata=nil,
    joinPolicy="anybody",
    customRoles=nil,
    guildMemberDefaultRole=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### deleteMember

Expel member

Removes the specified user from the guild's member list.
Before removal, validates that the guild will still have at least one guild master after the expulsion; if the target user is the last guild master, the operation is rejected with a GuildMasterRequired error.
Please specify the access token as the access token assumed by the guild user.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Guild Access Token<br>This is the token string obtained using `assume` (or `assumeByUserId`).<br>Permissions are determined by the `PolicyDocument` associated with the role of the member who called `assume`.<br>To expel a member, you need the `Gs2Guild:DeleteMember` permission in that role's `PolicyDocument`. |
| targetUserId | string |  | ✓|  |  ~ 128 chars | User ID to be expelled |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DeleteMember(
    &guild.DeleteMemberRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        TargetUserId: pointy.String("user-0002"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DeleteMemberRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->deleteMember(
        (new DeleteMemberRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withAccessToken("accessToken-0001")
            ->withTargetUserId("user-0002")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DeleteMemberRequest;
import io.gs2.guild.result.DeleteMemberResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DeleteMemberResult result = client.deleteMember(
        new DeleteMemberRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DeleteMemberResult> asyncResult = null;
yield return client.DeleteMember(
    new Gs2.Gs2Guild.Request.DeleteMemberRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithAccessToken("accessToken-0001")
        .WithTargetUserId("user-0002"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.deleteMember(
        new Gs2Guild.DeleteMemberRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.delete_member(
        guild.DeleteMemberRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_access_token('accessToken-0001')
            .with_target_user_id('user-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.delete_member({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.delete_member_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### deleteMemberByGuildName

Expel member by specifying a Guild name

Removes the specified user from the specified guild's member list (server-side operation).
The same guild master count validation (GuildMasterRequired) applies as in the guild-user-facing version.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |
| targetUserId | string |  | ✓|  |  ~ 128 chars | User ID to be expelled |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DeleteMemberByGuildName(
    &guild.DeleteMemberByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
        TargetUserId: pointy.String("user-0002"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DeleteMemberByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->deleteMemberByGuildName(
        (new DeleteMemberByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
            ->withTargetUserId("user-0002")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DeleteMemberByGuildNameRequest;
import io.gs2.guild.result.DeleteMemberByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DeleteMemberByGuildNameResult result = client.deleteMemberByGuildName(
        new DeleteMemberByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withTargetUserId("user-0002")
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DeleteMemberByGuildNameResult> asyncResult = null;
yield return client.DeleteMemberByGuildName(
    new Gs2.Gs2Guild.Request.DeleteMemberByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001")
        .WithTargetUserId("user-0002"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.deleteMemberByGuildName(
        new Gs2Guild.DeleteMemberByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withTargetUserId("user-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.delete_member_by_guild_name(
        guild.DeleteMemberByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
            .with_target_user_id('user-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.delete_member_by_guild_name({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    targetUserId="user-0002",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.delete_member_by_guild_name_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    targetUserId="user-0002",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### updateMemberRole

Update member role

Changes the role of a specific guild member to the specified role name.
Validates that the target user is a member of the guild before updating.
The member's role update timestamp is also refreshed.
Please specify the access token as the access token assumed by the guild user.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Guild Access Token<br>This is the token string obtained using `assume` (or `assumeByUserId`).<br>Permissions are determined by the `PolicyDocument` associated with the role of the member who called `assume`.<br>To update a member's role, you need the `Gs2Guild:UpdateMemberRole` permission in that role's `PolicyDocument`. |
| targetUserId | string |  | ✓|  |  ~ 128 chars | User ID to be updated |
| roleName | string |  | ✓|  |  ~ 128 chars | Role Model name<br>Unique Role Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.UpdateMemberRole(
    &guild.UpdateMemberRoleRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        TargetUserId: pointy.String("user-0002"),
        RoleName: pointy.String("role-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\UpdateMemberRoleRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->updateMemberRole(
        (new UpdateMemberRoleRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withAccessToken("accessToken-0001")
            ->withTargetUserId("user-0002")
            ->withRoleName("role-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.UpdateMemberRoleRequest;
import io.gs2.guild.result.UpdateMemberRoleResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    UpdateMemberRoleResult result = client.updateMemberRole(
        new UpdateMemberRoleRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
            .withRoleName("role-0001")
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.UpdateMemberRoleResult> asyncResult = null;
yield return client.UpdateMemberRole(
    new Gs2.Gs2Guild.Request.UpdateMemberRoleRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithAccessToken("accessToken-0001")
        .WithTargetUserId("user-0002")
        .WithRoleName("role-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.updateMemberRole(
        new Gs2Guild.UpdateMemberRoleRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
            .withRoleName("role-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.update_member_role(
        guild.UpdateMemberRoleRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_access_token('accessToken-0001')
            .with_target_user_id('user-0002')
            .with_role_name('role-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.update_member_role({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
    roleName="role-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.update_member_role_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
    roleName="role-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### updateMemberRoleByGuildName

Update member role by specifying a Guild name

Changes the role of a specific guild member in the specified guild (server-side operation).
The same member validation and timestamp update apply as in the guild-user-facing version.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |
| targetUserId | string |  | ✓|  |  ~ 128 chars | User ID to be updated |
| roleName | string |  | ✓|  |  ~ 128 chars | Role Model name<br>Unique Role Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.UpdateMemberRoleByGuildName(
    &guild.UpdateMemberRoleByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
        TargetUserId: pointy.String("user-0002"),
        RoleName: pointy.String("role-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\UpdateMemberRoleByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->updateMemberRoleByGuildName(
        (new UpdateMemberRoleByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
            ->withTargetUserId("user-0002")
            ->withRoleName("role-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.UpdateMemberRoleByGuildNameRequest;
import io.gs2.guild.result.UpdateMemberRoleByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    UpdateMemberRoleByGuildNameResult result = client.updateMemberRoleByGuildName(
        new UpdateMemberRoleByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withTargetUserId("user-0002")
            .withRoleName("role-0001")
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.UpdateMemberRoleByGuildNameResult> asyncResult = null;
yield return client.UpdateMemberRoleByGuildName(
    new Gs2.Gs2Guild.Request.UpdateMemberRoleByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001")
        .WithTargetUserId("user-0002")
        .WithRoleName("role-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.updateMemberRoleByGuildName(
        new Gs2Guild.UpdateMemberRoleByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withTargetUserId("user-0002")
            .withRoleName("role-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.update_member_role_by_guild_name(
        guild.UpdateMemberRoleByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
            .with_target_user_id('user-0002')
            .with_role_name('role-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.update_member_role_by_guild_name({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    targetUserId="user-0002",
    roleName="role-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.update_member_role_by_guild_name_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    targetUserId="user-0002",
    roleName="role-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### batchUpdateMemberRole

Update member role in bulk

Updates the roles of multiple guild members in a single operation.
Only the members specified in the request are updated; members not included in the list retain their current roles.
Please specify the access token as the access token assumed by the guild user.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Guild Access Token<br>This is the token string obtained using `assume` (or `assumeByUserId`).<br>Permissions are determined by the `PolicyDocument` associated with the role of the member who called `assume`.<br>To make changes, you need the `Gs2Guild:BatchUpdateMemberRole` permission in that role's `PolicyDocument`. |
| members | [List&lt;Member&gt;](#member) |  | ✓|  | 1 ~ 100 items | List of members to update |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.BatchUpdateMemberRole(
    &guild.BatchUpdateMemberRoleRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Members: []guild.Member{
            guild.Member{
                UserId: pointy.String("user-0002"),
                RoleName: pointy.String("role-0001"),
            },
            guild.Member{
                UserId: pointy.String("user-0003"),
                RoleName: pointy.String("role-0002"),
            },
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\BatchUpdateMemberRoleRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->batchUpdateMemberRole(
        (new BatchUpdateMemberRoleRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withAccessToken("accessToken-0001")
            ->withMembers([
                (new Member())
                    ->withUserId("user-0002")
                    ->withRoleName("role-0001"),
                (new Member())
                    ->withUserId("user-0003")
                    ->withRoleName("role-0002"),
            ])
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.BatchUpdateMemberRoleRequest;
import io.gs2.guild.result.BatchUpdateMemberRoleResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    BatchUpdateMemberRoleResult result = client.batchUpdateMemberRole(
        new BatchUpdateMemberRoleRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken("accessToken-0001")
            .withMembers(Arrays.asList(
                new Member()
                    .withUserId("user-0002")
                    .withRoleName("role-0001"),
                new Member()
                    .withUserId("user-0003")
                    .withRoleName("role-0002")
            ))
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.BatchUpdateMemberRoleResult> asyncResult = null;
yield return client.BatchUpdateMemberRole(
    new Gs2.Gs2Guild.Request.BatchUpdateMemberRoleRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithAccessToken("accessToken-0001")
        .WithMembers(new Gs2.Gs2Guild.Model.Member[] {
            new Gs2.Gs2Guild.Model.Member()
                .WithUserId("user-0002")
                .WithRoleName("role-0001"),
            new Gs2.Gs2Guild.Model.Member()
                .WithUserId("user-0003")
                .WithRoleName("role-0002"),
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.batchUpdateMemberRole(
        new Gs2Guild.BatchUpdateMemberRoleRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken("accessToken-0001")
            .withMembers([
                new Gs2Guild.model.Member()
                    .withUserId("user-0002")
                    .withRoleName("role-0001"),
                new Gs2Guild.model.Member()
                    .withUserId("user-0003")
                    .withRoleName("role-0002"),
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.batch_update_member_role(
        guild.BatchUpdateMemberRoleRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_access_token('accessToken-0001')
            .with_members([
                guild.Member()
                    .with_user_id('user-0002')
                    .with_role_name('role-0001'),
                guild.Member()
                    .with_user_id('user-0003')
                    .with_role_name('role-0002'),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.batch_update_member_role({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken="accessToken-0001",
    members={
        {
            user_id="user-0002",
            role_name="role-0001",
        },
        {
            user_id="user-0003",
            role_name="role-0002",
        }
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.batch_update_member_role_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken="accessToken-0001",
    members={
        {
            user_id="user-0002",
            role_name="role-0001",
        },
        {
            user_id="user-0003",
            role_name="role-0002",
        }
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### batchUpdateMemberRoleByGuildName

Update member role in bulk by specifying a Guild name

Updates the roles of multiple guild members in the specified guild in a single operation (server-side operation).
Only the members specified in the request are updated; members not included retain their current roles.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |
| members | [List&lt;Member&gt;](#member) |  | ✓|  | 1 ~ 100 items | List of members to update |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.BatchUpdateMemberRoleByGuildName(
    &guild.BatchUpdateMemberRoleByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
        Members: []guild.Member{
            guild.Member{
                UserId: pointy.String("user-0002"),
                RoleName: pointy.String("role-0001"),
            },
            guild.Member{
                UserId: pointy.String("user-0003"),
                RoleName: pointy.String("role-0002"),
            },
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\BatchUpdateMemberRoleByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->batchUpdateMemberRoleByGuildName(
        (new BatchUpdateMemberRoleByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
            ->withMembers([
                (new Member())
                    ->withUserId("user-0002")
                    ->withRoleName("role-0001"),
                (new Member())
                    ->withUserId("user-0003")
                    ->withRoleName("role-0002"),
            ])
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.BatchUpdateMemberRoleByGuildNameRequest;
import io.gs2.guild.result.BatchUpdateMemberRoleByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    BatchUpdateMemberRoleByGuildNameResult result = client.batchUpdateMemberRoleByGuildName(
        new BatchUpdateMemberRoleByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withMembers(Arrays.asList(
                new Member()
                    .withUserId("user-0002")
                    .withRoleName("role-0001"),
                new Member()
                    .withUserId("user-0003")
                    .withRoleName("role-0002")
            ))
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.BatchUpdateMemberRoleByGuildNameResult> asyncResult = null;
yield return client.BatchUpdateMemberRoleByGuildName(
    new Gs2.Gs2Guild.Request.BatchUpdateMemberRoleByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001")
        .WithMembers(new Gs2.Gs2Guild.Model.Member[] {
            new Gs2.Gs2Guild.Model.Member()
                .WithUserId("user-0002")
                .WithRoleName("role-0001"),
            new Gs2.Gs2Guild.Model.Member()
                .WithUserId("user-0003")
                .WithRoleName("role-0002"),
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.batchUpdateMemberRoleByGuildName(
        new Gs2Guild.BatchUpdateMemberRoleByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withMembers([
                new Gs2Guild.model.Member()
                    .withUserId("user-0002")
                    .withRoleName("role-0001"),
                new Gs2Guild.model.Member()
                    .withUserId("user-0003")
                    .withRoleName("role-0002"),
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.batch_update_member_role_by_guild_name(
        guild.BatchUpdateMemberRoleByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
            .with_members([
                guild.Member()
                    .with_user_id('user-0002')
                    .with_role_name('role-0001'),
                guild.Member()
                    .with_user_id('user-0003')
                    .with_role_name('role-0002'),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.batch_update_member_role_by_guild_name({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    members={
        {
            user_id="user-0002",
            role_name="role-0001",
        },
        {
            user_id="user-0003",
            role_name="role-0002",
        }
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.batch_update_member_role_by_guild_name_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    members={
        {
            user_id="user-0002",
            role_name="role-0001",
        },
        {
            user_id="user-0003",
            role_name="role-0002",
        }
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### deleteGuild

Delete Guild

Deletes the guild and all associated data.
All guild members are removed, with each member's LeaveGuildScript callback executed and LeaveNotification sent.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Guild Access Token<br>This is the token string obtained using `assume` (or `assumeByUserId`).<br>Permissions are determined by the `PolicyDocument` associated with the role of the member who called `assume`.<br>To delete the guild, you need the `Gs2Guild:DeleteGuild` permission in that role's `PolicyDocument`. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild deleted |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DeleteGuild(
    &guild.DeleteGuildRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DeleteGuildRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->deleteGuild(
        (new DeleteGuildRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withAccessToken("accessToken-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DeleteGuildRequest;
import io.gs2.guild.result.DeleteGuildResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DeleteGuildResult result = client.deleteGuild(
        new DeleteGuildRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken("accessToken-0001")
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DeleteGuildResult> asyncResult = null;
yield return client.DeleteGuild(
    new Gs2.Gs2Guild.Request.DeleteGuildRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.deleteGuild(
        new Gs2Guild.DeleteGuildRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.delete_guild(
        guild.DeleteGuildRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_access_token('accessToken-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.delete_guild({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken="accessToken-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.delete_guild_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken="accessToken-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### deleteGuildByGuildName

Delete Guild by specifying a Guild name

Deletes the specified guild and all associated data (server-side operation).
The same LeaveGuildScript callbacks and LeaveNotifications apply as in the guild-user-facing version.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild deleted |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DeleteGuildByGuildName(
    &guild.DeleteGuildByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DeleteGuildByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->deleteGuildByGuildName(
        (new DeleteGuildByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DeleteGuildByGuildNameRequest;
import io.gs2.guild.result.DeleteGuildByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DeleteGuildByGuildNameResult result = client.deleteGuildByGuildName(
        new DeleteGuildByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DeleteGuildByGuildNameResult> asyncResult = null;
yield return client.DeleteGuildByGuildName(
    new Gs2.Gs2Guild.Request.DeleteGuildByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.deleteGuildByGuildName(
        new Gs2Guild.DeleteGuildByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.delete_guild_by_guild_name(
        guild.DeleteGuildByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.delete_guild_by_guild_name({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.delete_guild_by_guild_name_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### increaseMaximumCurrentMaximumMemberCountByGuildName

Add the maximum number of members by specifying a Guild name

Increases the guild's currentMaximumMemberCount by the specified value.
The resulting value must not exceed the maximumMemberCount defined in the guild model.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |
| value | int |  | |  | 1 ~ 2147483646 | Increase the maximum number of members |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.IncreaseMaximumCurrentMaximumMemberCountByGuildName(
    &guild.IncreaseMaximumCurrentMaximumMemberCountByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
        Value: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\IncreaseMaximumCurrentMaximumMemberCountByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->increaseMaximumCurrentMaximumMemberCountByGuildName(
        (new IncreaseMaximumCurrentMaximumMemberCountByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
            ->withValue(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.IncreaseMaximumCurrentMaximumMemberCountByGuildNameRequest;
import io.gs2.guild.result.IncreaseMaximumCurrentMaximumMemberCountByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    IncreaseMaximumCurrentMaximumMemberCountByGuildNameResult result = client.increaseMaximumCurrentMaximumMemberCountByGuildName(
        new IncreaseMaximumCurrentMaximumMemberCountByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withValue(null)
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.IncreaseMaximumCurrentMaximumMemberCountByGuildNameResult> asyncResult = null;
yield return client.IncreaseMaximumCurrentMaximumMemberCountByGuildName(
    new Gs2.Gs2Guild.Request.IncreaseMaximumCurrentMaximumMemberCountByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001")
        .WithValue(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.increaseMaximumCurrentMaximumMemberCountByGuildName(
        new Gs2Guild.IncreaseMaximumCurrentMaximumMemberCountByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withValue(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.increase_maximum_current_maximum_member_count_by_guild_name(
        guild.IncreaseMaximumCurrentMaximumMemberCountByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
            .with_value(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.increase_maximum_current_maximum_member_count_by_guild_name({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    value=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.increase_maximum_current_maximum_member_count_by_guild_name_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    value=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### decreaseMaximumCurrentMaximumMemberCount

Decrease the maximum number of members

Decreases the guild's currentMaximumMemberCount by the specified value.
The resulting value cannot go below zero.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Guild Access Token<br>This is the token string obtained using `assume` (or `assumeByUserId`).<br>Permissions are determined by the `PolicyDocument` associated with the role of the member who called `assume`.<br>To decrease the value, you need the `Gs2Guild:DecreaseCurrentMaximumMemberCount` permission in that role's `PolicyDocument`. |
| value | int |  | |  | 1 ~ 2147483646 | Increase the maximum number of members |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DecreaseMaximumCurrentMaximumMemberCount(
    &guild.DecreaseMaximumCurrentMaximumMemberCountRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Value: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DecreaseMaximumCurrentMaximumMemberCountRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->decreaseMaximumCurrentMaximumMemberCount(
        (new DecreaseMaximumCurrentMaximumMemberCountRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withAccessToken("accessToken-0001")
            ->withValue(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DecreaseMaximumCurrentMaximumMemberCountRequest;
import io.gs2.guild.result.DecreaseMaximumCurrentMaximumMemberCountResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DecreaseMaximumCurrentMaximumMemberCountResult result = client.decreaseMaximumCurrentMaximumMemberCount(
        new DecreaseMaximumCurrentMaximumMemberCountRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken("accessToken-0001")
            .withValue(null)
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DecreaseMaximumCurrentMaximumMemberCountResult> asyncResult = null;
yield return client.DecreaseMaximumCurrentMaximumMemberCount(
    new Gs2.Gs2Guild.Request.DecreaseMaximumCurrentMaximumMemberCountRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithAccessToken("accessToken-0001")
        .WithValue(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.decreaseMaximumCurrentMaximumMemberCount(
        new Gs2Guild.DecreaseMaximumCurrentMaximumMemberCountRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken("accessToken-0001")
            .withValue(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.decrease_maximum_current_maximum_member_count(
        guild.DecreaseMaximumCurrentMaximumMemberCountRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_access_token('accessToken-0001')
            .with_value(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.decrease_maximum_current_maximum_member_count({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken="accessToken-0001",
    value=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.decrease_maximum_current_maximum_member_count_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken="accessToken-0001",
    value=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### decreaseMaximumCurrentMaximumMemberCountByGuildName

Decrease the maximum number of members by specifying a Guild name

Decreases the specified guild's currentMaximumMemberCount by the specified value (server-side operation).
The resulting value cannot go below zero.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |
| value | int |  | |  | 1 ~ 2147483646 | Increase the maximum number of members |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DecreaseMaximumCurrentMaximumMemberCountByGuildName(
    &guild.DecreaseMaximumCurrentMaximumMemberCountByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
        Value: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DecreaseMaximumCurrentMaximumMemberCountByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->decreaseMaximumCurrentMaximumMemberCountByGuildName(
        (new DecreaseMaximumCurrentMaximumMemberCountByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
            ->withValue(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DecreaseMaximumCurrentMaximumMemberCountByGuildNameRequest;
import io.gs2.guild.result.DecreaseMaximumCurrentMaximumMemberCountByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DecreaseMaximumCurrentMaximumMemberCountByGuildNameResult result = client.decreaseMaximumCurrentMaximumMemberCountByGuildName(
        new DecreaseMaximumCurrentMaximumMemberCountByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withValue(null)
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DecreaseMaximumCurrentMaximumMemberCountByGuildNameResult> asyncResult = null;
yield return client.DecreaseMaximumCurrentMaximumMemberCountByGuildName(
    new Gs2.Gs2Guild.Request.DecreaseMaximumCurrentMaximumMemberCountByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001")
        .WithValue(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.decreaseMaximumCurrentMaximumMemberCountByGuildName(
        new Gs2Guild.DecreaseMaximumCurrentMaximumMemberCountByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withValue(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.decrease_maximum_current_maximum_member_count_by_guild_name(
        guild.DecreaseMaximumCurrentMaximumMemberCountByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
            .with_value(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.decrease_maximum_current_maximum_member_count_by_guild_name({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    value=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.decrease_maximum_current_maximum_member_count_by_guild_name_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    value=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### verifyCurrentMaximumMemberCount

Verify the maximum number of guild members

Verifies the guild's currentMaximumMemberCount against the specified value using the chosen comparison operator.
Supported operators: less, lessEqual, greater, greaterEqual, equal, notEqual.
If the verification fails, an error is returned. This is useful for conditional logic in transactions.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Guild Access Token<br>This is the token string obtained using `assume` (or `assumeByUserId`).<br>Permissions are determined by the `PolicyDocument` associated with the role of the member who called `assume`.<br>To verify, you need the `Gs2Guild:VerifyCurrentMaximumMemberCount` permission in that role's `PolicyDocument`. |
| verifyType | string (enum)<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | Type of verification"less": The maximum number of guild members is less than the specified value / "lessEqual": The maximum number of guild members is less than or equal to the specified value / "greater": The maximum number of guild members is greater than the specified value / "greaterEqual": The maximum number of guild members is greater than or equal to the specified value / "equal": The maximum number of guild members is equal to the specified value / "notEqual": The maximum number of guild members is not equal to the specified value /  |
| value | int |  | |  | 1 ~ 2147483646 | Maximum number of guild members |
| multiplyValueSpecifyingQuantity | bool |  | | false |  | Whether to multiply the value used for verification when specifying the quantity |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.VerifyCurrentMaximumMemberCount(
    &guild.VerifyCurrentMaximumMemberCountRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        AccessToken: ,
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\VerifyCurrentMaximumMemberCountRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->verifyCurrentMaximumMemberCount(
        (new VerifyCurrentMaximumMemberCountRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withAccessToken()
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.VerifyCurrentMaximumMemberCountRequest;
import io.gs2.guild.result.VerifyCurrentMaximumMemberCountResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    VerifyCurrentMaximumMemberCountResult result = client.verifyCurrentMaximumMemberCount(
        new VerifyCurrentMaximumMemberCountRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken()
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.VerifyCurrentMaximumMemberCountResult> asyncResult = null;
yield return client.VerifyCurrentMaximumMemberCount(
    new Gs2.Gs2Guild.Request.VerifyCurrentMaximumMemberCountRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithAccessToken()
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.verifyCurrentMaximumMemberCount(
        new Gs2Guild.VerifyCurrentMaximumMemberCountRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken()
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.verify_current_maximum_member_count(
        guild.VerifyCurrentMaximumMemberCountRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_access_token()
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.verify_current_maximum_member_count({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken=,
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.verify_current_maximum_member_count_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken=,
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### verifyCurrentMaximumMemberCountByGuildName

Verify the maximum number of guild members by specifying a Guild name

Verifies the specified guild's currentMaximumMemberCount against the specified value using the chosen comparison operator (server-side operation).
Supported operators: less, lessEqual, greater, greaterEqual, equal, notEqual.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |
| verifyType | string (enum)<br>enum {<br>"less",<br>"lessEqual",<br>"greater",<br>"greaterEqual",<br>"equal",<br>"notEqual"<br>}<br> |  | ✓|  |  | Type of verification"less": The maximum number of guild members is less than the specified value / "lessEqual": The maximum number of guild members is less than or equal to the specified value / "greater": The maximum number of guild members is greater than the specified value / "greaterEqual": The maximum number of guild members is greater than or equal to the specified value / "equal": The maximum number of guild members is equal to the specified value / "notEqual": The maximum number of guild members is not equal to the specified value /  |
| value | int |  | |  | 1 ~ 2147483646 | Maximum number of guild members |
| multiplyValueSpecifyingQuantity | bool |  | | false |  | Whether to multiply the value used for verification when specifying the quantity |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.VerifyCurrentMaximumMemberCountByGuildName(
    &guild.VerifyCurrentMaximumMemberCountByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
        VerifyType: pointy.String("less"),
        Value: pointy.Int32(10),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\VerifyCurrentMaximumMemberCountByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->verifyCurrentMaximumMemberCountByGuildName(
        (new VerifyCurrentMaximumMemberCountByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
            ->withVerifyType("less")
            ->withValue(10)
            ->withMultiplyValueSpecifyingQuantity(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.VerifyCurrentMaximumMemberCountByGuildNameRequest;
import io.gs2.guild.result.VerifyCurrentMaximumMemberCountByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    VerifyCurrentMaximumMemberCountByGuildNameResult result = client.verifyCurrentMaximumMemberCountByGuildName(
        new VerifyCurrentMaximumMemberCountByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.VerifyCurrentMaximumMemberCountByGuildNameResult> asyncResult = null;
yield return client.VerifyCurrentMaximumMemberCountByGuildName(
    new Gs2.Gs2Guild.Request.VerifyCurrentMaximumMemberCountByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001")
        .WithVerifyType("less")
        .WithValue(10)
        .WithMultiplyValueSpecifyingQuantity(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.verifyCurrentMaximumMemberCountByGuildName(
        new Gs2Guild.VerifyCurrentMaximumMemberCountByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withVerifyType("less")
            .withValue(10)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.verify_current_maximum_member_count_by_guild_name(
        guild.VerifyCurrentMaximumMemberCountByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
            .with_verify_type('less')
            .with_value(10)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.verify_current_maximum_member_count_by_guild_name({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.verify_current_maximum_member_count_by_guild_name_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    verifyType="less",
    value=10,
    multiplyValueSpecifyingQuantity=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### verifyIncludeMember

Verify if guild members include user ID

Verifies whether the specified user is or is not a member of the guild.
Supports two verification types: 'include' checks that the user is a guild member, 'notInclude' checks that the user is not a guild member.
If the verification fails, an error is returned.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓| UUID |  ~ 36 chars | Guild Name<br>Maintains a unique name for each guild.<br>The name is automatically generated in UUID (Universally Unique Identifier) format and used to identify each guild. |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |
| verifyType | string (enum)<br>enum {<br>"include",<br>"notInclude"<br>}<br> |  | ✓|  |  | Type of verification"include": Guild members include the specified user / "notInclude": Guild members do not include the specified user /  |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.VerifyIncludeMember(
    &guild.VerifyIncludeMemberRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        VerifyType: pointy.String("include"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\VerifyIncludeMemberRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->verifyIncludeMember(
        (new VerifyIncludeMemberRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
            ->withAccessToken("accessToken-0001")
            ->withVerifyType("include")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.VerifyIncludeMemberRequest;
import io.gs2.guild.result.VerifyIncludeMemberResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    VerifyIncludeMemberResult result = client.verifyIncludeMember(
        new VerifyIncludeMemberRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withAccessToken("accessToken-0001")
            .withVerifyType("include")
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.VerifyIncludeMemberResult> asyncResult = null;
yield return client.VerifyIncludeMember(
    new Gs2.Gs2Guild.Request.VerifyIncludeMemberRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001")
        .WithAccessToken("accessToken-0001")
        .WithVerifyType("include"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.verifyIncludeMember(
        new Gs2Guild.VerifyIncludeMemberRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withAccessToken("accessToken-0001")
            .withVerifyType("include")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.verify_include_member(
        guild.VerifyIncludeMemberRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
            .with_access_token('accessToken-0001')
            .with_verify_type('include')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.verify_include_member({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    accessToken="accessToken-0001",
    verifyType="include",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.verify_include_member_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    accessToken="accessToken-0001",
    verifyType="include",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### verifyIncludeMemberByUserId

Verify if guild members include user ID by User ID

Verifies whether the specified user is or is not a member of the guild (server-side operation).
Supports two verification types: 'include' and 'notInclude'.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓| UUID |  ~ 36 chars | Guild Name<br>Maintains a unique name for each guild.<br>The name is automatically generated in UUID (Universally Unique Identifier) format and used to identify each guild. |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| verifyType | string (enum)<br>enum {<br>"include",<br>"notInclude"<br>}<br> |  | ✓|  |  | Type of verification"include": Guild members include the specified user / "notInclude": Guild members do not include the specified user /  |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.VerifyIncludeMemberByUserId(
    &guild.VerifyIncludeMemberByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
        UserId: pointy.String("user-0001"),
        VerifyType: pointy.String("include"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\VerifyIncludeMemberByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->verifyIncludeMemberByUserId(
        (new VerifyIncludeMemberByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
            ->withUserId("user-0001")
            ->withVerifyType("include")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.VerifyIncludeMemberByUserIdRequest;
import io.gs2.guild.result.VerifyIncludeMemberByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    VerifyIncludeMemberByUserIdResult result = client.verifyIncludeMemberByUserId(
        new VerifyIncludeMemberByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withUserId("user-0001")
            .withVerifyType("include")
            .withTimeOffsetToken(null)
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.VerifyIncludeMemberByUserIdResult> asyncResult = null;
yield return client.VerifyIncludeMemberByUserId(
    new Gs2.Gs2Guild.Request.VerifyIncludeMemberByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001")
        .WithUserId("user-0001")
        .WithVerifyType("include")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.verifyIncludeMemberByUserId(
        new Gs2Guild.VerifyIncludeMemberByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withUserId("user-0001")
            .withVerifyType("include")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.verify_include_member_by_user_id(
        guild.VerifyIncludeMemberByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
            .with_user_id('user-0001')
            .with_verify_type('include')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.verify_include_member_by_user_id({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    userId="user-0001",
    verifyType="include",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.verify_include_member_by_user_id_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    userId="user-0001",
    verifyType="include",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### setMaximumCurrentMaximumMemberCountByGuildName

Set the maximum number of guild members by specifying a Guild name

Sets the guild's currentMaximumMemberCount to the specified absolute value.
Unlike increase/decrease operations, this directly sets the value rather than applying a delta.
Returns both the updated guild and the guild state before the update, allowing the caller to track the change.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| value | int |  | |  | 1 ~ 2147483646 | Set the maximum number of members |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild updated |
| old | [Guild](#guild) | Guild before update |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.SetMaximumCurrentMaximumMemberCountByGuildName(
    &guild.SetMaximumCurrentMaximumMemberCountByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildName: pointy.String("guild-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        Value: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
old := result.Old

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\SetMaximumCurrentMaximumMemberCountByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->setMaximumCurrentMaximumMemberCountByGuildName(
        (new SetMaximumCurrentMaximumMemberCountByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildName("guild-0001")
            ->withGuildModelName("guild-model-0001")
            ->withValue(null)
    );
    $item = $result->getItem();
    $old = $result->getOld();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.SetMaximumCurrentMaximumMemberCountByGuildNameRequest;
import io.gs2.guild.result.SetMaximumCurrentMaximumMemberCountByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    SetMaximumCurrentMaximumMemberCountByGuildNameResult result = client.setMaximumCurrentMaximumMemberCountByGuildName(
        new SetMaximumCurrentMaximumMemberCountByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildName("guild-0001")
            .withGuildModelName("guild-model-0001")
            .withValue(null)
    );
    Guild item = result.getItem();
    Guild old = result.getOld();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.SetMaximumCurrentMaximumMemberCountByGuildNameResult> asyncResult = null;
yield return client.SetMaximumCurrentMaximumMemberCountByGuildName(
    new Gs2.Gs2Guild.Request.SetMaximumCurrentMaximumMemberCountByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildName("guild-0001")
        .WithGuildModelName("guild-model-0001")
        .WithValue(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var old = result.Old;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.setMaximumCurrentMaximumMemberCountByGuildName(
        new Gs2Guild.SetMaximumCurrentMaximumMemberCountByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildName("guild-0001")
            .withGuildModelName("guild-model-0001")
            .withValue(null)
    );
    const item = result.getItem();
    const old = result.getOld();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.set_maximum_current_maximum_member_count_by_guild_name(
        guild.SetMaximumCurrentMaximumMemberCountByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_name('guild-0001')
            .with_guild_model_name('guild-model-0001')
            .with_value(None)
    )
    item = result.item
    old = result.old
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.set_maximum_current_maximum_member_count_by_guild_name({
    namespaceName="namespace-0001",
    guildName="guild-0001",
    guildModelName="guild-model-0001",
    value=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
old = result.old;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.set_maximum_current_maximum_member_count_by_guild_name_async({
    namespaceName="namespace-0001",
    guildName="guild-0001",
    guildModelName="guild-model-0001",
    value=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
old = result.old;

```



---

### assume

Get an access token to act as a guild user

Issues an access token that allows the requesting user to perform operations as the guild entity.
This token is required for guild management operations such as updating guild settings, managing members, accepting/rejecting join requests, and managing the ignore list.
The requesting user must be a member of the guild; otherwise, a NotIncludedGuildMember error is returned.
The response includes the access token, the guild's user ID, and the token's expiration timestamp.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓| UUID |  ~ 36 chars | Guild Name<br>Maintains a unique name for each guild.<br>The name is automatically generated in UUID (Universally Unique Identifier) format and used to identify each guild. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| token | string | Guild Access Token |
| userId | string | User ID |
| expire | long | Expiration time<br>A timestamp indicating the expiration time of the token. When this date is reached, the token becomes invalid.<br>Unix time, milliseconds |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.Assume(
    &guild.AssumeRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
token := result.Token
userId := result.UserId
expire := result.Expire

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\AssumeRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->assume(
        (new AssumeRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
    );
    $token = $result->getToken();
    $userId = $result->getUserId();
    $expire = $result->getExpire();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.AssumeRequest;
import io.gs2.guild.result.AssumeResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    AssumeResult result = client.assume(
        new AssumeRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
    );
    String token = result.getToken();
    String userId = result.getUserId();
    long expire = result.getExpire();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.AssumeResult> asyncResult = null;
yield return client.Assume(
    new Gs2.Gs2Guild.Request.AssumeRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var token = result.Token;
var userId = result.UserId;
var expire = result.Expire;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.assume(
        new Gs2Guild.AssumeRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
    );
    const token = result.getToken();
    const userId = result.getUserId();
    const expire = result.getExpire();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.assume(
        guild.AssumeRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
    )
    token = result.token
    user_id = result.user_id
    expire = result.expire
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.assume({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
token = result.token;
userId = result.userId;
expire = result.expire;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.assume_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
token = result.token;
userId = result.userId;
expire = result.expire;

```



---

### assumeByUserId

Get an access token to act as a guild user by specifying the user ID

Issues an access token that allows the specified user to perform operations as the guild entity (server-side operation).
The specified user must be a member of the guild; otherwise, a NotIncludedGuildMember error is returned.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓| UUID |  ~ 36 chars | Guild Name<br>Maintains a unique name for each guild.<br>The name is automatically generated in UUID (Universally Unique Identifier) format and used to identify each guild. |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| token | string | Guild Access Token |
| userId | string | User ID |
| expire | long | Expiration time<br>A timestamp indicating the expiration time of the token. When this date is reached, the token becomes invalid.<br>Unix time, milliseconds |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.AssumeByUserId(
    &guild.AssumeByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
token := result.Token
userId := result.UserId
expire := result.Expire

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\AssumeByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->assumeByUserId(
        (new AssumeByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
            ->withTimeOffsetToken(null)
    );
    $token = $result->getToken();
    $userId = $result->getUserId();
    $expire = $result->getExpire();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.AssumeByUserIdRequest;
import io.gs2.guild.result.AssumeByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    AssumeByUserIdResult result = client.assumeByUserId(
        new AssumeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withTimeOffsetToken(null)
    );
    String token = result.getToken();
    String userId = result.getUserId();
    long expire = result.getExpire();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.AssumeByUserIdResult> asyncResult = null;
yield return client.AssumeByUserId(
    new Gs2.Gs2Guild.Request.AssumeByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var token = result.Token;
var userId = result.UserId;
var expire = result.Expire;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.assumeByUserId(
        new Gs2Guild.AssumeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withTimeOffsetToken(null)
    );
    const token = result.getToken();
    const userId = result.getUserId();
    const expire = result.getExpire();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.assume_by_user_id(
        guild.AssumeByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
            .with_time_offset_token(None)
    )
    token = result.token
    user_id = result.user_id
    expire = result.expire
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.assume_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
token = result.token;
userId = result.userId;
expire = result.expire;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.assume_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
token = result.token;
userId = result.userId;
expire = result.expire;

```



---

### describeJoinedGuilds

List joined Guilds

Retrieves a paginated list of guilds that the requesting user is currently a member of.
An optional guild model name filter can be specified to retrieve joined guilds for a specific guild model only.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |
| guildModelName | string |  | |  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| pageToken | string |  | |  |  ~ 1024 chars | Token specifying the position from which to start acquiring data |
| limit | int |  | | 30 | 1 ~ 1000 | Number of data items to retrieve |

#### Result

|  | Type | Description |
| --- | --- | --- |
| items | [List&lt;JoinedGuild&gt;](#joinedguild) | Joining guild |
| nextPageToken | string | Page token to retrieve the rest of the listing |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DescribeJoinedGuilds(
    &guild.DescribeJoinedGuildsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DescribeJoinedGuildsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->describeJoinedGuilds(
        (new DescribeJoinedGuildsRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withGuildModelName("guild-model-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DescribeJoinedGuildsRequest;
import io.gs2.guild.result.DescribeJoinedGuildsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DescribeJoinedGuildsResult result = client.describeJoinedGuilds(
        new DescribeJoinedGuildsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-model-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<JoinedGuild> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DescribeJoinedGuildsResult> asyncResult = null;
yield return client.DescribeJoinedGuilds(
    new Gs2.Gs2Guild.Request.DescribeJoinedGuildsRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithGuildModelName("guild-model-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.describeJoinedGuilds(
        new Gs2Guild.DescribeJoinedGuildsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-model-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.describe_joined_guilds(
        guild.DescribeJoinedGuildsRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_guild_model_name('guild-model-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.describe_joined_guilds({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-model-0001",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.describe_joined_guilds_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-model-0001",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```



---

### describeJoinedGuildsByUserId

List joined Guilds by User ID

Retrieves a paginated list of guilds that the specified user is currently a member of (server-side operation).
An optional guild model name filter can be specified to retrieve joined guilds for a specific guild model only.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| guildModelName | string |  | |  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| pageToken | string |  | |  |  ~ 1024 chars | Token specifying the position from which to start acquiring data |
| limit | int |  | | 30 | 1 ~ 1000 | Number of data items to retrieve |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| items | [List&lt;JoinedGuild&gt;](#joinedguild) | Joining guild |
| nextPageToken | string | Page token to retrieve the rest of the listing |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DescribeJoinedGuildsByUserId(
    &guild.DescribeJoinedGuildsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DescribeJoinedGuildsByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->describeJoinedGuildsByUserId(
        (new DescribeJoinedGuildsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withGuildModelName("guild-model-0001")
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DescribeJoinedGuildsByUserIdRequest;
import io.gs2.guild.result.DescribeJoinedGuildsByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DescribeJoinedGuildsByUserIdResult result = client.describeJoinedGuildsByUserId(
        new DescribeJoinedGuildsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName("guild-model-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<JoinedGuild> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DescribeJoinedGuildsByUserIdResult> asyncResult = null;
yield return client.DescribeJoinedGuildsByUserId(
    new Gs2.Gs2Guild.Request.DescribeJoinedGuildsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithGuildModelName("guild-model-0001")
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.describeJoinedGuildsByUserId(
        new Gs2Guild.DescribeJoinedGuildsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName("guild-model-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.describe_joined_guilds_by_user_id(
        guild.DescribeJoinedGuildsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_guild_model_name('guild-model-0001')
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.describe_joined_guilds_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName="guild-model-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.describe_joined_guilds_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName="guild-model-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```



---

### getJoinedGuild

Get Joining Guild

Retrieves the membership information for a specific guild that the requesting user has joined, identified by guild model name and guild name.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓| UUID |  ~ 36 chars | Guild Name<br>Maintains a unique name for each guild.<br>The name is automatically generated in UUID (Universally Unique Identifier) format and used to identify each guild. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [JoinedGuild](#joinedguild) | Joining guild |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.GetJoinedGuild(
    &guild.GetJoinedGuildRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\GetJoinedGuildRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->getJoinedGuild(
        (new GetJoinedGuildRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.GetJoinedGuildRequest;
import io.gs2.guild.result.GetJoinedGuildResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    GetJoinedGuildResult result = client.getJoinedGuild(
        new GetJoinedGuildRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
    );
    JoinedGuild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.GetJoinedGuildResult> asyncResult = null;
yield return client.GetJoinedGuild(
    new Gs2.Gs2Guild.Request.GetJoinedGuildRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.getJoinedGuild(
        new Gs2Guild.GetJoinedGuildRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.get_joined_guild(
        guild.GetJoinedGuildRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.get_joined_guild({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.get_joined_guild_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### getJoinedGuildByUserId

Get Joining Guild by User ID

Retrieves the membership information for a specific guild that the specified user has joined (server-side operation).


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓| UUID |  ~ 36 chars | Guild Name<br>Maintains a unique name for each guild.<br>The name is automatically generated in UUID (Universally Unique Identifier) format and used to identify each guild. |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [JoinedGuild](#joinedguild) | Joining guild |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.GetJoinedGuildByUserId(
    &guild.GetJoinedGuildByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\GetJoinedGuildByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->getJoinedGuildByUserId(
        (new GetJoinedGuildByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.GetJoinedGuildByUserIdRequest;
import io.gs2.guild.result.GetJoinedGuildByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    GetJoinedGuildByUserIdResult result = client.getJoinedGuildByUserId(
        new GetJoinedGuildByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withTimeOffsetToken(null)
    );
    JoinedGuild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.GetJoinedGuildByUserIdResult> asyncResult = null;
yield return client.GetJoinedGuildByUserId(
    new Gs2.Gs2Guild.Request.GetJoinedGuildByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.getJoinedGuildByUserId(
        new Gs2Guild.GetJoinedGuildByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.get_joined_guild_by_user_id(
        guild.GetJoinedGuildByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.get_joined_guild_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.get_joined_guild_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### updateMemberMetadata

Update member metadata

Updates the metadata of the requesting user's membership within the specified guild.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓| UUID |  ~ 36 chars | Guild Name<br>Maintains a unique name for each guild.<br>The name is automatically generated in UUID (Universally Unique Identifier) format and used to identify each guild. |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |
| metadata | string |  | |  |  ~ 512 chars | Guild Member Metadata<br>Arbitrary data associated with this guild member that does not affect GS2 behavior. Can be used to store member-specific information such as contribution points, last login time, or notes visible to guild officers. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.UpdateMemberMetadata(
    &guild.UpdateMemberMetadataRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Metadata: pointy.String("metadata-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\UpdateMemberMetadataRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->updateMemberMetadata(
        (new UpdateMemberMetadataRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
            ->withAccessToken("accessToken-0001")
            ->withMetadata("metadata-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.UpdateMemberMetadataRequest;
import io.gs2.guild.result.UpdateMemberMetadataResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    UpdateMemberMetadataResult result = client.updateMemberMetadata(
        new UpdateMemberMetadataRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withAccessToken("accessToken-0001")
            .withMetadata("metadata-0001")
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.UpdateMemberMetadataResult> asyncResult = null;
yield return client.UpdateMemberMetadata(
    new Gs2.Gs2Guild.Request.UpdateMemberMetadataRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001")
        .WithAccessToken("accessToken-0001")
        .WithMetadata("metadata-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.updateMemberMetadata(
        new Gs2Guild.UpdateMemberMetadataRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withAccessToken("accessToken-0001")
            .withMetadata("metadata-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.update_member_metadata(
        guild.UpdateMemberMetadataRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
            .with_access_token('accessToken-0001')
            .with_metadata('metadata-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.update_member_metadata({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    accessToken="accessToken-0001",
    metadata="metadata-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.update_member_metadata_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    accessToken="accessToken-0001",
    metadata="metadata-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### updateMemberMetadataByUserId

Update member metadata by User ID

Updates the metadata of the specified user's membership within the specified guild (server-side operation).


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓| UUID |  ~ 36 chars | Guild Name<br>Maintains a unique name for each guild.<br>The name is automatically generated in UUID (Universally Unique Identifier) format and used to identify each guild. |
| userId | string |  | ✓|  |  ~ 128 chars | User ID to be updated |
| metadata | string |  | |  |  ~ 512 chars | Guild Member Metadata<br>Arbitrary data associated with this guild member that does not affect GS2 behavior. Can be used to store member-specific information such as contribution points, last login time, or notes visible to guild officers. |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Guild updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.UpdateMemberMetadataByUserId(
    &guild.UpdateMemberMetadataByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
        UserId: pointy.String("user-0001"),
        Metadata: pointy.String("metadata-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\UpdateMemberMetadataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->updateMemberMetadataByUserId(
        (new UpdateMemberMetadataByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
            ->withUserId("user-0001")
            ->withMetadata("metadata-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.UpdateMemberMetadataByUserIdRequest;
import io.gs2.guild.result.UpdateMemberMetadataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    UpdateMemberMetadataByUserIdResult result = client.updateMemberMetadataByUserId(
        new UpdateMemberMetadataByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withUserId("user-0001")
            .withMetadata("metadata-0001")
            .withTimeOffsetToken(null)
    );
    Guild item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.UpdateMemberMetadataByUserIdResult> asyncResult = null;
yield return client.UpdateMemberMetadataByUserId(
    new Gs2.Gs2Guild.Request.UpdateMemberMetadataByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001")
        .WithUserId("user-0001")
        .WithMetadata("metadata-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.updateMemberMetadataByUserId(
        new Gs2Guild.UpdateMemberMetadataByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withUserId("user-0001")
            .withMetadata("metadata-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.update_member_metadata_by_user_id(
        guild.UpdateMemberMetadataByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
            .with_user_id('user-0001')
            .with_metadata('metadata-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.update_member_metadata_by_user_id({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    userId="user-0001",
    metadata="metadata-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.update_member_metadata_by_user_id_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    userId="user-0001",
    metadata="metadata-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### withdrawal

Withdrawal from the Guild

The requesting user leaves the specified guild.
If a rejoin cooldown (rejoinCoolTimeMinutes) is configured in the guild model, the user cannot rejoin the same guild until the cooldown period has elapsed.
If the user is the only guild master, the withdrawal is rejected with a GuildMasterRequired error to prevent leaving the guild without a leader.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓| UUID |  ~ 36 chars | Guild Name<br>Maintains a unique name for each guild.<br>The name is automatically generated in UUID (Universally Unique Identifier) format and used to identify each guild. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [JoinedGuild](#joinedguild) | Guild that withdrew |
| guild | [Guild](#guild) | Guild |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.Withdrawal(
    &guild.WithdrawalRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
guild := result.Guild

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\WithdrawalRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->withdrawal(
        (new WithdrawalRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
    );
    $item = $result->getItem();
    $guild = $result->getGuild();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.WithdrawalRequest;
import io.gs2.guild.result.WithdrawalResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    WithdrawalResult result = client.withdrawal(
        new WithdrawalRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
    );
    JoinedGuild item = result.getItem();
    Guild guild = result.getGuild();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.WithdrawalResult> asyncResult = null;
yield return client.Withdrawal(
    new Gs2.Gs2Guild.Request.WithdrawalRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var guild = result.Guild;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.withdrawal(
        new Gs2Guild.WithdrawalRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
    );
    const item = result.getItem();
    const guild = result.getGuild();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.withdrawal(
        guild.WithdrawalRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
    )
    item = result.item
    guild = result.guild
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.withdrawal({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.withdrawal_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```



---

### withdrawalByUserId

Withdrawal from the Guild by specifying the user ID

The specified user leaves the specified guild (server-side operation).
The same rejoin cooldown and guild master validation apply as in the user-facing version.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓| UUID |  ~ 36 chars | Guild Name<br>Maintains a unique name for each guild.<br>The name is automatically generated in UUID (Universally Unique Identifier) format and used to identify each guild. |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [JoinedGuild](#joinedguild) | Guild that withdrew |
| guild | [Guild](#guild) | Guild |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.WithdrawalByUserId(
    &guild.WithdrawalByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
guild := result.Guild

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\WithdrawalByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->withdrawalByUserId(
        (new WithdrawalByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $guild = $result->getGuild();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.WithdrawalByUserIdRequest;
import io.gs2.guild.result.WithdrawalByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    WithdrawalByUserIdResult result = client.withdrawalByUserId(
        new WithdrawalByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withTimeOffsetToken(null)
    );
    JoinedGuild item = result.getItem();
    Guild guild = result.getGuild();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.WithdrawalByUserIdResult> asyncResult = null;
yield return client.WithdrawalByUserId(
    new Gs2.Gs2Guild.Request.WithdrawalByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var guild = result.Guild;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.withdrawalByUserId(
        new Gs2Guild.WithdrawalByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const guild = result.getGuild();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.withdrawal_by_user_id(
        guild.WithdrawalByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
            .with_time_offset_token(None)
    )
    item = result.item
    guild = result.guild
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.withdrawal_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.withdrawal_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```



---

### getLastGuildMasterActivity

Get last activity date and time of guild master

Retrieves the timestamp of the last activity performed by the guild master.
This information is used to determine whether the guild master has been inactive long enough for automatic succession via PromoteSeniorMember.
The inactivity threshold is calculated based on the inactivityPeriodDays setting in the guild model.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Guild Access Token<br>This is the token string obtained using `assume` (or `assumeByUserId`).<br>Permissions are determined by the `PolicyDocument` associated with the role of the member who called `assume`.<br>To retrieve, you need the `Gs2Guild:GetLastGuildMasterActivity` permission in that role's `PolicyDocument`. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [LastGuildMasterActivity](#lastguildmasteractivity) | Last Guild Master Activity |
| guild | [Guild](#guild) | Guild |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.GetLastGuildMasterActivity(
    &guild.GetLastGuildMasterActivityRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        AccessToken: ,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
guild := result.Guild

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\GetLastGuildMasterActivityRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->getLastGuildMasterActivity(
        (new GetLastGuildMasterActivityRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withAccessToken()
    );
    $item = $result->getItem();
    $guild = $result->getGuild();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.GetLastGuildMasterActivityRequest;
import io.gs2.guild.result.GetLastGuildMasterActivityResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    GetLastGuildMasterActivityResult result = client.getLastGuildMasterActivity(
        new GetLastGuildMasterActivityRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken()
    );
    LastGuildMasterActivity item = result.getItem();
    Guild guild = result.getGuild();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.GetLastGuildMasterActivityResult> asyncResult = null;
yield return client.GetLastGuildMasterActivity(
    new Gs2.Gs2Guild.Request.GetLastGuildMasterActivityRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithAccessToken(),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var guild = result.Guild;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.getLastGuildMasterActivity(
        new Gs2Guild.GetLastGuildMasterActivityRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken()
    );
    const item = result.getItem();
    const guild = result.getGuild();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.get_last_guild_master_activity(
        guild.GetLastGuildMasterActivityRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_access_token()
    )
    item = result.item
    guild = result.guild
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.get_last_guild_master_activity({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken=,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.get_last_guild_master_activity_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken=,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```



---

### getLastGuildMasterActivityByGuildName

Get last activity date and time of guild master by specifying a Guild name

Retrieves the timestamp of the last activity performed by the guild master for the specified guild (server-side operation).
This information is used to determine whether the guild master has been inactive long enough for automatic succession.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [LastGuildMasterActivity](#lastguildmasteractivity) | Last Guild Master Activity |
| guild | [Guild](#guild) | Guild |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.GetLastGuildMasterActivityByGuildName(
    &guild.GetLastGuildMasterActivityByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
guild := result.Guild

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\GetLastGuildMasterActivityByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->getLastGuildMasterActivityByGuildName(
        (new GetLastGuildMasterActivityByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
    );
    $item = $result->getItem();
    $guild = $result->getGuild();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.GetLastGuildMasterActivityByGuildNameRequest;
import io.gs2.guild.result.GetLastGuildMasterActivityByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    GetLastGuildMasterActivityByGuildNameResult result = client.getLastGuildMasterActivityByGuildName(
        new GetLastGuildMasterActivityByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
    );
    LastGuildMasterActivity item = result.getItem();
    Guild guild = result.getGuild();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.GetLastGuildMasterActivityByGuildNameResult> asyncResult = null;
yield return client.GetLastGuildMasterActivityByGuildName(
    new Gs2.Gs2Guild.Request.GetLastGuildMasterActivityByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var guild = result.Guild;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.getLastGuildMasterActivityByGuildName(
        new Gs2Guild.GetLastGuildMasterActivityByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
    );
    const item = result.getItem();
    const guild = result.getGuild();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.get_last_guild_master_activity_by_guild_name(
        guild.GetLastGuildMasterActivityByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
    )
    item = result.item
    guild = result.guild
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.get_last_guild_master_activity_by_guild_name({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.get_last_guild_master_activity_by_guild_name_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```



---

### promoteSeniorMember

Promote the most senior guild member to guild master if the guild master has not logged in for a certain period of time

Checks whether the guild master has been inactive longer than the inactivityPeriodDays threshold (calculated as 24 hours x inactivityPeriodDays).
If the condition is met, the longest-serving non-master member (determined by JoinedAt timestamp) is promoted to the guild master role.
When maxConcurrentGuildMasterCount is 1, the inactive guild master is demoted to the default member role before the promotion occurs.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Guild Access Token<br>This is the token string obtained using `assume` (or `assumeByUserId`).<br>Permissions are determined by the `PolicyDocument` associated with the role of the member who called `assume`.<br>To promote, you need the `Gs2Guild:PromoteSeniorMember` permission in that role's `PolicyDocument`. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [LastGuildMasterActivity](#lastguildmasteractivity) | Last Guild Master Activity |
| guild | [Guild](#guild) | Guild |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.PromoteSeniorMember(
    &guild.PromoteSeniorMemberRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        AccessToken: ,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
guild := result.Guild

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\PromoteSeniorMemberRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->promoteSeniorMember(
        (new PromoteSeniorMemberRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withAccessToken()
    );
    $item = $result->getItem();
    $guild = $result->getGuild();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.PromoteSeniorMemberRequest;
import io.gs2.guild.result.PromoteSeniorMemberResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    PromoteSeniorMemberResult result = client.promoteSeniorMember(
        new PromoteSeniorMemberRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken()
    );
    LastGuildMasterActivity item = result.getItem();
    Guild guild = result.getGuild();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.PromoteSeniorMemberResult> asyncResult = null;
yield return client.PromoteSeniorMember(
    new Gs2.Gs2Guild.Request.PromoteSeniorMemberRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithAccessToken(),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var guild = result.Guild;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.promoteSeniorMember(
        new Gs2Guild.PromoteSeniorMemberRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken()
    );
    const item = result.getItem();
    const guild = result.getGuild();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.promote_senior_member(
        guild.PromoteSeniorMemberRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_access_token()
    )
    item = result.item
    guild = result.guild
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.promote_senior_member({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken=,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.promote_senior_member_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken=,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```



---

### promoteSeniorMemberByGuildName

Replace an inactive guild master with the longest-serving member by guild name

Checks whether the guild master of the specified guild has been inactive longer than the inactivityPeriodDays threshold (server-side operation).
If the condition is met, the longest-serving non-master member (determined by JoinedAt timestamp) is promoted to the guild master role.
When maxConcurrentGuildMasterCount is 1, the inactive guild master is demoted to the default member role before the promotion occurs.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [LastGuildMasterActivity](#lastguildmasteractivity) | Last Guild Master Activity |
| guild | [Guild](#guild) | Guild |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.PromoteSeniorMemberByGuildName(
    &guild.PromoteSeniorMemberByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        GuildName: pointy.String("guild-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
guild := result.Guild

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\PromoteSeniorMemberByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->promoteSeniorMemberByGuildName(
        (new PromoteSeniorMemberByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withGuildName("guild-0001")
    );
    $item = $result->getItem();
    $guild = $result->getGuild();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.PromoteSeniorMemberByGuildNameRequest;
import io.gs2.guild.result.PromoteSeniorMemberByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    PromoteSeniorMemberByGuildNameResult result = client.promoteSeniorMemberByGuildName(
        new PromoteSeniorMemberByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
    );
    LastGuildMasterActivity item = result.getItem();
    Guild guild = result.getGuild();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.PromoteSeniorMemberByGuildNameResult> asyncResult = null;
yield return client.PromoteSeniorMemberByGuildName(
    new Gs2.Gs2Guild.Request.PromoteSeniorMemberByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithGuildName("guild-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var guild = result.Guild;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.promoteSeniorMemberByGuildName(
        new Gs2Guild.PromoteSeniorMemberByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withGuildName("guild-0001")
    );
    const item = result.getItem();
    const guild = result.getGuild();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.promote_senior_member_by_guild_name(
        guild.PromoteSeniorMemberByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_guild_name('guild-0001')
    )
    item = result.item
    guild = result.guild
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.promote_senior_member_by_guild_name({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.promote_senior_member_by_guild_name_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    guildName="guild-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```



---

### describeReceiveRequests

List Received Join Requests

Retrieves a paginated list of join requests that have been sent to the guild and are awaiting approval.
Requires the access token of the assumed guild user.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Guild Access Token<br>This is the token string obtained using `assume` (or `assumeByUserId`).<br>Permissions are determined by the `PolicyDocument` associated with the role of the member who called `assume`.<br>To retrieve the list, you need the `Gs2Guild:DescribeReceiveRequests` permission in that role's `PolicyDocument`. |
| pageToken | string |  | |  |  ~ 1024 chars | Token specifying the position from which to start acquiring data |
| limit | int |  | | 30 | 1 ~ 1000 | Number of data items to retrieve |

#### Result

|  | Type | Description |
| --- | --- | --- |
| items | [List&lt;ReceiveMemberRequest&gt;](#receivememberrequest) | List of join request |
| nextPageToken | string | Page token to retrieve the rest of the listing |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DescribeReceiveRequests(
    &guild.DescribeReceiveRequestsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DescribeReceiveRequestsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->describeReceiveRequests(
        (new DescribeReceiveRequestsRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-0001")
            ->withAccessToken("accessToken-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DescribeReceiveRequestsRequest;
import io.gs2.guild.result.DescribeReceiveRequestsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DescribeReceiveRequestsResult result = client.describeReceiveRequests(
        new DescribeReceiveRequestsRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<ReceiveMemberRequest> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DescribeReceiveRequestsResult> asyncResult = null;
yield return client.DescribeReceiveRequests(
    new Gs2.Gs2Guild.Request.DescribeReceiveRequestsRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-0001")
        .WithAccessToken("accessToken-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.describeReceiveRequests(
        new Gs2Guild.DescribeReceiveRequestsRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.describe_receive_requests(
        guild.DescribeReceiveRequestsRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-0001')
            .with_access_token('accessToken-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.describe_receive_requests({
    namespaceName="namespace-0001",
    guildModelName="guild-0001",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.describe_receive_requests_async({
    namespaceName="namespace-0001",
    guildModelName="guild-0001",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```



---

### describeReceiveRequestsByGuildName

List Received Join Requests by specifying a Guild name

Retrieves a paginated list of join requests that have been sent to the specified guild and are awaiting approval (server-side operation).


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |
| pageToken | string |  | |  |  ~ 1024 chars | Token specifying the position from which to start acquiring data |
| limit | int |  | | 30 | 1 ~ 1000 | Number of data items to retrieve |

#### Result

|  | Type | Description |
| --- | --- | --- |
| items | [List&lt;ReceiveMemberRequest&gt;](#receivememberrequest) | List of join request |
| nextPageToken | string | Page token to retrieve the rest of the listing |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DescribeReceiveRequestsByGuildName(
    &guild.DescribeReceiveRequestsByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: nil,
        GuildName: pointy.String("guild-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DescribeReceiveRequestsByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->describeReceiveRequestsByGuildName(
        (new DescribeReceiveRequestsByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName(null)
            ->withGuildName("guild-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DescribeReceiveRequestsByGuildNameRequest;
import io.gs2.guild.result.DescribeReceiveRequestsByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DescribeReceiveRequestsByGuildNameResult result = client.describeReceiveRequestsByGuildName(
        new DescribeReceiveRequestsByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName(null)
            .withGuildName("guild-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<ReceiveMemberRequest> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DescribeReceiveRequestsByGuildNameResult> asyncResult = null;
yield return client.DescribeReceiveRequestsByGuildName(
    new Gs2.Gs2Guild.Request.DescribeReceiveRequestsByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName(null)
        .WithGuildName("guild-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.describeReceiveRequestsByGuildName(
        new Gs2Guild.DescribeReceiveRequestsByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName(null)
            .withGuildName("guild-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.describe_receive_requests_by_guild_name(
        guild.DescribeReceiveRequestsByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name(None)
            .with_guild_name('guild-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.describe_receive_requests_by_guild_name({
    namespaceName="namespace-0001",
    guildModelName=nil,
    guildName="guild-0001",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.describe_receive_requests_by_guild_name_async({
    namespaceName="namespace-0001",
    guildModelName=nil,
    guildName="guild-0001",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```



---

### getReceiveRequest

Get Received Join Request

Retrieves a specific join request received by the guild from the specified user.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Guild Access Token<br>This is the token string obtained using `assume` (or `assumeByUserId`).<br>Permissions are determined by the `PolicyDocument` associated with the role of the member who called `assume`.<br>To retrieve, you need the `Gs2Guild:GetReceiveRequest` permission in that role's `PolicyDocument`. |
| fromUserId | string |  | ✓|  |  ~ 128 chars | User ID |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [ReceiveMemberRequest](#receivememberrequest) | Join request |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.GetReceiveRequest(
    &guild.GetReceiveRequestRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        FromUserId: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\GetReceiveRequestRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->getReceiveRequest(
        (new GetReceiveRequestRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-0001")
            ->withAccessToken("accessToken-0001")
            ->withFromUserId(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.GetReceiveRequestRequest;
import io.gs2.guild.result.GetReceiveRequestResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    GetReceiveRequestResult result = client.getReceiveRequest(
        new GetReceiveRequestRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-0001")
            .withAccessToken("accessToken-0001")
            .withFromUserId(null)
    );
    ReceiveMemberRequest item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.GetReceiveRequestResult> asyncResult = null;
yield return client.GetReceiveRequest(
    new Gs2.Gs2Guild.Request.GetReceiveRequestRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-0001")
        .WithAccessToken("accessToken-0001")
        .WithFromUserId(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.getReceiveRequest(
        new Gs2Guild.GetReceiveRequestRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-0001")
            .withAccessToken("accessToken-0001")
            .withFromUserId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.get_receive_request(
        guild.GetReceiveRequestRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-0001')
            .with_access_token('accessToken-0001')
            .with_from_user_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.get_receive_request({
    namespaceName="namespace-0001",
    guildModelName="guild-0001",
    accessToken="accessToken-0001",
    fromUserId=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.get_receive_request_async({
    namespaceName="namespace-0001",
    guildModelName="guild-0001",
    accessToken="accessToken-0001",
    fromUserId=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### getReceiveRequestByGuildName

Get Received Join Request by specifying a Guild name

Retrieves a specific join request received by the specified guild from the specified user (server-side operation).


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |
| fromUserId | string |  | ✓|  |  ~ 128 chars | User ID |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [ReceiveMemberRequest](#receivememberrequest) | Join request |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.GetReceiveRequestByGuildName(
    &guild.GetReceiveRequestByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: nil,
        GuildName: pointy.String("guild-0001"),
        FromUserId: pointy.String("user-0002"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\GetReceiveRequestByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->getReceiveRequestByGuildName(
        (new GetReceiveRequestByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName(null)
            ->withGuildName("guild-0001")
            ->withFromUserId("user-0002")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.GetReceiveRequestByGuildNameRequest;
import io.gs2.guild.result.GetReceiveRequestByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    GetReceiveRequestByGuildNameResult result = client.getReceiveRequestByGuildName(
        new GetReceiveRequestByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName(null)
            .withGuildName("guild-0001")
            .withFromUserId("user-0002")
    );
    ReceiveMemberRequest item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.GetReceiveRequestByGuildNameResult> asyncResult = null;
yield return client.GetReceiveRequestByGuildName(
    new Gs2.Gs2Guild.Request.GetReceiveRequestByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName(null)
        .WithGuildName("guild-0001")
        .WithFromUserId("user-0002"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.getReceiveRequestByGuildName(
        new Gs2Guild.GetReceiveRequestByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName(null)
            .withGuildName("guild-0001")
            .withFromUserId("user-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.get_receive_request_by_guild_name(
        guild.GetReceiveRequestByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name(None)
            .with_guild_name('guild-0001')
            .with_from_user_id('user-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.get_receive_request_by_guild_name({
    namespaceName="namespace-0001",
    guildModelName=nil,
    guildName="guild-0001",
    fromUserId="user-0002",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.get_receive_request_by_guild_name_async({
    namespaceName="namespace-0001",
    guildModelName=nil,
    guildName="guild-0001",
    fromUserId="user-0002",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### acceptRequest

Accept join request

Accepts a pending join request, adding the requesting user as a guild member.
The user is assigned the guild's default member role, and their member metadata from the original request is preserved.
The request is removed from both the guild's inbox and the sender's send box.
Validates that the user's maxConcurrentJoinGuilds limit is not exceeded and the guild's maximum member count is not reached.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Guild Access Token<br>This is the token string obtained using `assume` (or `assumeByUserId`).<br>Permissions are determined by the `PolicyDocument` associated with the role of the member who called `assume`.<br>To accept, you need the `Gs2Guild:AcceptRequest` permission in that role's `PolicyDocument`. |
| fromUserId | string |  | ✓|  |  ~ 128 chars | User ID |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [ReceiveMemberRequest](#receivememberrequest) | Accepted join request |
| guild | [Guild](#guild) | Guild |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.AcceptRequest(
    &guild.AcceptRequestRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        FromUserId: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
guild := result.Guild

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\AcceptRequestRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->acceptRequest(
        (new AcceptRequestRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-0001")
            ->withAccessToken("accessToken-0001")
            ->withFromUserId(null)
    );
    $item = $result->getItem();
    $guild = $result->getGuild();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.AcceptRequestRequest;
import io.gs2.guild.result.AcceptRequestResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    AcceptRequestResult result = client.acceptRequest(
        new AcceptRequestRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-0001")
            .withAccessToken("accessToken-0001")
            .withFromUserId(null)
    );
    ReceiveMemberRequest item = result.getItem();
    Guild guild = result.getGuild();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.AcceptRequestResult> asyncResult = null;
yield return client.AcceptRequest(
    new Gs2.Gs2Guild.Request.AcceptRequestRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-0001")
        .WithAccessToken("accessToken-0001")
        .WithFromUserId(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var guild = result.Guild;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.acceptRequest(
        new Gs2Guild.AcceptRequestRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-0001")
            .withAccessToken("accessToken-0001")
            .withFromUserId(null)
    );
    const item = result.getItem();
    const guild = result.getGuild();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.accept_request(
        guild.AcceptRequestRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-0001')
            .with_access_token('accessToken-0001')
            .with_from_user_id(None)
    )
    item = result.item
    guild = result.guild
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.accept_request({
    namespaceName="namespace-0001",
    guildModelName="guild-0001",
    accessToken="accessToken-0001",
    fromUserId=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.accept_request_async({
    namespaceName="namespace-0001",
    guildModelName="guild-0001",
    accessToken="accessToken-0001",
    fromUserId=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```



---

### acceptRequestByGuildName

Accept join request by specifying a Guild name

Accepts a pending join request for the specified guild (server-side operation), adding the requesting user as a guild member.
The same member assignment, metadata preservation, and limit validations apply as in the guild-user-facing version.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |
| fromUserId | string |  | ✓|  |  ~ 128 chars | User ID |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [ReceiveMemberRequest](#receivememberrequest) | Accepted join request |
| guild | [Guild](#guild) | Guild |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.AcceptRequestByGuildName(
    &guild.AcceptRequestByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: nil,
        GuildName: pointy.String("guild-0001"),
        FromUserId: pointy.String("user-0002"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
guild := result.Guild

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\AcceptRequestByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->acceptRequestByGuildName(
        (new AcceptRequestByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName(null)
            ->withGuildName("guild-0001")
            ->withFromUserId("user-0002")
    );
    $item = $result->getItem();
    $guild = $result->getGuild();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.AcceptRequestByGuildNameRequest;
import io.gs2.guild.result.AcceptRequestByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    AcceptRequestByGuildNameResult result = client.acceptRequestByGuildName(
        new AcceptRequestByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName(null)
            .withGuildName("guild-0001")
            .withFromUserId("user-0002")
    );
    ReceiveMemberRequest item = result.getItem();
    Guild guild = result.getGuild();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.AcceptRequestByGuildNameResult> asyncResult = null;
yield return client.AcceptRequestByGuildName(
    new Gs2.Gs2Guild.Request.AcceptRequestByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName(null)
        .WithGuildName("guild-0001")
        .WithFromUserId("user-0002"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var guild = result.Guild;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.acceptRequestByGuildName(
        new Gs2Guild.AcceptRequestByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName(null)
            .withGuildName("guild-0001")
            .withFromUserId("user-0002")
    );
    const item = result.getItem();
    const guild = result.getGuild();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.accept_request_by_guild_name(
        guild.AcceptRequestByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name(None)
            .with_guild_name('guild-0001')
            .with_from_user_id('user-0002')
    )
    item = result.item
    guild = result.guild
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.accept_request_by_guild_name({
    namespaceName="namespace-0001",
    guildModelName=nil,
    guildName="guild-0001",
    fromUserId="user-0002",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.accept_request_by_guild_name_async({
    namespaceName="namespace-0001",
    guildModelName=nil,
    guildName="guild-0001",
    fromUserId="user-0002",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```



---

### rejectRequest

Reject join request

Rejects a pending join request, removing it from both the guild's inbox and the sender's send box.
The requesting user is not added to the guild. No relationship is established.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Guild Access Token<br>This is the token string obtained using `assume` (or `assumeByUserId`).<br>Permissions are determined by the `PolicyDocument` associated with the role of the member who called `assume`.<br>To reject, you need the `Gs2Guild:RejectRequest` permission in that role's `PolicyDocument`. |
| fromUserId | string |  | ✓|  |  ~ 128 chars | User ID |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [ReceiveMemberRequest](#receivememberrequest) | Rejected join request |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.RejectRequest(
    &guild.RejectRequestRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: nil,
        AccessToken: ,
        FromUserId: pointy.String("user-0002"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\RejectRequestRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->rejectRequest(
        (new RejectRequestRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName(null)
            ->withAccessToken()
            ->withFromUserId("user-0002")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.RejectRequestRequest;
import io.gs2.guild.result.RejectRequestResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    RejectRequestResult result = client.rejectRequest(
        new RejectRequestRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName(null)
            .withAccessToken()
            .withFromUserId("user-0002")
    );
    ReceiveMemberRequest item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.RejectRequestResult> asyncResult = null;
yield return client.RejectRequest(
    new Gs2.Gs2Guild.Request.RejectRequestRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName(null)
        .WithAccessToken()
        .WithFromUserId("user-0002"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.rejectRequest(
        new Gs2Guild.RejectRequestRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName(null)
            .withAccessToken()
            .withFromUserId("user-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.reject_request(
        guild.RejectRequestRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name(None)
            .with_access_token()
            .with_from_user_id('user-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.reject_request({
    namespaceName="namespace-0001",
    guildModelName=nil,
    accessToken=,
    fromUserId="user-0002",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.reject_request_async({
    namespaceName="namespace-0001",
    guildModelName=nil,
    accessToken=,
    fromUserId="user-0002",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### rejectRequestByGuildName

Reject join request by specifying a Guild name

Rejects a pending join request for the specified guild (server-side operation).
The request is removed from both the guild's inbox and the sender's send box.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |
| fromUserId | string |  | ✓|  |  ~ 128 chars | User ID |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [ReceiveMemberRequest](#receivememberrequest) | Rejected join request |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.RejectRequestByGuildName(
    &guild.RejectRequestByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: nil,
        GuildName: pointy.String("guild-0001"),
        FromUserId: pointy.String("user-0002"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\RejectRequestByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->rejectRequestByGuildName(
        (new RejectRequestByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName(null)
            ->withGuildName("guild-0001")
            ->withFromUserId("user-0002")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.RejectRequestByGuildNameRequest;
import io.gs2.guild.result.RejectRequestByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    RejectRequestByGuildNameResult result = client.rejectRequestByGuildName(
        new RejectRequestByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName(null)
            .withGuildName("guild-0001")
            .withFromUserId("user-0002")
    );
    ReceiveMemberRequest item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.RejectRequestByGuildNameResult> asyncResult = null;
yield return client.RejectRequestByGuildName(
    new Gs2.Gs2Guild.Request.RejectRequestByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName(null)
        .WithGuildName("guild-0001")
        .WithFromUserId("user-0002"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.rejectRequestByGuildName(
        new Gs2Guild.RejectRequestByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName(null)
            .withGuildName("guild-0001")
            .withFromUserId("user-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.reject_request_by_guild_name(
        guild.RejectRequestByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name(None)
            .with_guild_name('guild-0001')
            .with_from_user_id('user-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.reject_request_by_guild_name({
    namespaceName="namespace-0001",
    guildModelName=nil,
    guildName="guild-0001",
    fromUserId="user-0002",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.reject_request_by_guild_name_async({
    namespaceName="namespace-0001",
    guildModelName=nil,
    guildName="guild-0001",
    fromUserId="user-0002",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### describeSendRequests

List Sent Join Requests

Retrieves a paginated list of guild join requests that the requesting user has sent and are pending a response.
Results can be filtered by guild model name.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| pageToken | string |  | |  |  ~ 1024 chars | Token specifying the position from which to start acquiring data |
| limit | int |  | | 30 | 1 ~ 1000 | Number of data items to retrieve |

#### Result

|  | Type | Description |
| --- | --- | --- |
| items | [List&lt;SendMemberRequest&gt;](#sendmemberrequest) | List of join requests |
| nextPageToken | string | Page token to retrieve the rest of the listing |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DescribeSendRequests(
    &guild.DescribeSendRequestsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        GuildModelName: pointy.String("guild-0002"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DescribeSendRequestsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->describeSendRequests(
        (new DescribeSendRequestsRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withGuildModelName("guild-0002")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DescribeSendRequestsRequest;
import io.gs2.guild.result.DescribeSendRequestsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DescribeSendRequestsResult result = client.describeSendRequests(
        new DescribeSendRequestsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-0002")
            .withPageToken(null)
            .withLimit(null)
    );
    List<SendMemberRequest> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DescribeSendRequestsResult> asyncResult = null;
yield return client.DescribeSendRequests(
    new Gs2.Gs2Guild.Request.DescribeSendRequestsRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithGuildModelName("guild-0002")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.describeSendRequests(
        new Gs2Guild.DescribeSendRequestsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-0002")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.describe_send_requests(
        guild.DescribeSendRequestsRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_guild_model_name('guild-0002')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.describe_send_requests({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-0002",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.describe_send_requests_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-0002",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```



---

### describeSendRequestsByUserId

List Sent Join Requests by User ID

Retrieves a paginated list of guild join requests that the specified user has sent (server-side operation).
Results can be filtered by guild model name.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| pageToken | string |  | |  |  ~ 1024 chars | Token specifying the position from which to start acquiring data |
| limit | int |  | | 30 | 1 ~ 1000 | Number of data items to retrieve |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| items | [List&lt;SendMemberRequest&gt;](#sendmemberrequest) | List of join requests |
| nextPageToken | string | Page token to retrieve the rest of the listing |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DescribeSendRequestsByUserId(
    &guild.DescribeSendRequestsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        GuildModelName: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DescribeSendRequestsByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->describeSendRequestsByUserId(
        (new DescribeSendRequestsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withGuildModelName(null)
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DescribeSendRequestsByUserIdRequest;
import io.gs2.guild.result.DescribeSendRequestsByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DescribeSendRequestsByUserIdResult result = client.describeSendRequestsByUserId(
        new DescribeSendRequestsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<SendMemberRequest> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DescribeSendRequestsByUserIdResult> asyncResult = null;
yield return client.DescribeSendRequestsByUserId(
    new Gs2.Gs2Guild.Request.DescribeSendRequestsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithGuildModelName(null)
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.describeSendRequestsByUserId(
        new Gs2Guild.DescribeSendRequestsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.describe_send_requests_by_user_id(
        guild.DescribeSendRequestsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_guild_model_name(None)
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.describe_send_requests_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.describe_send_requests_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName=nil,
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```



---

### getSendRequest

Get Sent Join Request

Retrieves a specific guild join request that the requesting user has sent to the specified target guild.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| targetGuildName | string |  | ✓|  |  ~ 128 chars | Target Guild Name<br>The unique name (UUID) of the guild to which the join request was sent. This identifies the specific guild instance that the user is requesting to join, and is used to locate the guild's inbox for request processing. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [SendMemberRequest](#sendmemberrequest) | Join Request |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.GetSendRequest(
    &guild.GetSendRequestRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        GuildModelName: pointy.String("guild-0002"),
        TargetGuildName: pointy.String("guild-0002"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\GetSendRequestRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->getSendRequest(
        (new GetSendRequestRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withGuildModelName("guild-0002")
            ->withTargetGuildName("guild-0002")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.GetSendRequestRequest;
import io.gs2.guild.result.GetSendRequestResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    GetSendRequestResult result = client.getSendRequest(
        new GetSendRequestRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-0002")
            .withTargetGuildName("guild-0002")
    );
    SendMemberRequest item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.GetSendRequestResult> asyncResult = null;
yield return client.GetSendRequest(
    new Gs2.Gs2Guild.Request.GetSendRequestRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithGuildModelName("guild-0002")
        .WithTargetGuildName("guild-0002"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.getSendRequest(
        new Gs2Guild.GetSendRequestRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-0002")
            .withTargetGuildName("guild-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.get_send_request(
        guild.GetSendRequestRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_guild_model_name('guild-0002')
            .with_target_guild_name('guild-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.get_send_request({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-0002",
    targetGuildName="guild-0002",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.get_send_request_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-0002",
    targetGuildName="guild-0002",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### getSendRequestByUserId

Get Sent Join Request by User ID

Retrieves a specific guild join request that the specified user has sent to the specified target guild (server-side operation).


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| targetGuildName | string |  | ✓|  |  ~ 128 chars | Target Guild Name<br>The unique name (UUID) of the guild to which the join request was sent. This identifies the specific guild instance that the user is requesting to join, and is used to locate the guild's inbox for request processing. |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [SendMemberRequest](#sendmemberrequest) | Join Request |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.GetSendRequestByUserId(
    &guild.GetSendRequestByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        GuildModelName: nil,
        TargetGuildName: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\GetSendRequestByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->getSendRequestByUserId(
        (new GetSendRequestByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withGuildModelName(null)
            ->withTargetGuildName(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.GetSendRequestByUserIdRequest;
import io.gs2.guild.result.GetSendRequestByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    GetSendRequestByUserIdResult result = client.getSendRequestByUserId(
        new GetSendRequestByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName(null)
            .withTargetGuildName(null)
            .withTimeOffsetToken(null)
    );
    SendMemberRequest item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.GetSendRequestByUserIdResult> asyncResult = null;
yield return client.GetSendRequestByUserId(
    new Gs2.Gs2Guild.Request.GetSendRequestByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithGuildModelName(null)
        .WithTargetGuildName(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.getSendRequestByUserId(
        new Gs2Guild.GetSendRequestByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName(null)
            .withTargetGuildName(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.get_send_request_by_user_id(
        guild.GetSendRequestByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_guild_model_name(None)
            .with_target_guild_name(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.get_send_request_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName=nil,
    targetGuildName=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.get_send_request_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName=nil,
    targetGuildName=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### sendRequest

Send a join request

Sends a join request to the specified guild. The behavior depends on the guild's join policy:
- "anybody" policy: The user is immediately added to the guild as a member with the default role, without requiring approval.
- Approval-required policy: A join request is created in both the sender's send box and the guild's inbox, awaiting guild master approval.
Before sending, the following validations are performed: the user is not on the guild's ignore list, the rejoin cooldown period has elapsed (if the user previously left), and the maxConcurrentJoinGuilds limit is not exceeded.
Custom member metadata can be included with the request.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| targetGuildName | string |  | ✓|  |  ~ 128 chars | Destination Guild Name |
| metadata | string |  | |  |  ~ 512 chars | Guild Member Metadata<br>Arbitrary data associated with this guild member that does not affect GS2 behavior. Can be used to store member-specific information such as contribution points, last login time, or notes visible to guild officers. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Joined guild<br>Responds when a join request is made to a guild that does not require approval |
| sendMemberRequest | [SendMemberRequest](#sendmemberrequest) | Sent Join Request<br>Responds when a join request is made to a guild that requires approval |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.SendRequest(
    &guild.SendRequestRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        GuildModelName: pointy.String("guild-0002"),
        TargetGuildName: pointy.String("guild-0002"),
        Metadata: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
sendMemberRequest := result.SendMemberRequest

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\SendRequestRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->sendRequest(
        (new SendRequestRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withGuildModelName("guild-0002")
            ->withTargetGuildName("guild-0002")
            ->withMetadata(null)
    );
    $item = $result->getItem();
    $sendMemberRequest = $result->getSendMemberRequest();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.SendRequestRequest;
import io.gs2.guild.result.SendRequestResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    SendRequestResult result = client.sendRequest(
        new SendRequestRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-0002")
            .withTargetGuildName("guild-0002")
            .withMetadata(null)
    );
    Guild item = result.getItem();
    SendMemberRequest sendMemberRequest = result.getSendMemberRequest();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.SendRequestResult> asyncResult = null;
yield return client.SendRequest(
    new Gs2.Gs2Guild.Request.SendRequestRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithGuildModelName("guild-0002")
        .WithTargetGuildName("guild-0002")
        .WithMetadata(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var sendMemberRequest = result.SendMemberRequest;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.sendRequest(
        new Gs2Guild.SendRequestRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-0002")
            .withTargetGuildName("guild-0002")
            .withMetadata(null)
    );
    const item = result.getItem();
    const sendMemberRequest = result.getSendMemberRequest();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.send_request(
        guild.SendRequestRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_guild_model_name('guild-0002')
            .with_target_guild_name('guild-0002')
            .with_metadata(None)
    )
    item = result.item
    send_member_request = result.send_member_request
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.send_request({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-0002",
    targetGuildName="guild-0002",
    metadata=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
sendMemberRequest = result.sendMemberRequest;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.send_request_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-0002",
    targetGuildName="guild-0002",
    metadata=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
sendMemberRequest = result.sendMemberRequest;

```



---

### sendRequestByUserId

Send a join request by specifying the user ID

Sends a join request to the specified guild on behalf of the specified user (server-side operation).
The same join policy behavior, validations (ignore list, cooldown, concurrent guild limit), and approval flow apply as in the user-facing version.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| targetGuildName | string |  | ✓|  |  ~ 128 chars | Destination Guild Name |
| metadata | string |  | |  |  ~ 512 chars | Guild Member Metadata<br>Arbitrary data associated with this guild member that does not affect GS2 behavior. Can be used to store member-specific information such as contribution points, last login time, or notes visible to guild officers. |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [Guild](#guild) | Joined guild<br>Responds when a join request is made to a guild that does not require approval |
| sendMemberRequest | [SendMemberRequest](#sendmemberrequest) | Sent Join Request<br>Responds when a join request is made to a guild that requires approval |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.SendRequestByUserId(
    &guild.SendRequestByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        GuildModelName: nil,
        TargetGuildName: nil,
        Metadata: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
sendMemberRequest := result.SendMemberRequest

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\SendRequestByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->sendRequestByUserId(
        (new SendRequestByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withGuildModelName(null)
            ->withTargetGuildName(null)
            ->withMetadata(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $sendMemberRequest = $result->getSendMemberRequest();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.SendRequestByUserIdRequest;
import io.gs2.guild.result.SendRequestByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    SendRequestByUserIdResult result = client.sendRequestByUserId(
        new SendRequestByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName(null)
            .withTargetGuildName(null)
            .withMetadata(null)
            .withTimeOffsetToken(null)
    );
    Guild item = result.getItem();
    SendMemberRequest sendMemberRequest = result.getSendMemberRequest();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.SendRequestByUserIdResult> asyncResult = null;
yield return client.SendRequestByUserId(
    new Gs2.Gs2Guild.Request.SendRequestByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithGuildModelName(null)
        .WithTargetGuildName(null)
        .WithMetadata(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var sendMemberRequest = result.SendMemberRequest;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.sendRequestByUserId(
        new Gs2Guild.SendRequestByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName(null)
            .withTargetGuildName(null)
            .withMetadata(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const sendMemberRequest = result.getSendMemberRequest();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.send_request_by_user_id(
        guild.SendRequestByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_guild_model_name(None)
            .with_target_guild_name(None)
            .with_metadata(None)
            .with_time_offset_token(None)
    )
    item = result.item
    send_member_request = result.send_member_request
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.send_request_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName=nil,
    targetGuildName=nil,
    metadata=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
sendMemberRequest = result.sendMemberRequest;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.send_request_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName=nil,
    targetGuildName=nil,
    metadata=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
sendMemberRequest = result.sendMemberRequest;

```



---

### deleteRequest

Cancel a sent join request

Cancels (deletes) a guild join request that the requesting user has previously sent.
The request is removed from both the sender's send box and the target guild's inbox.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Access token |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| targetGuildName | string |  | ✓|  |  ~ 128 chars | Target Guild Name<br>The unique name (UUID) of the guild to which the join request was sent. This identifies the specific guild instance that the user is requesting to join, and is used to locate the guild's inbox for request processing. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [SendMemberRequest](#sendmemberrequest) | Join request deleted |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DeleteRequest(
    &guild.DeleteRequestRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        GuildModelName: pointy.String("guild-0002"),
        TargetGuildName: pointy.String("guild-0002"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DeleteRequestRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->deleteRequest(
        (new DeleteRequestRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withGuildModelName("guild-0002")
            ->withTargetGuildName("guild-0002")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DeleteRequestRequest;
import io.gs2.guild.result.DeleteRequestResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DeleteRequestResult result = client.deleteRequest(
        new DeleteRequestRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-0002")
            .withTargetGuildName("guild-0002")
    );
    SendMemberRequest item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DeleteRequestResult> asyncResult = null;
yield return client.DeleteRequest(
    new Gs2.Gs2Guild.Request.DeleteRequestRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithGuildModelName("guild-0002")
        .WithTargetGuildName("guild-0002"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.deleteRequest(
        new Gs2Guild.DeleteRequestRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withGuildModelName("guild-0002")
            .withTargetGuildName("guild-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.delete_request(
        guild.DeleteRequestRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_guild_model_name('guild-0002')
            .with_target_guild_name('guild-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.delete_request({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-0002",
    targetGuildName="guild-0002",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.delete_request_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    guildModelName="guild-0002",
    targetGuildName="guild-0002",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### deleteRequestByUserId

Cancel a sent join request by User ID

Cancels (deletes) a guild join request that the specified user has previously sent (server-side operation).
The request is removed from both the sender's send box and the target guild's inbox.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| targetGuildName | string |  | ✓|  |  ~ 128 chars | Target Guild Name<br>The unique name (UUID) of the guild to which the join request was sent. This identifies the specific guild instance that the user is requesting to join, and is used to locate the guild's inbox for request processing. |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [SendMemberRequest](#sendmemberrequest) | Join request deleted |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DeleteRequestByUserId(
    &guild.DeleteRequestByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        GuildModelName: nil,
        TargetGuildName: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DeleteRequestByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->deleteRequestByUserId(
        (new DeleteRequestByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withGuildModelName(null)
            ->withTargetGuildName(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DeleteRequestByUserIdRequest;
import io.gs2.guild.result.DeleteRequestByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DeleteRequestByUserIdResult result = client.deleteRequestByUserId(
        new DeleteRequestByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName(null)
            .withTargetGuildName(null)
            .withTimeOffsetToken(null)
    );
    SendMemberRequest item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DeleteRequestByUserIdResult> asyncResult = null;
yield return client.DeleteRequestByUserId(
    new Gs2.Gs2Guild.Request.DeleteRequestByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithGuildModelName(null)
        .WithTargetGuildName(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.deleteRequestByUserId(
        new Gs2Guild.DeleteRequestByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withGuildModelName(null)
            .withTargetGuildName(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.delete_request_by_user_id(
        guild.DeleteRequestByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_guild_model_name(None)
            .with_target_guild_name(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.delete_request_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName=nil,
    targetGuildName=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.delete_request_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    guildModelName=nil,
    targetGuildName=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### describeIgnoreUsers

List User IDs that refuse to participate

Retrieves a paginated list of users on the guild's ignore list (blacklist).
Users on this list are prevented from sending join requests to the guild.
Requires the access token of the assumed guild user.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Guild Access Token<br>This is the token string obtained using `assume` (or `assumeByUserId`).<br>Permissions are determined by the `PolicyDocument` associated with the role of the member who called `assume`.<br>To retrieve the list, you need the `Gs2Guild:DescribeIgnoreUser` permission in that role's `PolicyDocument`. |
| pageToken | string |  | |  |  ~ 1024 chars | Token specifying the position from which to start acquiring data |
| limit | int |  | | 30 | 1 ~ 1000 | Number of data items to retrieve |

#### Result

|  | Type | Description |
| --- | --- | --- |
| items | [List&lt;IgnoreUser&gt;](#ignoreuser) | List of User IDs that refuse to participate |
| nextPageToken | string | Page token to retrieve the rest of the listing |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DescribeIgnoreUsers(
    &guild.DescribeIgnoreUsersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        AccessToken: ,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DescribeIgnoreUsersRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->describeIgnoreUsers(
        (new DescribeIgnoreUsersRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withAccessToken()
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DescribeIgnoreUsersRequest;
import io.gs2.guild.result.DescribeIgnoreUsersResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DescribeIgnoreUsersResult result = client.describeIgnoreUsers(
        new DescribeIgnoreUsersRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken()
            .withPageToken(null)
            .withLimit(null)
    );
    List<IgnoreUser> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DescribeIgnoreUsersResult> asyncResult = null;
yield return client.DescribeIgnoreUsers(
    new Gs2.Gs2Guild.Request.DescribeIgnoreUsersRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithAccessToken()
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.describeIgnoreUsers(
        new Gs2Guild.DescribeIgnoreUsersRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken()
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.describe_ignore_users(
        guild.DescribeIgnoreUsersRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_access_token()
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.describe_ignore_users({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken=,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.describe_ignore_users_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken=,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```



---

### describeIgnoreUsersByGuildName

List User IDs that refuse to participate by specifying a Guild name

Retrieves a paginated list of users on the specified guild's ignore list (blacklist) (server-side operation).
Users on this list are prevented from sending join requests to the guild.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |
| pageToken | string |  | |  |  ~ 1024 chars | Token specifying the position from which to start acquiring data |
| limit | int |  | | 30 | 1 ~ 1000 | Number of data items to retrieve |

#### Result

|  | Type | Description |
| --- | --- | --- |
| items | [List&lt;IgnoreUser&gt;](#ignoreuser) | List of User IDs that refuse to participate |
| nextPageToken | string | Page token to retrieve the rest of the listing |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DescribeIgnoreUsersByGuildName(
    &guild.DescribeIgnoreUsersByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-0001"),
        GuildName: pointy.String("guildName-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DescribeIgnoreUsersByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->describeIgnoreUsersByGuildName(
        (new DescribeIgnoreUsersByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-0001")
            ->withGuildName("guildName-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DescribeIgnoreUsersByGuildNameRequest;
import io.gs2.guild.result.DescribeIgnoreUsersByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DescribeIgnoreUsersByGuildNameResult result = client.describeIgnoreUsersByGuildName(
        new DescribeIgnoreUsersByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-0001")
            .withGuildName("guildName-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<IgnoreUser> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DescribeIgnoreUsersByGuildNameResult> asyncResult = null;
yield return client.DescribeIgnoreUsersByGuildName(
    new Gs2.Gs2Guild.Request.DescribeIgnoreUsersByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-0001")
        .WithGuildName("guildName-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.describeIgnoreUsersByGuildName(
        new Gs2Guild.DescribeIgnoreUsersByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-0001")
            .withGuildName("guildName-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.describe_ignore_users_by_guild_name(
        guild.DescribeIgnoreUsersByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-0001')
            .with_guild_name('guildName-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.describe_ignore_users_by_guild_name({
    namespaceName="namespace-0001",
    guildModelName="guild-0001",
    guildName="guildName-0001",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.describe_ignore_users_by_guild_name_async({
    namespaceName="namespace-0001",
    guildModelName="guild-0001",
    guildName="guildName-0001",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```



---

### getIgnoreUser

Get User ID that refuse to participate

Checks whether a specific user is on the guild's ignore list (blacklist).


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Guild Access Token<br>This is the token string obtained using `assume` (or `assumeByUserId`).<br>Permissions are determined by the `PolicyDocument` associated with the role of the member who called `assume`.<br>To retrieve, you need the `Gs2Guild:GetIgnoreUser` permission in that role's `PolicyDocument`. |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [IgnoreUser](#ignoreuser) | User ID that refuse to participate |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.GetIgnoreUser(
    &guild.GetIgnoreUserRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        UserId: pointy.String("user-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\GetIgnoreUserRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->getIgnoreUser(
        (new GetIgnoreUserRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withAccessToken("accessToken-0001")
            ->withUserId("user-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.GetIgnoreUserRequest;
import io.gs2.guild.result.GetIgnoreUserResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    GetIgnoreUserResult result = client.getIgnoreUser(
        new GetIgnoreUserRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken("accessToken-0001")
            .withUserId("user-0001")
    );
    IgnoreUser item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.GetIgnoreUserResult> asyncResult = null;
yield return client.GetIgnoreUser(
    new Gs2.Gs2Guild.Request.GetIgnoreUserRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithAccessToken("accessToken-0001")
        .WithUserId("user-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.getIgnoreUser(
        new Gs2Guild.GetIgnoreUserRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken("accessToken-0001")
            .withUserId("user-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.get_ignore_user(
        guild.GetIgnoreUserRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_access_token('accessToken-0001')
            .with_user_id('user-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.get_ignore_user({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken="accessToken-0001",
    userId="user-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.get_ignore_user_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken="accessToken-0001",
    userId="user-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### getIgnoreUserByGuildName

Get User ID that refuse to participate by specifying a Guild name

Checks whether a specific user is on the specified guild's ignore list (blacklist) (server-side operation).


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [IgnoreUser](#ignoreuser) | User ID that refuse to participate |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.GetIgnoreUserByGuildName(
    &guild.GetIgnoreUserByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-0001"),
        GuildName: pointy.String("guildName-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\GetIgnoreUserByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->getIgnoreUserByGuildName(
        (new GetIgnoreUserByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-0001")
            ->withGuildName("guildName-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.GetIgnoreUserByGuildNameRequest;
import io.gs2.guild.result.GetIgnoreUserByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    GetIgnoreUserByGuildNameResult result = client.getIgnoreUserByGuildName(
        new GetIgnoreUserByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-0001")
            .withGuildName("guildName-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    IgnoreUser item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.GetIgnoreUserByGuildNameResult> asyncResult = null;
yield return client.GetIgnoreUserByGuildName(
    new Gs2.Gs2Guild.Request.GetIgnoreUserByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-0001")
        .WithGuildName("guildName-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.getIgnoreUserByGuildName(
        new Gs2Guild.GetIgnoreUserByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-0001")
            .withGuildName("guildName-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.get_ignore_user_by_guild_name(
        guild.GetIgnoreUserByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-0001')
            .with_guild_name('guildName-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.get_ignore_user_by_guild_name({
    namespaceName="namespace-0001",
    guildModelName="guild-0001",
    guildName="guildName-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.get_ignore_user_by_guild_name_async({
    namespaceName="namespace-0001",
    guildModelName="guild-0001",
    guildName="guildName-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### addIgnoreUser

Add User ID that refuse to participate

Adds a user to the guild's ignore list (blacklist).
Once added, the user will be unable to send join requests to this guild.
If the user already has a pending join request, it is not automatically removed; it must be rejected separately.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Guild Access Token<br>This is the token string obtained using `assume` (or `assumeByUserId`).<br>Permissions are determined by the `PolicyDocument` associated with the role of the member who called `assume`.<br>To add, you need the `Gs2Guild:AddIgnoreUser` permission in that role's `PolicyDocument`. |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [IgnoreUser](#ignoreuser) | User ID that refuse to participate |
| guild | [Guild](#guild) | Guild |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.AddIgnoreUser(
    &guild.AddIgnoreUserRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        UserId: pointy.String("user-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
guild := result.Guild

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\AddIgnoreUserRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->addIgnoreUser(
        (new AddIgnoreUserRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withAccessToken("accessToken-0001")
            ->withUserId("user-0001")
    );
    $item = $result->getItem();
    $guild = $result->getGuild();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.AddIgnoreUserRequest;
import io.gs2.guild.result.AddIgnoreUserResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    AddIgnoreUserResult result = client.addIgnoreUser(
        new AddIgnoreUserRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken("accessToken-0001")
            .withUserId("user-0001")
    );
    IgnoreUser item = result.getItem();
    Guild guild = result.getGuild();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.AddIgnoreUserResult> asyncResult = null;
yield return client.AddIgnoreUser(
    new Gs2.Gs2Guild.Request.AddIgnoreUserRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithAccessToken("accessToken-0001")
        .WithUserId("user-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var guild = result.Guild;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.addIgnoreUser(
        new Gs2Guild.AddIgnoreUserRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken("accessToken-0001")
            .withUserId("user-0001")
    );
    const item = result.getItem();
    const guild = result.getGuild();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.add_ignore_user(
        guild.AddIgnoreUserRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_access_token('accessToken-0001')
            .with_user_id('user-0001')
    )
    item = result.item
    guild = result.guild
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.add_ignore_user({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken="accessToken-0001",
    userId="user-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.add_ignore_user_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken="accessToken-0001",
    userId="user-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```



---

### addIgnoreUserByGuildName

Add User ID that refuse to participate by specifying a Guild name

Adds a user to the specified guild's ignore list (blacklist) (server-side operation).
Once added, the user will be unable to send join requests to this guild.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [IgnoreUser](#ignoreuser) | User ID that refuse to participate |
| guild | [Guild](#guild) | Guild |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.AddIgnoreUserByGuildName(
    &guild.AddIgnoreUserByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-0001"),
        GuildName: pointy.String("guildName-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
guild := result.Guild

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\AddIgnoreUserByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->addIgnoreUserByGuildName(
        (new AddIgnoreUserByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-0001")
            ->withGuildName("guildName-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $guild = $result->getGuild();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.AddIgnoreUserByGuildNameRequest;
import io.gs2.guild.result.AddIgnoreUserByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    AddIgnoreUserByGuildNameResult result = client.addIgnoreUserByGuildName(
        new AddIgnoreUserByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-0001")
            .withGuildName("guildName-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    IgnoreUser item = result.getItem();
    Guild guild = result.getGuild();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.AddIgnoreUserByGuildNameResult> asyncResult = null;
yield return client.AddIgnoreUserByGuildName(
    new Gs2.Gs2Guild.Request.AddIgnoreUserByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-0001")
        .WithGuildName("guildName-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var guild = result.Guild;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.addIgnoreUserByGuildName(
        new Gs2Guild.AddIgnoreUserByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-0001")
            .withGuildName("guildName-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const guild = result.getGuild();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.add_ignore_user_by_guild_name(
        guild.AddIgnoreUserByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-0001')
            .with_guild_name('guildName-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
    guild = result.guild
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.add_ignore_user_by_guild_name({
    namespaceName="namespace-0001",
    guildModelName="guild-0001",
    guildName="guildName-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.add_ignore_user_by_guild_name_async({
    namespaceName="namespace-0001",
    guildModelName="guild-0001",
    guildName="guildName-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
guild = result.guild;

```



---

### deleteIgnoreUser

Delete User ID that refuse to participate

Removes a user from the guild's ignore list (blacklist).
After removal, the user will be able to send join requests to this guild again.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| accessToken | string |  | ✓|  |  ~ 128 chars | Guild Access Token<br>This is the token string obtained using `assume` (or `assumeByUserId`).<br>Permissions are determined by the `PolicyDocument` associated with the role of the member who called `assume`.<br>To delete, you need the `Gs2Guild:DeleteIgnoreUser` permission in that role's `PolicyDocument`. |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [IgnoreUser](#ignoreuser) | User ID that refuse to participate |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DeleteIgnoreUser(
    &guild.DeleteIgnoreUserRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        UserId: pointy.String("user-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DeleteIgnoreUserRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->deleteIgnoreUser(
        (new DeleteIgnoreUserRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withAccessToken("accessToken-0001")
            ->withUserId("user-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DeleteIgnoreUserRequest;
import io.gs2.guild.result.DeleteIgnoreUserResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DeleteIgnoreUserResult result = client.deleteIgnoreUser(
        new DeleteIgnoreUserRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken("accessToken-0001")
            .withUserId("user-0001")
    );
    IgnoreUser item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DeleteIgnoreUserResult> asyncResult = null;
yield return client.DeleteIgnoreUser(
    new Gs2.Gs2Guild.Request.DeleteIgnoreUserRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithAccessToken("accessToken-0001")
        .WithUserId("user-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.deleteIgnoreUser(
        new Gs2Guild.DeleteIgnoreUserRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withAccessToken("accessToken-0001")
            .withUserId("user-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.delete_ignore_user(
        guild.DeleteIgnoreUserRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_access_token('accessToken-0001')
            .with_user_id('user-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.delete_ignore_user({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken="accessToken-0001",
    userId="user-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.delete_ignore_user_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    accessToken="accessToken-0001",
    userId="user-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### deleteIgnoreUserByGuildName

Delete User ID that refuse to participate by specifying a Guild name

Removes a user from the specified guild's ignore list (blacklist) (server-side operation).
After removal, the user will be able to send join requests to this guild again.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildName | string |  | ✓|  |  ~ 128 chars | Guild name |
| userId | string |  | ✓|  |  ~ 128 chars | User ID |
| timeOffsetToken | string |  | |  |  ~ 1024 chars | Time offset token |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [IgnoreUser](#ignoreuser) | User ID that refuse to participate |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DeleteIgnoreUserByGuildName(
    &guild.DeleteIgnoreUserByGuildNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-0001"),
        GuildName: pointy.String("guildName-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DeleteIgnoreUserByGuildNameRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->deleteIgnoreUserByGuildName(
        (new DeleteIgnoreUserByGuildNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-0001")
            ->withGuildName("guildName-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DeleteIgnoreUserByGuildNameRequest;
import io.gs2.guild.result.DeleteIgnoreUserByGuildNameResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DeleteIgnoreUserByGuildNameResult result = client.deleteIgnoreUserByGuildName(
        new DeleteIgnoreUserByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-0001")
            .withGuildName("guildName-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    IgnoreUser item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DeleteIgnoreUserByGuildNameResult> asyncResult = null;
yield return client.DeleteIgnoreUserByGuildName(
    new Gs2.Gs2Guild.Request.DeleteIgnoreUserByGuildNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-0001")
        .WithGuildName("guildName-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.deleteIgnoreUserByGuildName(
        new Gs2Guild.DeleteIgnoreUserByGuildNameRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-0001")
            .withGuildName("guildName-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.delete_ignore_user_by_guild_name(
        guild.DeleteIgnoreUserByGuildNameRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-0001')
            .with_guild_name('guildName-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.delete_ignore_user_by_guild_name({
    namespaceName="namespace-0001",
    guildModelName="guild-0001",
    guildName="guildName-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.delete_ignore_user_by_guild_name_async({
    namespaceName="namespace-0001",
    guildModelName="guild-0001",
    guildName="guildName-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### describeGuildModels

List Guild Models

Retrieves the list of currently active (published) Guild Models in the specified Namespace.
Guild Models define the guild structure including maximum member count, role definitions, guild master role, default member role, join cooldown period, concurrent guild join limits, and inactive guild master succession settings.
Unlike Guild Model Masters, these are read-only and represent the configuration currently in use.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |

#### Result

|  | Type | Description |
| --- | --- | --- |
| items | [List&lt;GuildModel&gt;](#guildmodel) | List of Guild Model |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DescribeGuildModels(
    &guild.DescribeGuildModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DescribeGuildModelsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->describeGuildModels(
        (new DescribeGuildModelsRequest())
            ->withNamespaceName("namespace-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DescribeGuildModelsRequest;
import io.gs2.guild.result.DescribeGuildModelsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DescribeGuildModelsResult result = client.describeGuildModels(
        new DescribeGuildModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<GuildModel> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DescribeGuildModelsResult> asyncResult = null;
yield return client.DescribeGuildModels(
    new Gs2.Gs2Guild.Request.DescribeGuildModelsRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.describeGuildModels(
        new Gs2Guild.DescribeGuildModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.describe_guild_models(
        guild.DescribeGuildModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.describe_guild_models({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.describe_guild_models_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;

```



---

### getGuildModel

Get Guild Model

Retrieves the detailed information of a specific currently active Guild Model by name.
Includes role definitions, maximum member count settings, join policy constraints, inactive guild master succession period (inactivityPeriodDays), and rejoin cooldown configuration.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [GuildModel](#guildmodel) | Guild Model |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.GetGuildModel(
    &guild.GetGuildModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\GetGuildModelRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->getGuildModel(
        (new GetGuildModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.GetGuildModelRequest;
import io.gs2.guild.result.GetGuildModelResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    GetGuildModelResult result = client.getGuildModel(
        new GetGuildModelRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-0001")
    );
    GuildModel item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.GetGuildModelResult> asyncResult = null;
yield return client.GetGuildModel(
    new Gs2.Gs2Guild.Request.GetGuildModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.getGuildModel(
        new Gs2Guild.GetGuildModelRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.get_guild_model(
        guild.GetGuildModelRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.get_guild_model({
    namespaceName="namespace-0001",
    guildModelName="guild-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.get_guild_model_async({
    namespaceName="namespace-0001",
    guildModelName="guild-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### exportMaster

Export Guild Model Master in a master data format that can be activated

Exports all Guild Model Master definitions in the Namespace as a single JSON document suitable for activation.
The exported data includes guild models with their member limits, role definitions, join policies, and succession settings.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [CurrentGuildMaster](#currentguildmaster) | Guild Model master data that can be activated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &guild.ExportMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\ExportMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->exportMaster(
        (new ExportMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.ExportMasterRequest;
import io.gs2.guild.result.ExportMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentGuildMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Guild.Request.ExportMasterRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.exportMaster(
        new Gs2Guild.ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.export_master(
        guild.ExportMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.export_master({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.export_master_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### getCurrentGuildMaster

Get currently active Guild Model master data

Retrieves the Guild Model master data that is currently activated and in use in the specified Namespace.
The returned data contains the JSON definition of all guild models that are currently serving runtime requests.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [CurrentGuildMaster](#currentguildmaster) | Currently active Guild Model master data |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.GetCurrentGuildMaster(
    &guild.GetCurrentGuildMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\GetCurrentGuildMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->getCurrentGuildMaster(
        (new GetCurrentGuildMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.GetCurrentGuildMasterRequest;
import io.gs2.guild.result.GetCurrentGuildMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    GetCurrentGuildMasterResult result = client.getCurrentGuildMaster(
        new GetCurrentGuildMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentGuildMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.GetCurrentGuildMasterResult> asyncResult = null;
yield return client.GetCurrentGuildMaster(
    new Gs2.Gs2Guild.Request.GetCurrentGuildMasterRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.getCurrentGuildMaster(
        new Gs2Guild.GetCurrentGuildMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.get_current_guild_master(
        guild.GetCurrentGuildMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.get_current_guild_master({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.get_current_guild_master_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### preUpdateCurrentGuildMaster

Update Currently Active Master Data (3-phase version)

When uploading master data larger than 1MB, the update is performed in 3 phases.
1. Execute this API to obtain a token and URL for uploading.
2. Upload the master data to the obtained URL.
3. Execute UpdateCurrentGuildMaster by passing the token obtained from the upload to reflect the master data.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |

#### Result

|  | Type | Description |
| --- | --- | --- |
| uploadToken | string | Token used to reflect results after upload |
| uploadUrl | string | URL used to upload |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.PreUpdateCurrentGuildMaster(
    &guild.PreUpdateCurrentGuildMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\PreUpdateCurrentGuildMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentGuildMaster(
        (new PreUpdateCurrentGuildMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $uploadToken = $result->getUploadToken();
    $uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.PreUpdateCurrentGuildMasterRequest;
import io.gs2.guild.result.PreUpdateCurrentGuildMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    PreUpdateCurrentGuildMasterResult result = client.preUpdateCurrentGuildMaster(
        new PreUpdateCurrentGuildMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.PreUpdateCurrentGuildMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentGuildMaster(
    new Gs2.Gs2Guild.Request.PreUpdateCurrentGuildMasterRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.preUpdateCurrentGuildMaster(
        new Gs2Guild.PreUpdateCurrentGuildMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.pre_update_current_guild_master(
        guild.PreUpdateCurrentGuildMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.pre_update_current_guild_master({
    namespaceName="namespace-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.pre_update_current_guild_master_async({
    namespaceName="namespace-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

```



---

### updateCurrentGuildMaster

Update currently active Guild Model master data

Activates new Guild Model master data, replacing the currently active configuration.
Supports two modes: 'direct' for inline master data (suitable for data under 1MB), and 'preUpload' for applying data that was previously uploaded via PreUpdate.
Once activated, all guild-related runtime operations (guild creation, join requests, member management) will use the new configuration.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| mode | string (enum)<br>enum {<br>"direct",<br>"preUpload"<br>}<br> |  | | "direct" |  | Update mode"direct": Directly update master data / "preUpload": Upload master data and then update /  |
| settings | string | {mode} == "direct" | ✓*|  |  ~ 5242880 bytes (5MB) | Master Data<br>* Required if mode is "direct" |
| uploadToken | string | {mode} == "preUpload" | ✓*|  |  ~ 1024 chars | Token obtained by pre-upload<br>Used to apply the uploaded master data.<br>* Required if mode is "preUpload" |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [CurrentGuildMaster](#currentguildmaster) | Updated master data of the currently active Guild Models |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentGuildMaster(
    &guild.UpdateCurrentGuildMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\"version\": \"2024-04-25\", \"guildModels\": [{\"name\": \"guild-0001\", \"defaultMaximumMemberCount\": 10, \"maximumMemberCount\": 50, \"inactivityPeriodDays\": 10, \"roles\": [{\"name\": \"master\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}, {\"name\": \"member\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}], \"guildMasterRole\": \"master\", \"guildMemberDefaultRole\": \"member\", \"rejoinCoolTimeMinutes\": 1440}, {\"name\": \"guild-0002\", \"defaultMaximumMemberCount\": 20, \"maximumMemberCount\": 40, \"inactivityPeriodDays\": 10, \"roles\": [{\"name\": \"master\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}, {\"name\": \"member\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}], \"guildMasterRole\": \"master\", \"guildMemberDefaultRole\": \"member\", \"rejoinCoolTimeMinutes\": 360}]}"),
        UploadToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\UpdateCurrentGuildMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->updateCurrentGuildMaster(
        (new UpdateCurrentGuildMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\"version\": \"2024-04-25\", \"guildModels\": [{\"name\": \"guild-0001\", \"defaultMaximumMemberCount\": 10, \"maximumMemberCount\": 50, \"inactivityPeriodDays\": 10, \"roles\": [{\"name\": \"master\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}, {\"name\": \"member\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}], \"guildMasterRole\": \"master\", \"guildMemberDefaultRole\": \"member\", \"rejoinCoolTimeMinutes\": 1440}, {\"name\": \"guild-0002\", \"defaultMaximumMemberCount\": 20, \"maximumMemberCount\": 40, \"inactivityPeriodDays\": 10, \"roles\": [{\"name\": \"master\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}, {\"name\": \"member\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}], \"guildMasterRole\": \"master\", \"guildMemberDefaultRole\": \"member\", \"rejoinCoolTimeMinutes\": 360}]}")
            ->withUploadToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.UpdateCurrentGuildMasterRequest;
import io.gs2.guild.result.UpdateCurrentGuildMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    UpdateCurrentGuildMasterResult result = client.updateCurrentGuildMaster(
        new UpdateCurrentGuildMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2024-04-25\", \"guildModels\": [{\"name\": \"guild-0001\", \"defaultMaximumMemberCount\": 10, \"maximumMemberCount\": 50, \"inactivityPeriodDays\": 10, \"roles\": [{\"name\": \"master\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}, {\"name\": \"member\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}], \"guildMasterRole\": \"master\", \"guildMemberDefaultRole\": \"member\", \"rejoinCoolTimeMinutes\": 1440}, {\"name\": \"guild-0002\", \"defaultMaximumMemberCount\": 20, \"maximumMemberCount\": 40, \"inactivityPeriodDays\": 10, \"roles\": [{\"name\": \"master\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}, {\"name\": \"member\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}], \"guildMasterRole\": \"master\", \"guildMemberDefaultRole\": \"member\", \"rejoinCoolTimeMinutes\": 360}]}")
            .withUploadToken(null)
    );
    CurrentGuildMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.UpdateCurrentGuildMasterResult> asyncResult = null;
yield return client.UpdateCurrentGuildMaster(
    new Gs2.Gs2Guild.Request.UpdateCurrentGuildMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\"version\": \"2024-04-25\", \"guildModels\": [{\"name\": \"guild-0001\", \"defaultMaximumMemberCount\": 10, \"maximumMemberCount\": 50, \"inactivityPeriodDays\": 10, \"roles\": [{\"name\": \"master\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}, {\"name\": \"member\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}], \"guildMasterRole\": \"master\", \"guildMemberDefaultRole\": \"member\", \"rejoinCoolTimeMinutes\": 1440}, {\"name\": \"guild-0002\", \"defaultMaximumMemberCount\": 20, \"maximumMemberCount\": 40, \"inactivityPeriodDays\": 10, \"roles\": [{\"name\": \"master\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}, {\"name\": \"member\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}], \"guildMasterRole\": \"master\", \"guildMemberDefaultRole\": \"member\", \"rejoinCoolTimeMinutes\": 360}]}")
        .WithUploadToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.updateCurrentGuildMaster(
        new Gs2Guild.UpdateCurrentGuildMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2024-04-25\", \"guildModels\": [{\"name\": \"guild-0001\", \"defaultMaximumMemberCount\": 10, \"maximumMemberCount\": 50, \"inactivityPeriodDays\": 10, \"roles\": [{\"name\": \"master\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}, {\"name\": \"member\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}], \"guildMasterRole\": \"master\", \"guildMemberDefaultRole\": \"member\", \"rejoinCoolTimeMinutes\": 1440}, {\"name\": \"guild-0002\", \"defaultMaximumMemberCount\": 20, \"maximumMemberCount\": 40, \"inactivityPeriodDays\": 10, \"roles\": [{\"name\": \"master\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}, {\"name\": \"member\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}], \"guildMasterRole\": \"master\", \"guildMemberDefaultRole\": \"member\", \"rejoinCoolTimeMinutes\": 360}]}")
            .withUploadToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.update_current_guild_master(
        guild.UpdateCurrentGuildMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{"version": "2024-04-25", "guildModels": [{"name": "guild-0001", "defaultMaximumMemberCount": 10, "maximumMemberCount": 50, "inactivityPeriodDays": 10, "roles": [{"name": "master", "policyDocument": "{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}"}, {"name": "member", "policyDocument": "{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}"}], "guildMasterRole": "master", "guildMemberDefaultRole": "member", "rejoinCoolTimeMinutes": 1440}, {"name": "guild-0002", "defaultMaximumMemberCount": 20, "maximumMemberCount": 40, "inactivityPeriodDays": 10, "roles": [{"name": "master", "policyDocument": "{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}"}, {"name": "member", "policyDocument": "{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}"}], "guildMasterRole": "master", "guildMemberDefaultRole": "member", "rejoinCoolTimeMinutes": 360}]}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.update_current_guild_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2024-04-25\", \"guildModels\": [{\"name\": \"guild-0001\", \"defaultMaximumMemberCount\": 10, \"maximumMemberCount\": 50, \"inactivityPeriodDays\": 10, \"roles\": [{\"name\": \"master\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}, {\"name\": \"member\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}], \"guildMasterRole\": \"master\", \"guildMemberDefaultRole\": \"member\", \"rejoinCoolTimeMinutes\": 1440}, {\"name\": \"guild-0002\", \"defaultMaximumMemberCount\": 20, \"maximumMemberCount\": 40, \"inactivityPeriodDays\": 10, \"roles\": [{\"name\": \"master\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}, {\"name\": \"member\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}], \"guildMasterRole\": \"master\", \"guildMemberDefaultRole\": \"member\", \"rejoinCoolTimeMinutes\": 360}]}",
    uploadToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.update_current_guild_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2024-04-25\", \"guildModels\": [{\"name\": \"guild-0001\", \"defaultMaximumMemberCount\": 10, \"maximumMemberCount\": 50, \"inactivityPeriodDays\": 10, \"roles\": [{\"name\": \"master\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}, {\"name\": \"member\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}], \"guildMasterRole\": \"master\", \"guildMemberDefaultRole\": \"member\", \"rejoinCoolTimeMinutes\": 1440}, {\"name\": \"guild-0002\", \"defaultMaximumMemberCount\": 20, \"maximumMemberCount\": 40, \"inactivityPeriodDays\": 10, \"roles\": [{\"name\": \"master\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}, {\"name\": \"member\", \"policyDocument\": \"{\\\\\\\"Version\\\\\\\": \\\\\\\"2016-04-01\\\\\\\", \\\\\\\"Statements\\\\\\\": [{\\\\\\\"Effect\\\\\\\": \\\\\\\"Allow\\\\\\\", \\\\\\\"Actions\\\\\\\": [\\\\\\\"Gs2Guild:UpdateGuild\\\\\\\"], \\\\\\\"Resources\\\\\\\": [\\\\\\\"*\\\\\\\"]}]}\"}], \"guildMasterRole\": \"master\", \"guildMemberDefaultRole\": \"member\", \"rejoinCoolTimeMinutes\": 360}]}",
    uploadToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### updateCurrentGuildMasterFromGitHub

Update the currently active guild settings from GitHub

Checks out Guild Model master data from a specified GitHub repository and activates it.
The checkout settings specify the repository, branch/tag, and file path to retrieve.
This enables Git-based master data management workflows where guild configurations are version-controlled in a repository.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| checkoutSetting | [GitHubCheckoutSetting](#githubcheckoutsetting) |  | ✓|  |  | Setting for checking out master data from GitHub |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [CurrentGuildMaster](#currentguildmaster) | Updated master data of the currently active Guild Models |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentGuildMasterFromGitHub(
    &guild.UpdateCurrentGuildMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: &guild.GitHubCheckoutSetting{
            ApiKeyId: pointy.String("apiKeyId-0001"),
            RepositoryName: pointy.String("gs2io/master-data"),
            SourcePath: pointy.String("path/to/file.json"),
            ReferenceType: pointy.String("branch"),
            BranchName: pointy.String("develop"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\UpdateCurrentGuildMasterFromGitHubRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->updateCurrentGuildMasterFromGitHub(
        (new UpdateCurrentGuildMasterFromGitHubRequest())
            ->withNamespaceName("namespace-0001")
            ->withCheckoutSetting((new GitHubCheckoutSetting())
                ->withApiKeyId("apiKeyId-0001")
                ->withRepositoryName("gs2io/master-data")
                ->withSourcePath("path/to/file.json")
                ->withReferenceType("branch")
                ->withBranchName("develop")
            )
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.UpdateCurrentGuildMasterFromGitHubRequest;
import io.gs2.guild.result.UpdateCurrentGuildMasterFromGitHubResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    UpdateCurrentGuildMasterFromGitHubResult result = client.updateCurrentGuildMasterFromGitHub(
        new UpdateCurrentGuildMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    CurrentGuildMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.UpdateCurrentGuildMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentGuildMasterFromGitHub(
    new Gs2.Gs2Guild.Request.UpdateCurrentGuildMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Guild.Model.GitHubCheckoutSetting()
            .WithApiKeyId("apiKeyId-0001")
            .WithRepositoryName("gs2io/master-data")
            .WithSourcePath("path/to/file.json")
            .WithReferenceType("branch")
            .WithBranchName("develop")
        ),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.updateCurrentGuildMasterFromGitHub(
        new Gs2Guild.UpdateCurrentGuildMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2Guild.model.GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.update_current_guild_master_from_git_hub(
        guild.UpdateCurrentGuildMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(guild.GitHubCheckoutSetting()
                .with_api_key_id('apiKeyId-0001')
                .with_repository_name('gs2io/master-data')
                .with_source_path('path/to/file.json')
                .with_reference_type('branch')
                .with_branch_name('develop')
            )
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.update_current_guild_master_from_git_hub({
    namespaceName="namespace-0001",
    checkoutSetting={
        api_key_id="apiKeyId-0001",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.update_current_guild_master_from_git_hub_async({
    namespaceName="namespace-0001",
    checkoutSetting={
        api_key_id="apiKeyId-0001",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### describeGuildModelMasters

List Guild Model Masters

Retrieves a paginated list of editable Guild Model Master definitions with optional name prefix filtering.
Changes to masters do not take effect until the master data is activated via the CurrentGuildMaster API.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| namePrefix | string |  | |  |  ~ 64 chars | Filter by Namespace name prefix |
| pageToken | string |  | |  |  ~ 1024 chars | Token specifying the position from which to start acquiring data |
| limit | int |  | | 30 | 1 ~ 1000 | Number of data items to retrieve |

#### Result

|  | Type | Description |
| --- | --- | --- |
| items | [List&lt;GuildModelMaster&gt;](#guildmodelmaster) | List of Guild Model Masters |
| nextPageToken | string | Page token to retrieve the rest of the listing |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DescribeGuildModelMasters(
    &guild.DescribeGuildModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DescribeGuildModelMastersRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->describeGuildModelMasters(
        (new DescribeGuildModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DescribeGuildModelMastersRequest;
import io.gs2.guild.result.DescribeGuildModelMastersResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DescribeGuildModelMastersResult result = client.describeGuildModelMasters(
        new DescribeGuildModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<GuildModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DescribeGuildModelMastersResult> asyncResult = null;
yield return client.DescribeGuildModelMasters(
    new Gs2.Gs2Guild.Request.DescribeGuildModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .WithNamePrefix(null)
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.describeGuildModelMasters(
        new Gs2Guild.DescribeGuildModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.describe_guild_model_masters(
        guild.DescribeGuildModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .with_name_prefix(None)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.describe_guild_model_masters({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.describe_guild_model_masters_async({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

```



---

### createGuildModelMaster

Create Guild Model Master

Creates a new editable Guild Model Master definition. Key configuration includes:
- defaultMaximumMemberCount / maximumMemberCount: Initial and upper limit for guild member capacity
- roles: Role definitions available within guilds of this model
- guildMasterRole / guildMemberDefaultRole: Role assigned to the creator and new members respectively
- inactivityPeriodDays: Number of days of inactivity before guild master auto-succession is triggered
- rejoinCoolTimeMinutes: Cooldown period after leaving before a user can rejoin the same guild
- maxConcurrentJoinGuilds: Maximum number of guilds a user can join simultaneously
- maxConcurrentGuildMasterCount: Maximum number of guild masters allowed per guild
Changes do not take effect until the master data is activated via the CurrentGuildMaster API.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| name | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| description | string |  | |  |  ~ 1024 chars | Description |
| metadata | string |  | |  |  ~ 1024 chars | Metadata<br>Arbitrary values can be set in the metadata.<br>Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
| defaultMaximumMemberCount | int |  | ✓|  | 0 ~ 2147483646 | Default Maximum Member Count<br>The initial maximum number of members allowed when a new guild is created. This value is used as the starting currentMaximumMemberCount for new guilds. Can be increased later up to the maximumMemberCount limit through guild operations or acquire actions. |
| maximumMemberCount | int |  | ✓|  | 0 ~ 2147483646 | Maximum Member Count<br>The absolute upper limit for the number of members a guild can have. The guild's currentMaximumMemberCount cannot exceed this value. This serves as a hard cap to prevent guilds from growing beyond the intended size. |
| inactivityPeriodDays | int |  | | 7 | 1 ~ 365 | Inactivity Period Days<br>The number of days of guild master inactivity after which a new guild master is automatically selected from the remaining guild members. This prevents guilds from becoming unmanageable when the guild master stops playing. |
| roles | [List&lt;RoleModel&gt;](#rolemodel) |  | ✓|  | 1 ~ 10 items | List of Role Models<br>The list of role definitions available within guilds of this type. Must include at least the roles referenced by guildMasterRole and guildMemberDefaultRole. Up to 10 roles can be defined. |
| guildMasterRole | string |  | ✓|  |  ~ 128 chars | Guild Master Role Name<br>The name of the role assigned to guild masters. Must reference a role defined in the roles list. Guild masters typically have full permissions to manage the guild. |
| guildMemberDefaultRole | string |  | ✓|  |  ~ 128 chars | Default Member Role Name<br>The name of the role automatically assigned to new guild members when they join. Must reference a role defined in the roles list. |
| rejoinCoolTimeMinutes | int |  | | 0 | 0 ~ 2147483646 | Rejoin Cool Time (Minutes)<br>The cooldown period in minutes before a user can rejoin a guild after leaving. Set to 0 to allow immediate rejoining. This prevents abuse patterns where users repeatedly join and leave guilds. |
| maxConcurrentJoinGuilds | int |  | |  | 1 ~ 10 | Maximum Concurrent Guild Memberships<br>The maximum number of guilds of this type that a user can be a member of simultaneously. The value ranges from 1 to 10. |
| maxConcurrentGuildMasterCount | int |  | |  | 1 ~ 100 | Maximum Concurrent Guild Master Count<br>The maximum number of guild masters that can exist in a single guild at the same time. Allows for co-leadership designs. The value ranges from 1 to 100. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [GuildModelMaster](#guildmodelmaster) | Guild Model Master created |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.CreateGuildModelMaster(
    &guild.CreateGuildModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("guild-model-0001"),
        Description: nil,
        Metadata: nil,
        DefaultMaximumMemberCount: pointy.Int32(10),
        MaximumMemberCount: pointy.Int32(20),
        InactivityPeriodDays: nil,
        Roles: []guild.RoleModel{
            guild.RoleModel{
                Name: pointy.String("master"),
                PolicyDocument: pointy.String("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}"),
            },
            guild.RoleModel{
                Name: pointy.String("member"),
                PolicyDocument: pointy.String("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}"),
            },
        },
        GuildMasterRole: pointy.String("master"),
        GuildMemberDefaultRole: pointy.String("member"),
        RejoinCoolTimeMinutes: pointy.Int32(1440),
        MaxConcurrentJoinGuilds: nil,
        MaxConcurrentGuildMasterCount: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\CreateGuildModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->createGuildModelMaster(
        (new CreateGuildModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("guild-model-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withDefaultMaximumMemberCount(10)
            ->withMaximumMemberCount(20)
            ->withInactivityPeriodDays(null)
            ->withRoles([
                (new \Gs2\Guild\Model\RoleModel())
                    ->withName("master")
                    ->withPolicyDocument("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}"),
                (new \Gs2\Guild\Model\RoleModel())
                    ->withName("member")
                    ->withPolicyDocument("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}"),
            ])
            ->withGuildMasterRole("master")
            ->withGuildMemberDefaultRole("member")
            ->withRejoinCoolTimeMinutes(1440)
            ->withMaxConcurrentJoinGuilds(null)
            ->withMaxConcurrentGuildMasterCount(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.CreateGuildModelMasterRequest;
import io.gs2.guild.result.CreateGuildModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    CreateGuildModelMasterResult result = client.createGuildModelMaster(
        new CreateGuildModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("guild-model-0001")
            .withDescription(null)
            .withMetadata(null)
            .withDefaultMaximumMemberCount(10)
            .withMaximumMemberCount(20)
            .withInactivityPeriodDays(null)
            .withRoles(Arrays.asList(
                new io.gs2.guild.model.RoleModel()
                    .withName("master")
                    .withPolicyDocument("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}"),
                new io.gs2.guild.model.RoleModel()
                    .withName("member")
                    .withPolicyDocument("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}")
            ))
            .withGuildMasterRole("master")
            .withGuildMemberDefaultRole("member")
            .withRejoinCoolTimeMinutes(1440)
            .withMaxConcurrentJoinGuilds(null)
            .withMaxConcurrentGuildMasterCount(null)
    );
    GuildModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.CreateGuildModelMasterResult> asyncResult = null;
yield return client.CreateGuildModelMaster(
    new Gs2.Gs2Guild.Request.CreateGuildModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("guild-model-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithDefaultMaximumMemberCount(10)
        .WithMaximumMemberCount(20)
        .WithInactivityPeriodDays(null)
        .WithRoles(new Gs2.Gs2Guild.Model.RoleModel[] {
            new Gs2.Gs2Guild.Model.RoleModel()
                .WithName("master")
                .WithPolicyDocument("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}"),
            new Gs2.Gs2Guild.Model.RoleModel()
                .WithName("member")
                .WithPolicyDocument("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}"),
        })
        .WithGuildMasterRole("master")
        .WithGuildMemberDefaultRole("member")
        .WithRejoinCoolTimeMinutes(1440)
        .WithMaxConcurrentJoinGuilds(null)
        .WithMaxConcurrentGuildMasterCount(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.createGuildModelMaster(
        new Gs2Guild.CreateGuildModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("guild-model-0001")
            .withDescription(null)
            .withMetadata(null)
            .withDefaultMaximumMemberCount(10)
            .withMaximumMemberCount(20)
            .withInactivityPeriodDays(null)
            .withRoles([
                new Gs2Guild.model.RoleModel()
                    .withName("master")
                    .withPolicyDocument("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}"),
                new Gs2Guild.model.RoleModel()
                    .withName("member")
                    .withPolicyDocument("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}"),
            ])
            .withGuildMasterRole("master")
            .withGuildMemberDefaultRole("member")
            .withRejoinCoolTimeMinutes(1440)
            .withMaxConcurrentJoinGuilds(null)
            .withMaxConcurrentGuildMasterCount(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.create_guild_model_master(
        guild.CreateGuildModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('guild-model-0001')
            .with_description(None)
            .with_metadata(None)
            .with_default_maximum_member_count(10)
            .with_maximum_member_count(20)
            .with_inactivity_period_days(None)
            .with_roles([
                guild.RoleModel()
                    .with_name('master')
                    .with_policy_document('{"Version": "2016-04-01", "Statements": [{"Effect": "Allow", "Action": ["Gs2Guild:UpdateGuild"], "Resources": ["*"]}]}'),
                guild.RoleModel()
                    .with_name('member')
                    .with_policy_document('{"Version": "2016-04-01", "Statements": [{"Effect": "Allow", "Action": ["Gs2Guild:UpdateGuild"], "Resources": ["*"]}]}'),
            ])
            .with_guild_master_role('master')
            .with_guild_member_default_role('member')
            .with_rejoin_cool_time_minutes(1440)
            .with_max_concurrent_join_guilds(None)
            .with_max_concurrent_guild_master_count(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.create_guild_model_master({
    namespaceName="namespace-0001",
    name="guild-model-0001",
    description=nil,
    metadata=nil,
    defaultMaximumMemberCount=10,
    maximumMemberCount=20,
    inactivityPeriodDays=nil,
    roles={
        {
            name="master",
            policyDocument="{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}",
        },
        {
            name="member",
            policyDocument="{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}",
        }
    },
    guildMasterRole="master",
    guildMemberDefaultRole="member",
    rejoinCoolTimeMinutes=1440,
    maxConcurrentJoinGuilds=nil,
    maxConcurrentGuildMasterCount=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.create_guild_model_master_async({
    namespaceName="namespace-0001",
    name="guild-model-0001",
    description=nil,
    metadata=nil,
    defaultMaximumMemberCount=10,
    maximumMemberCount=20,
    inactivityPeriodDays=nil,
    roles={
        {
            name="master",
            policyDocument="{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}",
        },
        {
            name="member",
            policyDocument="{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}",
        }
    },
    guildMasterRole="master",
    guildMemberDefaultRole="member",
    rejoinCoolTimeMinutes=1440,
    maxConcurrentJoinGuilds=nil,
    maxConcurrentGuildMasterCount=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### getGuildModelMaster

Get Guild Model Master

Retrieves the detailed information of a specific editable Guild Model Master by name.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [GuildModelMaster](#guildmodelmaster) | Guild Model Master |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.GetGuildModelMaster(
    &guild.GetGuildModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\GetGuildModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->getGuildModelMaster(
        (new GetGuildModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.GetGuildModelMasterRequest;
import io.gs2.guild.result.GetGuildModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    GetGuildModelMasterResult result = client.getGuildModelMaster(
        new GetGuildModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
    );
    GuildModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.GetGuildModelMasterResult> asyncResult = null;
yield return client.GetGuildModelMaster(
    new Gs2.Gs2Guild.Request.GetGuildModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.getGuildModelMaster(
        new Gs2Guild.GetGuildModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.get_guild_model_master(
        guild.GetGuildModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.get_guild_model_master({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.get_guild_model_master_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### updateGuildModelMaster

Update Guild Model Master

Updates the configuration of an existing Guild Model Master.
All properties except the name can be changed, including member limits, roles, join cooldown, and inactivity succession settings.
Changes do not take effect until the master data is re-activated via the CurrentGuildMaster API.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| description | string |  | |  |  ~ 1024 chars | Description |
| metadata | string |  | |  |  ~ 1024 chars | Metadata<br>Arbitrary values can be set in the metadata.<br>Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
| defaultMaximumMemberCount | int |  | ✓|  | 0 ~ 2147483646 | Default Maximum Member Count<br>The initial maximum number of members allowed when a new guild is created. This value is used as the starting currentMaximumMemberCount for new guilds. Can be increased later up to the maximumMemberCount limit through guild operations or acquire actions. |
| maximumMemberCount | int |  | ✓|  | 0 ~ 2147483646 | Maximum Member Count<br>The absolute upper limit for the number of members a guild can have. The guild's currentMaximumMemberCount cannot exceed this value. This serves as a hard cap to prevent guilds from growing beyond the intended size. |
| inactivityPeriodDays | int |  | | 7 | 1 ~ 365 | Inactivity Period Days<br>The number of days of guild master inactivity after which a new guild master is automatically selected from the remaining guild members. This prevents guilds from becoming unmanageable when the guild master stops playing. |
| roles | [List&lt;RoleModel&gt;](#rolemodel) |  | ✓|  | 1 ~ 10 items | List of Role Models<br>The list of role definitions available within guilds of this type. Must include at least the roles referenced by guildMasterRole and guildMemberDefaultRole. Up to 10 roles can be defined. |
| guildMasterRole | string |  | ✓|  |  ~ 128 chars | Guild Master Role Name<br>The name of the role assigned to guild masters. Must reference a role defined in the roles list. Guild masters typically have full permissions to manage the guild. |
| guildMemberDefaultRole | string |  | ✓|  |  ~ 128 chars | Default Member Role Name<br>The name of the role automatically assigned to new guild members when they join. Must reference a role defined in the roles list. |
| rejoinCoolTimeMinutes | int |  | | 0 | 0 ~ 2147483646 | Rejoin Cool Time (Minutes)<br>The cooldown period in minutes before a user can rejoin a guild after leaving. Set to 0 to allow immediate rejoining. This prevents abuse patterns where users repeatedly join and leave guilds. |
| maxConcurrentJoinGuilds | int |  | |  | 1 ~ 10 | Maximum Concurrent Guild Memberships<br>The maximum number of guilds of this type that a user can be a member of simultaneously. The value ranges from 1 to 10. |
| maxConcurrentGuildMasterCount | int |  | |  | 1 ~ 100 | Maximum Concurrent Guild Master Count<br>The maximum number of guild masters that can exist in a single guild at the same time. Allows for co-leadership designs. The value ranges from 1 to 100. |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [GuildModelMaster](#guildmodelmaster) | Guild Model Master updated |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.UpdateGuildModelMaster(
    &guild.UpdateGuildModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("{\"hoge\": \"fuga\"}"),
        DefaultMaximumMemberCount: pointy.Int32(15),
        MaximumMemberCount: pointy.Int32(25),
        InactivityPeriodDays: nil,
        Roles: []guild.RoleModel{
            guild.RoleModel{
                Name: pointy.String("master"),
                PolicyDocument: pointy.String("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\", \"Gs2Guild:DeleteMember\"], \"Resources\": [\"*\"]}]}"),
            },
            guild.RoleModel{
                Name: pointy.String("member"),
                PolicyDocument: pointy.String("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}"),
            },
        },
        GuildMasterRole: pointy.String("master"),
        GuildMemberDefaultRole: pointy.String("member"),
        RejoinCoolTimeMinutes: pointy.Int32(4320),
        MaxConcurrentJoinGuilds: nil,
        MaxConcurrentGuildMasterCount: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\UpdateGuildModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->updateGuildModelMaster(
        (new UpdateGuildModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
            ->withDescription("description1")
            ->withMetadata("{\"hoge\": \"fuga\"}")
            ->withDefaultMaximumMemberCount(15)
            ->withMaximumMemberCount(25)
            ->withInactivityPeriodDays(null)
            ->withRoles([
                (new \Gs2\Guild\Model\RoleModel())
                    ->withName("master")
                    ->withPolicyDocument("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\", \"Gs2Guild:DeleteMember\"], \"Resources\": [\"*\"]}]}"),
                (new \Gs2\Guild\Model\RoleModel())
                    ->withName("member")
                    ->withPolicyDocument("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}"),
            ])
            ->withGuildMasterRole("master")
            ->withGuildMemberDefaultRole("member")
            ->withRejoinCoolTimeMinutes(4320)
            ->withMaxConcurrentJoinGuilds(null)
            ->withMaxConcurrentGuildMasterCount(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.UpdateGuildModelMasterRequest;
import io.gs2.guild.result.UpdateGuildModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    UpdateGuildModelMasterResult result = client.updateGuildModelMaster(
        new UpdateGuildModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withDescription("description1")
            .withMetadata("{\"hoge\": \"fuga\"}")
            .withDefaultMaximumMemberCount(15)
            .withMaximumMemberCount(25)
            .withInactivityPeriodDays(null)
            .withRoles(Arrays.asList(
                new io.gs2.guild.model.RoleModel()
                    .withName("master")
                    .withPolicyDocument("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\", \"Gs2Guild:DeleteMember\"], \"Resources\": [\"*\"]}]}"),
                new io.gs2.guild.model.RoleModel()
                    .withName("member")
                    .withPolicyDocument("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}")
            ))
            .withGuildMasterRole("master")
            .withGuildMemberDefaultRole("member")
            .withRejoinCoolTimeMinutes(4320)
            .withMaxConcurrentJoinGuilds(null)
            .withMaxConcurrentGuildMasterCount(null)
    );
    GuildModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.UpdateGuildModelMasterResult> asyncResult = null;
yield return client.UpdateGuildModelMaster(
    new Gs2.Gs2Guild.Request.UpdateGuildModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001")
        .WithDescription("description1")
        .WithMetadata("{\"hoge\": \"fuga\"}")
        .WithDefaultMaximumMemberCount(15)
        .WithMaximumMemberCount(25)
        .WithInactivityPeriodDays(null)
        .WithRoles(new Gs2.Gs2Guild.Model.RoleModel[] {
            new Gs2.Gs2Guild.Model.RoleModel()
                .WithName("master")
                .WithPolicyDocument("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\", \"Gs2Guild:DeleteMember\"], \"Resources\": [\"*\"]}]}"),
            new Gs2.Gs2Guild.Model.RoleModel()
                .WithName("member")
                .WithPolicyDocument("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}"),
        })
        .WithGuildMasterRole("master")
        .WithGuildMemberDefaultRole("member")
        .WithRejoinCoolTimeMinutes(4320)
        .WithMaxConcurrentJoinGuilds(null)
        .WithMaxConcurrentGuildMasterCount(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.updateGuildModelMaster(
        new Gs2Guild.UpdateGuildModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
            .withDescription("description1")
            .withMetadata("{\"hoge\": \"fuga\"}")
            .withDefaultMaximumMemberCount(15)
            .withMaximumMemberCount(25)
            .withInactivityPeriodDays(null)
            .withRoles([
                new Gs2Guild.model.RoleModel()
                    .withName("master")
                    .withPolicyDocument("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\", \"Gs2Guild:DeleteMember\"], \"Resources\": [\"*\"]}]}"),
                new Gs2Guild.model.RoleModel()
                    .withName("member")
                    .withPolicyDocument("{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}"),
            ])
            .withGuildMasterRole("master")
            .withGuildMemberDefaultRole("member")
            .withRejoinCoolTimeMinutes(4320)
            .withMaxConcurrentJoinGuilds(null)
            .withMaxConcurrentGuildMasterCount(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.update_guild_model_master(
        guild.UpdateGuildModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
            .with_description('description1')
            .with_metadata('{"hoge": "fuga"}')
            .with_default_maximum_member_count(15)
            .with_maximum_member_count(25)
            .with_inactivity_period_days(None)
            .with_roles([
                guild.RoleModel()
                    .with_name('master')
                    .with_policy_document('{"Version": "2016-04-01", "Statements": [{"Effect": "Allow", "Action": ["Gs2Guild:UpdateGuild", "Gs2Guild:DeleteMember"], "Resources": ["*"]}]}'),
                guild.RoleModel()
                    .with_name('member')
                    .with_policy_document('{"Version": "2016-04-01", "Statements": [{"Effect": "Allow", "Action": ["Gs2Guild:UpdateGuild"], "Resources": ["*"]}]}'),
            ])
            .with_guild_master_role('master')
            .with_guild_member_default_role('member')
            .with_rejoin_cool_time_minutes(4320)
            .with_max_concurrent_join_guilds(None)
            .with_max_concurrent_guild_master_count(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.update_guild_model_master({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    description="description1",
    metadata="{\"hoge\": \"fuga\"}",
    defaultMaximumMemberCount=15,
    maximumMemberCount=25,
    inactivityPeriodDays=nil,
    roles={
        {
            name="master",
            policyDocument="{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\", \"Gs2Guild:DeleteMember\"], \"Resources\": [\"*\"]}]}",
        },
        {
            name="member",
            policyDocument="{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}",
        }
    },
    guildMasterRole="master",
    guildMemberDefaultRole="member",
    rejoinCoolTimeMinutes=4320,
    maxConcurrentJoinGuilds=nil,
    maxConcurrentGuildMasterCount=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.update_guild_model_master_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
    description="description1",
    metadata="{\"hoge\": \"fuga\"}",
    defaultMaximumMemberCount=15,
    maximumMemberCount=25,
    inactivityPeriodDays=nil,
    roles={
        {
            name="master",
            policyDocument="{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\", \"Gs2Guild:DeleteMember\"], \"Resources\": [\"*\"]}]}",
        },
        {
            name="member",
            policyDocument="{\"Version\": \"2016-04-01\", \"Statements\": [{\"Effect\": \"Allow\", \"Action\": [\"Gs2Guild:UpdateGuild\"], \"Resources\": [\"*\"]}]}",
        }
    },
    guildMasterRole="master",
    guildMemberDefaultRole="member",
    rejoinCoolTimeMinutes=4320,
    maxConcurrentJoinGuilds=nil,
    maxConcurrentGuildMasterCount=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---

### deleteGuildModelMaster

Delete Guild Model Master

Deletes an editable Guild Model Master definition.
This only affects the master data; the currently active (published) model is not affected until the master data is re-activated.


#### Request

|  | Type | Condition | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- | --- |
| namespaceName | string |  | ✓|  |  ~ 128 chars | Namespace name<br>Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| guildModelName | string |  | ✓|  |  ~ 128 chars | Guild Model name<br>Unique Guild Model name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |

#### Result

|  | Type | Description |
| --- | --- | --- |
| item | [GuildModelMaster](#guildmodelmaster) | Guild Model Master deleted |

#### Implementation Example




**Go**
```go

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/guild"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := guild.Gs2GuildRestClient{
    Session: &session,
}
result, err := client.DeleteGuildModelMaster(
    &guild.DeleteGuildModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        GuildModelName: pointy.String("guild-model-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item

```

**PHP**
```php

use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Guild\Gs2GuildRestClient;
use Gs2\Guild\Request\DeleteGuildModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2GuildRestClient(
    $session
);

try {
    $result = $client->deleteGuildModelMaster(
        (new DeleteGuildModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withGuildModelName("guild-model-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}

```

**Java**
```java

import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.guild.rest.Gs2GuildRestClient;
import io.gs2.guild.request.DeleteGuildModelMasterRequest;
import io.gs2.guild.result.DeleteGuildModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2GuildRestClient client = new Gs2GuildRestClient(session);

try {
    DeleteGuildModelMasterResult result = client.deleteGuildModelMaster(
        new DeleteGuildModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
    );
    GuildModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}

```

**C#**
```csharp

using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2GuildRestClient(session);

AsyncResult<Gs2.Gs2Guild.Result.DeleteGuildModelMasterResult> asyncResult = null;
yield return client.DeleteGuildModelMaster(
    new Gs2.Gs2Guild.Request.DeleteGuildModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithGuildModelName("guild-model-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;

```

**TypeScript**
```typescript

import Gs2Core from '@/gs2/core';
import * as Gs2Guild from '@/gs2/guild';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Guild.Gs2GuildRestClient(session);

try {
    const result = await client.deleteGuildModelMaster(
        new Gs2Guild.DeleteGuildModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withGuildModelName("guild-model-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}

```

**Python**
```python

from gs2 import core
from gs2 import guild

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = guild.Gs2GuildRestClient(session)

try:
    result = client.delete_guild_model_master(
        guild.DeleteGuildModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_guild_model_name('guild-model-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)


```

**GS2-Script**
```lua

client = gs2('guild')

api_result = client.delete_guild_model_master({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```

**GS2-Script(Async)**
```lua

client = gs2('guild')

api_result_handler = client.delete_guild_model_master_async({
    namespaceName="namespace-0001",
    guildModelName="guild-model-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;

```



---



