Skip to content

Commit

Permalink
Add additional properties
Browse files Browse the repository at this point in the history
  • Loading branch information
brionmario committed Sep 6, 2023
1 parent 6f06c89 commit caa0bec
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import org.wso2.carbon.identity.api.server.extension.management.v1.model.ExtensionListItemAdditionalProperties;
import javax.validation.constraints.*;


Expand All @@ -41,6 +42,7 @@ public class ExtensionListItem {
private Integer displayOrder;
private List<String> tags = null;

private ExtensionListItemAdditionalProperties additionalProperties;
private String category;
private String type;
private String self;
Expand Down Expand Up @@ -163,6 +165,24 @@ public ExtensionListItem addTagsItem(String tagsItem) {

/**
**/
public ExtensionListItem additionalProperties(ExtensionListItemAdditionalProperties additionalProperties) {

this.additionalProperties = additionalProperties;
return this;
}

@ApiModelProperty(value = "")
@JsonProperty("additionalProperties")
@Valid
public ExtensionListItemAdditionalProperties getAdditionalProperties() {
return additionalProperties;
}
public void setAdditionalProperties(ExtensionListItemAdditionalProperties additionalProperties) {
this.additionalProperties = additionalProperties;
}

/**
**/
public ExtensionListItem category(String category) {

this.category = category;
Expand Down Expand Up @@ -233,14 +253,15 @@ public boolean equals(java.lang.Object o) {
Objects.equals(this.image, extensionListItem.image) &&
Objects.equals(this.displayOrder, extensionListItem.displayOrder) &&
Objects.equals(this.tags, extensionListItem.tags) &&
Objects.equals(this.additionalProperties, extensionListItem.additionalProperties) &&
Objects.equals(this.category, extensionListItem.category) &&
Objects.equals(this.type, extensionListItem.type) &&
Objects.equals(this.self, extensionListItem.self);
}

@Override
public int hashCode() {
return Objects.hash(id, name, description, image, displayOrder, tags, category, type, self);
return Objects.hash(id, name, description, image, displayOrder, tags, additionalProperties, category, type, self);
}

@Override
Expand All @@ -255,6 +276,7 @@ public String toString() {
sb.append(" image: ").append(toIndentedString(image)).append("\n");
sb.append(" displayOrder: ").append(toIndentedString(displayOrder)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" self: ").append(toIndentedString(self)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/*
* Copyright (c) 2023, WSO2 LLC. (http://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.wso2.carbon.identity.api.server.extension.management.v1.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;


import io.swagger.annotations.*;
import java.util.Objects;
import javax.validation.Valid;
import javax.xml.bind.annotation.*;

public class ExtensionListItemAdditionalProperties {

private String key;
private Object value;

/**
**/
public ExtensionListItemAdditionalProperties key(String key) {

this.key = key;
return this;
}

@ApiModelProperty(value = "")
@JsonProperty("key")
@Valid
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}

/**
**/
public ExtensionListItemAdditionalProperties value(Object value) {

this.value = value;
return this;
}

@ApiModelProperty(value = "")
@JsonProperty("value")
@Valid
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}



@Override
public boolean equals(java.lang.Object o) {

if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ExtensionListItemAdditionalProperties extensionListItemAdditionalProperties = (ExtensionListItemAdditionalProperties) o;
return Objects.equals(this.key, extensionListItemAdditionalProperties.key) &&
Objects.equals(this.value, extensionListItemAdditionalProperties.value);
}

@Override
public int hashCode() {
return Objects.hash(key, value);
}

@Override
public String toString() {

StringBuilder sb = new StringBuilder();
sb.append("class ExtensionListItemAdditionalProperties {\n");

sb.append(" key: ").append(toIndentedString(key)).append("\n");
sb.append(" value: ").append(toIndentedString(value)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {

if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n");
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.wso2.carbon.identity.api.server.extension.management.common.utils.ExtensionMgtUtils;
import org.wso2.carbon.identity.api.server.extension.management.v1.model.ExtensionListItem;
import org.wso2.carbon.identity.api.server.extension.management.v1.model.ExtensionListItemAdditionalProperties;
import org.wso2.carbon.identity.extension.mgt.model.ExtensionInfo;

import java.util.function.Function;
Expand All @@ -43,6 +44,8 @@ public ExtensionListItem apply(ExtensionInfo extensionInfo) {
extensionListItem.setType(extensionInfo.getType());
extensionListItem.setSelf(ExtensionMgtUtils.getExtensionInfoLocation(extensionInfo.getType(),
extensionInfo.getId()));
extensionListItem.setAdditionalProperties(
(ExtensionListItemAdditionalProperties) extensionInfo.getAdditionalProperties());
return extensionListItem;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,13 @@ components:
items:
type: string
example: 'OIDC'
additionalProperties:
type: object
properties:
key:
type: string
value:
type: object
category:
type: string
example: 'DEFAULT'
Expand Down

0 comments on commit caa0bec

Please sign in to comment.