internal static SocketApplicationCommandChoice Create(Model model)
        {
            var entity = new SocketApplicationCommandChoice();

            entity.Update(model);
            return(entity);
        }
コード例 #2
0
        internal void Update(Model model)
        {
            this.Name        = model.Name;
            this.Type        = model.Type;
            this.Description = model.Description;

            this.Default = model.Default.IsSpecified
                ? model.Default.Value
                : (bool?)null;

            this.Required = model.Required.IsSpecified
                ? model.Required.Value
                : (bool?)null;

            this.Choices = model.Choices.IsSpecified
                ? model.Choices.Value.Select(x => SocketApplicationCommandChoice.Create(x)).ToImmutableArray().ToReadOnlyCollection()
                : null;

            this.Options = model.Options.IsSpecified
                ? model.Options.Value.Select(x => SocketApplicationCommandOption.Create(x)).ToImmutableArray().ToReadOnlyCollection()
                : null;
        }