Skip to content

Commit

Permalink
deprecate OrderResourceIdentifier
Browse files Browse the repository at this point in the history
  • Loading branch information
jenschude committed Aug 7, 2023
1 parent 2a3afac commit eeb1a65
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 35 deletions.
12 changes: 0 additions & 12 deletions api-java-mixin.raml
Original file line number Diff line number Diff line change
Expand Up @@ -257,18 +257,6 @@ types:
(java-extends): 'com.commercetools.api.models.ResourcePagedQueryResponse<Order>'
OrderReference:
(java-extends): 'com.commercetools.api.models.Identifiable<Order>'
OrderResourceIdentifier:
(java-extends): 'com.commercetools.api.models.Identifiable<Order>'
(package): Order
type: ResourceIdentifier
(markDeprecated): true
displayName: OrderResourceIdentifier
discriminatorValue: order
properties:
id?:
type: string
key?:
type: string
OrderUpdate:
(java-extends): 'com.commercetools.api.models.ResourceUpdate<OrderUpdate, OrderUpdateAction, OrderUpdateBuilder>'
OrderUpdateAction:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,15 @@ public ByProjectKeyOrdersOrderNumberByOrderNumberGet order(final String key,
return get(apiRoot.orders().withOrderNumber(key).get(), () -> OrderByOrderNumberGet.of(key), getDsl);
}

@Deprecated
public ByProjectKeyOrdersOrderNumberByOrderNumberGet order(final OrderResourceIdentifier identifiable,
final Function<OrderByOrderNumberGet, OrderByOrderNumberGet> getDsl) {
requireNonNull(identifiable.getKey());
return get(apiRoot.orders().withOrderNumber(identifiable.getKey()).get(),
() -> OrderByOrderNumberGet.of(identifiable.getKey()), getDsl);
}

@Deprecated
public ByProjectKeyOrdersOrderNumberByOrderNumberGet order(
final io.sphere.sdk.models.ResourceIdentifiable<io.sphere.sdk.orders.Order> identifiable,
final Function<OrderByOrderNumberGet, OrderByOrderNumberGet> getDsl) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ static InventoryEntryResourceIdentifier toResourceIdentifier(InventoryEntryRefer
return ResourceIdentifierBuilder.of().inventoryEntryBuilder().id(reference.getId()).build();
}

@Deprecated
static OrderResourceIdentifier toResourceIdentifier(OrderReference reference) {
return ResourceIdentifierBuilder.of().orderBuilder().id(reference.getId()).build();
}
Expand Down Expand Up @@ -212,6 +213,7 @@ static InventoryEntryResourceIdentifier toResourceIdentifier(InventoryEntry refe
return ResourceIdentifierBuilder.of().inventoryEntryBuilder().id(reference.getId()).build();
}

@Deprecated
static OrderResourceIdentifier toResourceIdentifier(Order reference) {
return ResourceIdentifierBuilder.of().orderBuilder().id(reference.getId()).build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

public interface OrderMixin extends Referencable<Order>, ResourceIdentifiable<Order> {
@Override
@Deprecated
public default OrderResourceIdentifier toResourceIdentifier() {
return OrderResourceIdentifier.builder().id(getId()).build();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@

package com.commercetools.api.models.order;

import java.time.*;
import java.util.*;
import java.util.function.Function;

import javax.annotation.Nullable;

import com.commercetools.api.models.common.ResourceIdentifier;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.vrap.rmf.base.client.utils.Generated;

import javax.annotation.Nullable;
import java.util.function.Function;

/**
* OrderResourceIdentifier
*
Expand All @@ -26,6 +21,7 @@
* </div>
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
@Deprecated
@JsonDeserialize(as = OrderResourceIdentifierImpl.class)
public interface OrderResourceIdentifier extends ResourceIdentifier, com.commercetools.api.models.Identifiable<Order> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@

package com.commercetools.api.models.order;

import java.util.*;

import javax.annotation.Nullable;

import io.vrap.rmf.base.client.Builder;
import io.vrap.rmf.base.client.utils.Generated;

import javax.annotation.Nullable;

/**
* OrderResourceIdentifierBuilder
* <hr>
Expand All @@ -20,6 +18,7 @@
* </div>
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
@Deprecated
public class OrderResourceIdentifierBuilder implements Builder<OrderResourceIdentifier> {

@Nullable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@

package com.commercetools.api.models.order;

import java.time.*;
import java.util.*;

import com.commercetools.api.models.common.ReferenceTypeId;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.*;

import io.vrap.rmf.base.client.ModelBase;
import io.vrap.rmf.base.client.utils.Generated;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

/**
* OrderResourceIdentifier
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
@Deprecated
public class OrderResourceIdentifierImpl implements OrderResourceIdentifier, ModelBase {

private com.commercetools.api.models.common.ReferenceTypeId typeId;
private ReferenceTypeId typeId;

private String id;

Expand All @@ -48,7 +43,7 @@ public OrderResourceIdentifierImpl() {
* <p>Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.</p>
*/

public com.commercetools.api.models.common.ReferenceTypeId getTypeId() {
public ReferenceTypeId getTypeId() {
return this.typeId;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,6 @@
*
* <h2>Orders</h2>
*
* <p>{@link com.commercetools.api.models.order.Order#toResourceIdentifier()}</p>
* {@include.example example.HelperMethodsTest#orderToResourceIdentifier()}
* <p>{@link com.commercetools.api.models.order.Order#toReference()}</p>
* {@include.example example.HelperMethodsTest#orderToReference()}
* <p>{@link com.commercetools.api.models.order.Order#referenceTypeId()}</p>
Expand Down

0 comments on commit eeb1a65

Please sign in to comment.