packages/sql-semantics-mysql/resources/models/Value/AlterUserStmtWithAlterUserCommandAlterUserListRequireClauseConnectOptionsOptAccountLockPassw_93f5dc3c.php
1<?php
2
3declare(strict_types=1);
4
5namespace SqlSemantics\Statement\Model\MySql\Value;
6
7/**
8 * The alter_user_stmt SQL value; generated by bin/build-models.php.
9 *
10 * @visibility public
11 * @example Accept a structured SQL value
12 * $write = static fn (\SqlSemantics\Statement\Model\MySql\Value\AlterUserStmtWithAlterUserCommandAlterUserListRequireClauseConnectOptionsOptAccountLockPassw_93f5dc3c $value): string => \SqlSemantics\Statement\Writer::render($value);
13 * $write instanceof \Closure // => true
14 */
15final class AlterUserStmtWithAlterUserCommandAlterUserListRequireClauseConnectOptionsOptAccountLockPassw_93f5dc3c implements \SqlSemantics\Statement\Model\MySql\Role\AlterUserStmtForm, \SqlSemantics\Statement\Model\MySql\Role\EvSqlStmtForm, \SqlSemantics\Statement\Model\MySql\Role\EvSqlStmtInnerForm, \SqlSemantics\Statement\Model\MySql\Role\SimpleStatementForm, \SqlSemantics\Statement\Model\MySql\Role\SimpleStatementOrBeginForm, \SqlSemantics\Statement\Model\MySql\Role\SpProcStmtForm, \SqlSemantics\Statement\Model\MySql\Role\SpProcStmtStatementForm, \SqlSemantics\Statement\Model\MySql\Role\StoredRoutineBodyForm, \SqlSemantics\Statement\Command
16{
17 use \SqlSemantics\Statement\Assertion;
18
19 /**
20 * Supplies the SQL values of this form; comments are kept by the position of the symbol each precedes.
21 */
22 public function __construct(
23 public readonly \SqlSemantics\Statement\Model\MySql\Role\AlterUserCommandForm $alterUserCommand,
24 public readonly \SqlSemantics\Statement\Model\MySql\Role\AlterUserListForm $alterUserList,
25 public readonly \SqlSemantics\Statement\Model\MySql\Role\RequireClauseForm $requireClause,
26 public readonly \SqlSemantics\Statement\Model\MySql\Role\ConnectOptionsForm $connectOptions,
27 public readonly \SqlSemantics\Statement\Model\MySql\Role\OptAccountLockPasswordExpireOptionsForm $optAccountLockPasswordExpireOptions,
28 public readonly \SqlSemantics\Statement\Model\MySql\Role\OptUserAttributeForm $optUserAttribute,
29 public readonly \SqlSemantics\Statement\Comments $comments = new \SqlSemantics\Statement\Comments(),
30 ) {
31 $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($alterUserCommand), 'The alterUserCommand must be a generated immutable SQL value.');
32 $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($alterUserList), 'The alterUserList must be a generated immutable SQL value.');
33 $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($requireClause), 'The requireClause must be a generated immutable SQL value.');
34 $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($connectOptions), 'The connectOptions must be a generated immutable SQL value.');
35 $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($optAccountLockPasswordExpireOptions), 'The optAccountLockPasswordExpireOptions must be a generated immutable SQL value.');
36 $this->assert(\SqlSemantics\Statement\Model\MySql\Contract\Contracts::contains($optUserAttribute), 'The optUserAttribute must be a generated immutable SQL value.');
37 }
38
39 /**
40 * Writes SQL entirely from this value's fields.
41 */
42 public function write(\SqlSemantics\Statement\Writer $writer): void
43 {
44 $writer->comments($this->comments, 0);
45 $this->alterUserCommand->write($writer);
46 $writer->comments($this->comments, 1);
47 $this->alterUserList->write($writer);
48 $writer->comments($this->comments, 2);
49 $this->requireClause->write($writer);
50 $writer->comments($this->comments, 3);
51 $this->connectOptions->write($writer);
52 $writer->comments($this->comments, 4);
53 $this->optAccountLockPasswordExpireOptions->write($writer);
54 $writer->comments($this->comments, 5);
55 $this->optUserAttribute->write($writer);
56 }
57
58 /**
59 * Returns a copy with a new alterUserCommand, preserving every other field.
60 */
61 public function withAlterUserCommand(\SqlSemantics\Statement\Model\MySql\Role\AlterUserCommandForm $alterUserCommand): self
62 {
63 return new self($alterUserCommand, $this->alterUserList, $this->requireClause, $this->connectOptions, $this->optAccountLockPasswordExpireOptions, $this->optUserAttribute, $this->comments);
64 }
65
66 /**
67 * Returns a copy with a new alterUserList, preserving every other field.
68 */
69 public function withAlterUserList(\SqlSemantics\Statement\Model\MySql\Role\AlterUserListForm $alterUserList): self
70 {
71 return new self($this->alterUserCommand, $alterUserList, $this->requireClause, $this->connectOptions, $this->optAccountLockPasswordExpireOptions, $this->optUserAttribute, $this->comments);
72 }
73
74 /**
75 * Returns a copy with a new requireClause, preserving every other field.
76 */
77 public function withRequireClause(\SqlSemantics\Statement\Model\MySql\Role\RequireClauseForm $requireClause): self
78 {
79 return new self($this->alterUserCommand, $this->alterUserList, $requireClause, $this->connectOptions, $this->optAccountLockPasswordExpireOptions, $this->optUserAttribute, $this->comments);
80 }
81
82 /**
83 * Returns a copy with a new connectOptions, preserving every other field.
84 */
85 public function withConnectOptions(\SqlSemantics\Statement\Model\MySql\Role\ConnectOptionsForm $connectOptions): self
86 {
87 return new self($this->alterUserCommand, $this->alterUserList, $this->requireClause, $connectOptions, $this->optAccountLockPasswordExpireOptions, $this->optUserAttribute, $this->comments);
88 }
89
90 /**
91 * Returns a copy with a new optAccountLockPasswordExpireOptions, preserving every other field.
92 */
93 public function withOptAccountLockPasswordExpireOptions(\SqlSemantics\Statement\Model\MySql\Role\OptAccountLockPasswordExpireOptionsForm $optAccountLockPasswordExpireOptions): self
94 {
95 return new self($this->alterUserCommand, $this->alterUserList, $this->requireClause, $this->connectOptions, $optAccountLockPasswordExpireOptions, $this->optUserAttribute, $this->comments);
96 }
97
98 /**
99 * Returns a copy with a new optUserAttribute, preserving every other field.
100 */
101 public function withOptUserAttribute(\SqlSemantics\Statement\Model\MySql\Role\OptUserAttributeForm $optUserAttribute): self
102 {
103 return new self($this->alterUserCommand, $this->alterUserList, $this->requireClause, $this->connectOptions, $this->optAccountLockPasswordExpireOptions, $optUserAttribute, $this->comments);
104 }
105
106 /**
107 * Returns a copy with a new comments, preserving every other field.
108 */
109 public function withComments(\SqlSemantics\Statement\Comments $comments): self
110 {
111 return new self($this->alterUserCommand, $this->alterUserList, $this->requireClause, $this->connectOptions, $this->optAccountLockPasswordExpireOptions, $this->optUserAttribute, $comments);
112 }
113}
114