-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from moysklad/MC-34258
MC-34258 prerelease 1.2
- Loading branch information
Showing
164 changed files
with
1,926 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/com/lognex/api/clients/AccumulationDiscountClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.lognex.api.clients; | ||
|
||
import com.lognex.api.clients.endpoints.*; | ||
import com.lognex.api.entities.MetaEntity; | ||
import com.lognex.api.entities.discounts.AccumulationDiscount; | ||
|
||
public final class AccumulationDiscountClient extends EntityClientBase | ||
implements | ||
GetListEndpoint<AccumulationDiscount>, | ||
GetByIdEndpoint<AccumulationDiscount>, | ||
PostEndpoint<AccumulationDiscount>, | ||
PutByIdEndpoint<AccumulationDiscount>, | ||
DeleteByIdEndpoint { | ||
|
||
public AccumulationDiscountClient(com.lognex.api.ApiClient api) { | ||
super(api, "/entity/accumulationdiscount/"); | ||
} | ||
|
||
@Override | ||
public Class<? extends MetaEntity> entityClass() { | ||
return AccumulationDiscount.class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/main/java/com/lognex/api/clients/CharacteristicClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package com.lognex.api.clients; | ||
|
||
import com.lognex.api.ApiClient; | ||
import com.lognex.api.clients.endpoints.GetByIdEndpoint; | ||
import com.lognex.api.clients.endpoints.PostEndpoint; | ||
import com.lognex.api.entities.MetaEntity; | ||
import com.lognex.api.entities.products.Variant; | ||
import com.lognex.api.responses.CharacteristicListEntity; | ||
import com.lognex.api.utils.ApiClientException; | ||
import com.lognex.api.utils.HttpRequestExecutor; | ||
import com.lognex.api.utils.params.ApiParam; | ||
|
||
import java.io.IOException; | ||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
public final class CharacteristicClient | ||
extends EntityClientBase | ||
implements | ||
GetByIdEndpoint<Variant.Characteristic>, | ||
PostEndpoint<Variant.Characteristic> | ||
{ | ||
|
||
public CharacteristicClient(ApiClient api) { | ||
super(api, "/entity/variant/metadata/characteristics/"); | ||
} | ||
|
||
/** | ||
* Получить список всех характеристик.<br> | ||
* У полученных объектов поле value всегда null так как это характеристика, а не её значение для модификации товара | ||
*/ | ||
public CharacteristicListEntity get(ApiParam... params) throws IOException, ApiClientException { | ||
return HttpRequestExecutor. | ||
path(api(), path()). | ||
apiParams(params). | ||
get(CharacteristicListEntity.class); | ||
} | ||
|
||
/** | ||
* Создание новой характеристики.<br> | ||
* При создании характеристики <b>учитывается только поле name</b>. | ||
*/ | ||
@Override | ||
public Variant.Characteristic create(Variant.Characteristic newEntity) throws IOException, ApiClientException { | ||
return PostEndpoint.super.create(newEntity); | ||
} | ||
|
||
/** | ||
* Массовое создание новых характеристик.<br> | ||
* При создании характеристики <b>учитывается только поле name</b>. | ||
*/ | ||
public List<Variant.Characteristic> create(Collection<Variant.Characteristic> entities) throws IOException, ApiClientException { | ||
return HttpRequestExecutor. | ||
path(api(), path()). | ||
body(entities). | ||
postList(Variant.Characteristic.class); | ||
} | ||
|
||
@Override | ||
public Class<? extends MetaEntity> entityClass() { | ||
return Variant.Characteristic.class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/com/lognex/api/clients/PersonalDiscountClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.lognex.api.clients; | ||
|
||
import com.lognex.api.clients.endpoints.*; | ||
import com.lognex.api.entities.MetaEntity; | ||
import com.lognex.api.entities.discounts.PersonalDiscount; | ||
|
||
public final class PersonalDiscountClient extends EntityClientBase | ||
implements GetListEndpoint<PersonalDiscount>, | ||
GetByIdEndpoint<PersonalDiscount>, | ||
PostEndpoint<PersonalDiscount>, | ||
PutByIdEndpoint<PersonalDiscount>, | ||
DeleteByIdEndpoint { | ||
|
||
public PersonalDiscountClient(com.lognex.api.ApiClient api) { | ||
super(api, "/entity/personaldiscount/"); | ||
} | ||
|
||
@Override | ||
public Class<? extends MetaEntity> entityClass() { | ||
return PersonalDiscount.class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/com/lognex/api/clients/RoundOffDiscountClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.lognex.api.clients; | ||
|
||
import com.lognex.api.clients.endpoints.GetByIdEndpoint; | ||
import com.lognex.api.clients.endpoints.PutByIdEndpoint; | ||
import com.lognex.api.entities.MetaEntity; | ||
import com.lognex.api.entities.discounts.RoundOffDiscount; | ||
|
||
public final class RoundOffDiscountClient extends EntityClientBase | ||
implements | ||
GetByIdEndpoint<RoundOffDiscount>, | ||
PutByIdEndpoint<RoundOffDiscount> { | ||
|
||
public RoundOffDiscountClient(com.lognex.api.ApiClient api) { | ||
super(api, "/entity/discount/"); | ||
} | ||
|
||
@Override | ||
public Class<? extends MetaEntity> entityClass() { | ||
return RoundOffDiscount.class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/com/lognex/api/clients/SpecialPriceDiscountClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.lognex.api.clients; | ||
|
||
import com.lognex.api.clients.endpoints.*; | ||
import com.lognex.api.entities.MetaEntity; | ||
import com.lognex.api.entities.discounts.SpecialPriceDiscount; | ||
|
||
public final class SpecialPriceDiscountClient extends EntityClientBase | ||
implements | ||
GetListEndpoint<SpecialPriceDiscount>, | ||
GetByIdEndpoint<SpecialPriceDiscount>, | ||
PostEndpoint<SpecialPriceDiscount>, | ||
PutByIdEndpoint<SpecialPriceDiscount>, | ||
DeleteByIdEndpoint { | ||
public SpecialPriceDiscountClient(com.lognex.api.ApiClient api) { | ||
super(api, "/entity/specialpricediscount/"); | ||
} | ||
|
||
@Override | ||
public Class<? extends MetaEntity> entityClass() { | ||
return SpecialPriceDiscount.class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.